canonpath usage on Windows

Peer Sommerlund peer.sommerlund at gmail.com
Sun Nov 28 08:39:23 CST 2010


Hi list

I have found what I guess is a bug in the usage of canonpath on Windows.

util.canonpath contains the line
        name = os.path.join(root, cwd, name)

On windows, if root and cwd both are absolute paths, then root is thrown
away.

I'm testing patch branch pbackout from Aptana studio, and this cause the
canonpath to be called with
root=C:\Users\Peer\src\my-repo
cwd=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Aptana
myname=.hgpatchinfo/

In this case the above statement throws root away, and .hgpatchinfo is never
found, even though it is located at root.

I was not able to determine which code calls canonpath, but I'm pretty sure
the code has left the pbranch extension calling mercurial.patch.patch. My
guess is somewhere between patch and canonpath.

I can reproduce the problem from the command line, where --repository is
provided with a different location that current work dir.

cd C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Aptana
hg pbackout --repository C:\Users\Peer\src\my-repo pgraph

Regards,
Peer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20101128/fb36c623/attachment.htm>


More information about the Mercurial-devel mailing list