comparison mercurial/subrepo.py @ 16196:8ae7626d8bf1 stable

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.
author Friedrich Kastner-Masilko <kastner_masilko@at.festo.com>
date Wed, 29 Feb 2012 14:24:57 +0100
parents 04604d1a9fc3
children 0196c437ca9f c9c8c9053119
comparison
equal deleted inserted replaced
16195:40cc20042fb4 16196:8ae7626d8bf1
498 cur = self._repo['.'] 498 cur = self._repo['.']
499 dst = self._repo[state[1]] 499 dst = self._repo[state[1]]
500 anc = dst.ancestor(cur) 500 anc = dst.ancestor(cur)
501 501
502 def mergefunc(): 502 def mergefunc():
503 if anc == cur: 503 if anc == cur and dst.branch() == cur.branch():
504 self._repo.ui.debug("updating subrepo %s\n" % subrelpath(self)) 504 self._repo.ui.debug("updating subrepo %s\n" % subrelpath(self))
505 hg.update(self._repo, state[1]) 505 hg.update(self._repo, state[1])
506 elif anc == dst: 506 elif anc == dst:
507 self._repo.ui.debug("skipping subrepo %s\n" % subrelpath(self)) 507 self._repo.ui.debug("skipping subrepo %s\n" % subrelpath(self))
508 else: 508 else: