[PATCH 2 of 2] addremove: restore the relative path printing when files are named

Matt Harbison mharbison72 at gmail.com
Thu Dec 4 23:28:32 CST 2014


On Fri, 05 Dec 2014 00:03:40 -0500, Martin von Zweigbergk  
<martinvonz at google.com> wrote:

> This series looks good to me. Thanks!
>
> On Thu Dec 04 2014 at 8:48:18 PM Matt Harbison <mharbison72 at gmail.com>
> wrote:
>
>>
>> The test change demonstrates the correctness when a file is specified
>> (i.e. the
>> glob is required on Windows because relative paths use '\' and absolute
>> paths
>> use '/').
>>
>
> Off topic, but it seems weird that absolute paths would use '/'. At  
> first I
> thought it was a typo, but then I saw the absolute paths in your mail  
> about
> Mads's rebase patch. Do you know why absolute paths use '/'? I don't even
> use Windows anymore, so it doesn't matter to me; I'm just curious.

For the series we've been discussing, "absolute" isn't absolute in the  
sense of 'C:\dir' or '/var/log'- I guess it is just "absolute" from the  
top of the repo.  I think I read a comment somewhere recently that  
dirstate always uses '/' as a separator, and that was carried forth with  
the file names in walk().  Sometimes the '/' also leaks into windows for  
relative paths because there are various bits of code that do '"parent" +  
"/" + "file"' joins instead of os.path.join().

The '/' in some of the paths in that stacktrace I sent in is a bit  
mysterious, because it seems to only be for evolve.py and showconfig says:

$ ../hg showconfig extensions
extensions.evolve=C:\Users\Matt\Projects\hg-evolve\hgext\evolve.py

But the Windows API accepts either style, so it's probably more effort  
than it is worth to completely fix.

--Matt


More information about the Mercurial-devel mailing list