diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -945,7 +945,7 @@ class base(histeditaction): def run(self): if self.repo[b'.'].node() != self.node: - mergemod.update(self.repo, self.node, branchmerge=False, force=True) + mergemod.clean_update(self.repo[self.node]) return self.continueclean() def continuedirty(self): diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -799,9 +799,7 @@ # Update away from the rebase if necessary if shouldupdate: - mergemod.update( - repo, self.originalwd, branchmerge=False, force=True - ) + mergemod.clean_update(repo[self.originalwd]) # Strip from the first rebased revision if rebased: @@ -1475,7 +1473,7 @@ else: if repo[b'.'].rev() != p1: repo.ui.debug(b" update to %d:%s\n" % (p1, p1ctx)) - mergemod.update(repo, p1, branchmerge=False, force=True) + mergemod.clean_update(p1ctx) else: repo.ui.debug(b" already in destination\n") # This is, alas, necessary to invalidate workingctx's manifest cache, diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -1182,7 +1182,7 @@ node = repo[b'.'].hex() repo.ui.status(_(b"aborting the merge, updating back to %s\n") % node[:12]) - stats = mergemod.update(repo, node, branchmerge=False, force=True) + stats = mergemod.clean_update(repo[node]) _showstats(repo, stats) return stats.unresolvedcount > 0 diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -2577,6 +2577,10 @@ return stats +def clean_update(ctx, wc=None): + return update(ctx.repo(), ctx.rev(), branchmerge=False, force=True, wc=wc) + + def graft( repo, ctx, base, labels=None, keepparent=False, keepconflictparent=False ): diff --git a/mercurial/shelve.py b/mercurial/shelve.py --- a/mercurial/shelve.py +++ b/mercurial/shelve.py @@ -745,7 +745,7 @@ try: checkparents(repo, state) - merge.update(repo, state.pendingctx, branchmerge=False, force=True) + merge.clean_update(state.pendingctx) if state.activebookmark and state.activebookmark in repo._bookmarks: bookmarks.activate(repo, state.activebookmark) mergefiles(ui, repo, state.wctx, state.pendingctx)