Pushing relative subrepos

Georg Zetzsche georgz at gmx.de
Wed Nov 17 18:35:45 UTC 2010


Hi everyone,

I noticed some unexpected behaviour of "hg push".

Suppose you have a repository that contains subrepos with relative
locations, e.g. with "sub = sub" in .hgsub. I have noticed that
Mercurial fails to push the repository to a remote repository that
does not have all the subrepos of the local one (for an example, see
below). This seems to be due to the fact that "hg push" doesn't make
sure that the corresponding subrepo exists in the target repo.

As far as I can see, "hg push" should "hg init" a subfolder in the
target repo before pushing the subrepo in this case.

Is this a bug?

Regards,
Georg

---------------------------------------------------
$ hg init repo
$ cd repo/
$ hg init sub
$ echo sub = sub > .hgsub
$ hg add .hgsub
$ hg ci -m "new subrepo"
$ echo hello > sub/a
$ cd sub/
$ hg add a
$ cd ..
$ hg ci -m change
$ hg init ../repo2
$ hg push ../repo2
pushing to ../repo2
pushing subrepo sub to ../repo2/sub
abort: repository ../repo2/sub not found!




More information about the Mercurial mailing list