Windows long path experimenting report

Paul Moore p.f.moore at gmail.com
Fri Jun 20 05:20:36 CDT 2008


On 20/06/2008, Patrick Mézard <pmezard at gmail.com> wrote:
> Adrian Buehlmann a écrit :
> > On 20.06.2008 10:18, Patrick Mézard wrote:
> >> Adrian Buehlmann a écrit :
> > Should I abandon trying the \\?\.. thing now?
>
> No, since you just prove my assumptions were partially wrong.
>
> The inability to remove a repository from command line is a bit of a pain, but if it
> works from Windows Explorer, then it's fine. Not everybody have this kind of
> repo, and it's a small price to pay.
>
> The filename transformation when copying a repository is more problematic
> because it breaks it and this case is likely to happen with backup tools.
>
> So, the situation is still not good but it's not a complete dead end yet.

I think the key point here is that long file names are only
*partially* supported by the Windows API, and applications needed to
be coded specially to work with them.

We can never ensure that all tools work. It might be possible to
ensure that Explorer (for example) copes with them, which is a good
start, certainly, but far from perfect.

My view is that Mercurial can (and should) support long filenames if
possible, but:

1. It should warn that other tools may have issues with the repo, when
creating a repo which requires the \\?\ API to manage it.
2. Possibly, it should even require a command-line flag to enable \\?\
handling - just to be sure the user is aware of what he's doing.
3. All possible measures should be taken to minimise the need for \\?\
handling (i.e., I'd still like to see a more compact encoding scheme)

Whether it's reasonable to reject long/reserved filenames in the
working directory (as opposed to the repo store) is less clear to me.
On the one hand, why allow users to check out files that they can't
then work with (this is much like the case of 2 files with names that
only differ in case), but on the other hand, that makes Adrian's case
of a repo with an 'aux' directory unusable again. Maybe a filter to
map filenames on checkout would be a workaround here?

Paul.



More information about the Mercurial-devel mailing list