# HG changeset patch # User pozheg # Date 2013-04-17 03:00:05 # Node ID 811e253226c332ebcbc4dcf224861fa65096e0cf # Parent 12acbea17625a1441503418f7f2f49aa3825cf2f 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. diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -1266,7 +1266,7 @@ class gitsubrepo(abstractsubrepo): 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,