Running Mercurial 2.0.2 on Windows:
In my .hgrc:
[subpaths]
MYREPOS/(.*) = https://server/repos/\1
And in my .hgsub:
subrepo/lib = MYREPOS/lib
When I do a push, the push path of the sub repo is the concatenation of it's path to the main repo, rather than an absolute path - the output is:
pushing to https://server/repos/main
pushing subrepo subrepo\lib to https://server/repos/main/http%3A//server/repos/lib
I would have expected:
pushing to https://server/repos/main
pushing subrepo subrepo\lib to https://server/repos/lib
Is it because the 'absoluteness or relativeness' of the sub repo path is determined by right hand path in .hgsub and not the value it is mapped to? For example, MYREPOS/lib is relative, and therefore the mapped path will be treated as relative, whether it is or not?
The subrepository logic was changed between 1.9 and 2.0. The procedure is now:
.hgsub
is relative, then join it with the main repository pathBefore this change, we would:
.hgsub
So you're right that
MYREPOS/lib
is seen as a relative path in the first step. The full path for the subrepository is thereforeand your remapping pattern still triggers. This explains why you see
http://...
in the middle of the push URL. However, there is a fallback that will revert to the old behavior. If your pattern isthen it wont match anything in the new step 2 — it will only remap
MYREPOS
at the beginning of the path. We notice this and use the old algorithm!