canonpath usage on Windows

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


On 28 November 2010 18:20, Dan Villiom Podlaski Christiansen <
danchr at gmail.com> 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.

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


More information about the Mercurial-devel mailing list