[PATCH] Fixed issue 3870

Eugeny Pozharsky pozheg at gmail.com
Wed Mar 27 06:16:58 CDT 2013


# HG changeset patch
# User pozheg <pozheg at gmail.com>
# Date 1364382672 -10800
# Node ID b8fcb5c31f1b6ce8bb3bfa4943d928447d83dcac
# Parent  af9ddea2cb99b6e4314a6e79b793b5fc30ea4f19
opener: 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 -r af9ddea2cb99 -r b8fcb5c31f1b mercurial/subrepo.py
--- a/mercurial/subrepo.py      Thu Feb 28 13:11:42 2013 -0800
+++ b/mercurial/subrepo.py      Wed Mar 27 14:11:12 2013 +0300
@@ -1151,7 +1151,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,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20130327/1c5128de/attachment.html>


More information about the Mercurial-devel mailing list