# HG changeset patch # User Martin von Zweigbergk # Date 1600877072 25200 # Node ID e9468f14379a364eb6ea455cb4618694c4dd19db # Parent 25e365d5aa8f561bccfb8f5bfbbe06b8f162d6ad rebase: move check for unresolved conflicts into lower-level rebasenode() I want to add another call to `rebasenode()` and it's better to not have to duplicate the check. Differential Revision: https://phab.mercurial-scm.org/D9075 diff -r 25e365d5aa8f -r e9468f14379a hgext/rebase.py --- a/hgext/rebase.py Fri Sep 18 15:40:26 2020 -0700 +++ b/hgext/rebase.py Wed Sep 23 09:04:32 2020 -0700 @@ -615,14 +615,9 @@ else: overrides = {(b'ui', b'forcemerge'): opts.get(b'tool', b'')} with ui.configoverride(overrides, b'rebase'): - stats = rebasenode( + rebasenode( repo, rev, p1, p2, base, self.collapsef, wctx=self.wctx, ) - if stats.unresolvedcount > 0: - if self.inmemory: - raise error.InMemoryMergeConflictsError() - else: - raise error.ConflictResolutionRequired(b'rebase') if not self.collapsef: merging = p2 != nullrev editform = cmdutil.mergeeditform(merging, b'rebase') @@ -1500,7 +1495,12 @@ # duplicate copies between the revision we're # rebasing and its first parent. copies.graftcopies(wctx, ctx, ctx.p1()) - return stats + + if stats.unresolvedcount > 0: + if wctx.isinmemory(): + raise error.InMemoryMergeConflictsError() + else: + raise error.ConflictResolutionRequired(b'rebase') def adjustdest(repo, rev, destmap, state, skipped):