changeset 19012:811e253226c3

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.
author pozheg <pozheg@gmail.com>
date Tue, 16 Apr 2013 22:00:05 -0500
parents 12acbea17625
children 2b34d004e644
files mercurial/subrepo.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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,