Possibly ignorable test failure?

Paul Moore p.f.moore at gmail.com
Wed May 21 11:36:02 CDT 2008


2008/5/20 Paul Moore <p.f.moore at gmail.com>:
> 2008/5/20 Dirkjan Ochtman <dirkjan at ochtman.nl>:
>> I think in this case changing the test output would be just fine. If the paths
>> are still correct (and in fact, closer to what Windows users are used to), that
>> seems like an improvement to me, and certainly not reason to bloat the core.
>
> Fair enough, but I don't know how to change the test output in a way
> that doesn't break Unix.
[...]
> Maybe for now, I'll add the separator-preserving hackery, and try to
> do so in a way that lets me easily remove it later, if a better option
> becomes possible...

Thinking about it some more, it simply isn't going to be possible to
do this. Consider (on Windows)

>echo a test >A
>hg add -v a
adding a

We need this to say "adding A", because that's what it's doing. (Not
at the moment, but that's correct behaviour, given that we are trying
to ensure that hg handles case insensitive filesystems properly). So
the message must report the actual name of the file, as recorded in
the filesystem. That's essential feedback for the user, as to what
actually went on.

Now consider (again on Windows)

>mkdir B
>echo a test >b/c
hg add -v b/c

The "real" name is B\c, so we should report "added B\c". Using '/'
rather than '\' would be relatively innocuous, as anyone who uses '/'
as a path separator on Windows can be expected to know that '/' and
'\' are equivalent - but '\' is more accurate, and we're having to
report 'B' rather than 'b', so why not do both corrections?

(Just for balance, consider this, on Unix:

$mkdir a
$mkdir a/b
$echo a test >a/b/c
$hg add -v a/d/../b/c

If we're reporting the "real" name, should we not report a/b/c? The
spurious 'd/../' is not part of the filename as the system knows it).
Note that my patches aren't changing anything on Unix case-sensitive
filesystems, so this point is only for others better qualified to
consider (there are symlink questions to think about).

So, to summarise, in my view (as I originally stated, and as you
agreed) we should be reporting names as stored in the filesystem
(i.e., as reported back by fspath). The test suite is going to be
broken by this on Windows (but not on Unix), but I don't know of any
way to fix that, so I'll have to leave that to someone else (I'm happy
to assist with fixing it, but I simply don't understand the way it's
patched to work on Windows well enough to make a fix).

On that basis, I'll post my current patches for review.

Paul.


More information about the Mercurial-devel mailing list