subrepo: fix for merge inconsistencies stable
authorFriedrich Kastner-Masilko <kastner_masilko@at.festo.com>
Wed, 29 Feb 2012 14:24:57 +0100
branchstable
changeset 16196 8ae7626d8bf1
parent 16195 40cc20042fb4
child 16197 0196c437ca9f
child 16198 fa8488565afd
child 16205 b605448eb254
subrepo: fix for merge inconsistencies Merging ancestors with children is allowed if they are on different named branches. This did not work for subrepo merges before. To fix this inconsistency, the mergefunc() will now use the simple update path only if both versions are on the same named branch. If not, they get merged into a new changeset, just as if you did the merge from the subrepo's root directly.
mercurial/subrepo.py
--- a/mercurial/subrepo.py	Wed Feb 29 14:41:11 2012 +0100
+++ b/mercurial/subrepo.py	Wed Feb 29 14:24:57 2012 +0100
@@ -500,7 +500,7 @@
         anc = dst.ancestor(cur)
 
         def mergefunc():
-            if anc == cur:
+            if anc == cur and dst.branch() == cur.branch():
                 self._repo.ui.debug("updating subrepo %s\n" % subrelpath(self))
                 hg.update(self._repo, state[1])
             elif anc == dst: