rebase: move check for unresolved conflicts into lower-level rebasenode()
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 23 Sep 2020 09:04:32 -0700
changeset 45549 e9468f14379a
parent 45548 25e365d5aa8f
child 45550 29a259be6424
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
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):