Default path in subrepos

Georg Zetzsche georgz at gmx.de
Thu Nov 18 09:56:35 CST 2010


Hi everyone,

when creating a new subrepo by means of pull -u <src>, Mercurial
sets the default path of the new subrepo to the address of
the source (sub)repo. However, it seems that if <src> is a
path expression relative to the parent repo, then the default
path of the new subrepo is also made relative to the parent repo
when it should be relative to the subrepo. Here's an example:

---------------------------------------------------------------
vcstest at ultra20:~$ hg init repo
vcstest at ultra20:~$ cd repo/
vcstest at ultra20:~/repo$ hg init sub
vcstest at ultra20:~/repo$ echo sub = sub > .hgsub
vcstest at ultra20:~/repo$ hg add .hgsub
vcstest at ultra20:~/repo$ hg ci -m "new subrepo"
vcstest at ultra20:~/repo$ echo hello > sub/a
vcstest at ultra20:~/repo$ cd sub/
vcstest at ultra20:~/repo/sub$ hg add a
vcstest at ultra20:~/repo/sub$ cd ..
vcstest at ultra20:~/repo$ hg ci -m change
vcstest at ultra20:~/repo$ cd ..
vcstest at ultra20:~$ hg init repo2
vcstest at ultra20:~$ cd repo2/
vcstest at ultra20:~/repo2$ hg pull -u ../repo
vcstest at ultra20:~/repo2$ cat sub/.hg/hgrc
[paths]
default = ../repo/sub
---------------------------------------------------------------

I expected this to be ../../repo/sub, and indeed an "hg pull" vom
within ~/repo2/sub fails.


Regards,
Georg



More information about the Mercurial mailing list