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

Paul Moore p.f.moore at gmail.com
Sun Jun 15 11:19:00 CDT 2008


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.



More information about the Mercurial mailing list