Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 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 | 88d1b59f6906 |
children | ed1a212193dc |
comparison
equal
deleted
inserted
replaced
19011:12acbea17625 | 19012:811e253226c3 |
---|---|
1264 remote = b | 1264 remote = b |
1265 break | 1265 break |
1266 | 1266 |
1267 if remote not in tracking: | 1267 if remote not in tracking: |
1268 # create a new local tracking branch | 1268 # create a new local tracking branch |
1269 local = remote.split('/', 2)[2] | 1269 local = remote.split('/', 3)[3] |
1270 checkout(['-b', local, remote]) | 1270 checkout(['-b', local, remote]) |
1271 elif self._gitisancestor(branch2rev[tracking[remote]], remote): | 1271 elif self._gitisancestor(branch2rev[tracking[remote]], remote): |
1272 # When updating to a tracked remote branch, | 1272 # When updating to a tracked remote branch, |
1273 # if the local tracking branch is downstream of it, | 1273 # if the local tracking branch is downstream of it, |
1274 # a normal `git pull` would have performed a "fast-forward merge" | 1274 # a normal `git pull` would have performed a "fast-forward merge" |