Mercurial > hg
changeset 45549:e9468f14379a
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
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 23 Sep 2020 09:04:32 -0700 |
parents | 25e365d5aa8f |
children | 29a259be6424 |
files | hgext/rebase.py |
diffstat | 1 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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):