[PATCH 1 of 3] Add a new function, filesystem_case

Paul Moore p.f.moore at gmail.com
Wed Apr 23 17:09:15 CDT 2008


2008/4/23 Matt Mackall <mpm at selenic.com>:
>  First off, a style note: we don't use underbars. I don't ever want to
>  remember whether the function is filesystemcase, filesystem_case,
>  filesystemCase, or FilesystemCase. I always want things in the first
>  style, whether it be a function, class, module, whatever.

Thanks. Patrick has suggested a better name, fspath. I'll go with that.

>  Second, this problem isn't at all localized to Windows, so localizing
>  the solution to Windows is getting off on the wrong foot. Just define
>  the function everywhere and then use checkfolding to decide whether or
>  not to /use/ it.

That sounds fair. I can think of (obscure) cases[1] where this might
be complicated or even outright wrong but it's probably a reasonable
compromise. It may make it harder for a Mac OS expert to later come
along and tweak it to cover normalisation, but I'll worry about that
when it becomes an issue.

[1] A simple example is where finding a guaranteed-foldable filename
could be tricky. In the add command, I want to use the fspath function
on the user supplied filename, which may be 111/222/333 (nothing
foldable there). Of course, in that situation there's no case
sensitivity issue either, so a precheck would do the job.

A more complex (and rare) example is a directory structure a (repo
root, on an ext3 FS), a/.hg, files in a, and a subdirectory a/b which
is a mounted FAT32 volume. Then the case sensitivity varies as we
traverse the path of a file in a/b. Frankly, I'd be tempted to say
that anyone doing that deserves whatever breakage they get...

I'll ponder all this and revise based on it. Thanks for the comments.
Paul.


More information about the Mercurial-devel mailing list