[Bug 3870] New: Clone of git sub-repository creates incorrect git branch.

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Wed Mar 27 05:25:13 CDT 2013


http://bz.selenic.com/show_bug.cgi?id=3870

          Priority: normal
            Bug ID: 3870
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: Clone of git sub-repository creates incorrect git
                    branch.
          Severity: bug
    Classification: Unclassified
                OS: All
          Reporter: pozheg at gmail.com
          Hardware: All
            Status: UNCONFIRMED
           Version: unspecified
         Component: Mercurial
           Product: Mercurial

To reproduce:
- create a git repo
- create a mercurial repo
- add the git repo to the mercurial one as a sub-repo
- clone the mercurial repo into the repo-1
- create a new branch in the repo-1/sub-repo
- made any changes in the repo-1/sub-repo
- commit and push the changes via mercurial (for repo-1)

- clone the mercurial repo into another repo (repo-2)
- go to the subrepo and check that current branch not the branch from origin -
it is new and named as 'origin/<branch>'.
- make any changes, commit and push repo with mercurial
  => new branch added to origin named 'origin/<branch>'

This bug can be simply fixed by changing
        if remote not in tracking:
            # create a new local tracking branch
            local = remote.split('/', 2)[2]
            checkout(['-b', local, remote])
with
        if remote not in tracking:
            # create a new local tracking branch
            local = remote.split('/', 3)[3]
            checkout(['-b', local, remote])
in the subrepo.py

I have tested this fix for version 2.5.2 - it works.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list