Windows people: please help check idea for a new Mercurial repository layout

Andreas Axelsson andreas.axelsson at gmail.com
Sun Jun 15 13:01:43 CDT 2008


Kim Hamilton has written a three part blog entry on the Microsoft BCL team blog about long paths in .NET, and it gives some details on the Win32 API implementation and limitations. Perhaps it can help shed some light on the right way to proceed.

http://blogs.msdn.com/bclteam/archive/2007/02/13/long-paths-in-net-part-1-of-3-kim-hamilton.aspx

Cheers,
/axl

> -----Original Message-----
> From: mercurial-bounces at selenic.com [mailto:mercurial-
> bounces at selenic.com] On Behalf Of Paul Moore
> Sent: den 15 juni 2008 18:19
> To: Matt Mackall
> Cc: Frank A. Kingswood; Mercurial at selenic.com
> Subject: Re: Windows people: please help check idea for a new Mercurial
> repository layout
> 
> 2008/6/15 Matt Mackall <mpm at selenic.com>:
> > It's mostly a problem with path length, actually. Filenames can be
> 255
> > characters, but the total path length is limited to 260. Or something
> > like that. ?And if someone makes a repository with deeper and deeper
> > paths over time, most of the directory hierarchy will exist when we
> hit
> > the limit.
> >
> > It may be that it's a limit on relative path lengths though, which
> means
> > we might be able to teach opener() to change directories if it gets a
> > path length error or something like that. But someone with Windows
> will
> > have to test that.
> 
> I'll see if I can do some testing. It's a shame the documentation
> isn't particularly clear (at least to me, I'll reread it sometime to
> see if I misunderstood anything). My understanding is that \\?\ is
> essentially a marker to tell the CreateFile API to use different (less
> restrictive) rules for valid filenames - the name is the same
> regardless. So if you have a file with a problematic name, whether it
> is "usable" in a given app depends on whether the app uses \\?\
> format. I'd never expect the user to enter the \\?\.
> 
> I'm also not 100% clear on where Explorer comes into this. Clearly the
> files in the working directory must be usable in Explorer, so long
> paths, and reserved names aren't OK there (so it may not be possible
> to check out such names). I see no inherent problem with that, any
> more than with the fact that 2 files readme and README can't exist at
> once. So we're looking at names in the .hg directory (the store)
> specifically, is that right? In that case, I'd say who cares if
> Explorer can't manage them? People shouldn't be using Explorer to deal
> with files in the store anyway - they are internal to Mercurial. It's
> arguable taht the .hg directory should be hidden, so there's even less
> chance of people messing round in there. (There are a couple of minor
> exceptions to this - hgrc and maybe patches/series).
> 
> So if Mercurial can deal with problematic filenames in the store, does
> it matter that Explorer can't?
> 
> Paul.
> 
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial




More information about the Mercurial mailing list