canonpath usage on Windows

Peer Sommerlund peer.sommerlund at
Sun Nov 28 13:34:55 CST 2010

On 28 November 2010 18:20, Dan Villiom Podlaski Christiansen <
danchr at> wrote:

> On 28 Nov 2010, at 15:39, Peer Sommerlund wrote:
> 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/
> This is correct. Relative paths are *always* interpreted relative to the
> current working directory. If you want to specify a path relative to the
> repository root without “being there”, you should use --cwd instead of
> --repo.

Thank you for clearing this up. In this case the bug is mine, since I built
the command line using --repository.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Mercurial-devel mailing list