comparison hgext/rebase.py @ 44270:f546d2170b0f

merge: introduce a clean_update() for that use-case I find it hard to understand what value to pass for all the arguments to `merge.update()`. I would like to introduce functions that are more specific to each use-case. We already have `graft()`. This patch introduces a `clean_update()` and uses it in some places to show that it works. Differential Revision: https://phab.mercurial-scm.org/D7902
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 15 Jan 2020 15:30:25 -0800
parents 830eae18b2f3
children 77bb38be00ea
comparison
equal deleted inserted replaced
44269:48a1a974a92c 44270:f546d2170b0f
798 updateifonnodes.add(self.originalwd) 798 updateifonnodes.add(self.originalwd)
799 shouldupdate = repo[b'.'].rev() in updateifonnodes 799 shouldupdate = repo[b'.'].rev() in updateifonnodes
800 800
801 # Update away from the rebase if necessary 801 # Update away from the rebase if necessary
802 if shouldupdate: 802 if shouldupdate:
803 mergemod.update( 803 mergemod.clean_update(repo[self.originalwd])
804 repo, self.originalwd, branchmerge=False, force=True
805 )
806 804
807 # Strip from the first rebased revision 805 # Strip from the first rebased revision
808 if rebased: 806 if rebased:
809 repair.strip(repo.ui, repo, strippoints, backup=backup) 807 repair.strip(repo.ui, repo, strippoints, backup=backup)
810 808
1475 if wctx.isinmemory(): 1473 if wctx.isinmemory():
1476 wctx.setbase(p1ctx) 1474 wctx.setbase(p1ctx)
1477 else: 1475 else:
1478 if repo[b'.'].rev() != p1: 1476 if repo[b'.'].rev() != p1:
1479 repo.ui.debug(b" update to %d:%s\n" % (p1, p1ctx)) 1477 repo.ui.debug(b" update to %d:%s\n" % (p1, p1ctx))
1480 mergemod.update(repo, p1, branchmerge=False, force=True) 1478 mergemod.clean_update(p1ctx)
1481 else: 1479 else:
1482 repo.ui.debug(b" already in destination\n") 1480 repo.ui.debug(b" already in destination\n")
1483 # This is, alas, necessary to invalidate workingctx's manifest cache, 1481 # This is, alas, necessary to invalidate workingctx's manifest cache,
1484 # as well as other data we litter on it in other places. 1482 # as well as other data we litter on it in other places.
1485 wctx = repo[None] 1483 wctx = repo[None]