diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -614,14 +614,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') @@ -1499,7 +1494,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):