subrepo: clone of git sub-repository creates incorrect git branch (
issue3870)
Mercurial handles git subrepos by incorrect way.
If the mercurial repo has a git sub-repo and somebody started
a new branch in the subrepo and push it into git, the next one
who will clone the whole repo will get incorrect branch name in the git
subrepo.
--- a/mercurial/subrepo.py Tue Apr 16 14:39:37 2013 -0700
+++ b/mercurial/subrepo.py Tue Apr 16 22:00:05 2013 -0500
@@ -1266,7 +1266,7 @@
if remote not in tracking:
# create a new local tracking branch
- local = remote.split('/', 2)[2]
+ local = remote.split('/', 3)[3]
checkout(['-b', local, remote])
elif self._gitisancestor(branch2rev[tracking[remote]], remote):
# When updating to a tracked remote branch,