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.
--- 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: