Patchwork D9075: rebase: move check for unresolved conflicts into lower-level rebasenode()

login
register
mail settings
Submitter phabricator
Date Sept. 23, 2020, 5:29 p.m.
Message ID <differential-rev-PHID-DREV-2gc2jqvb6oovd5dbl46g-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47261/
State Superseded
Headers show

Comments

phabricator - Sept. 23, 2020, 5:29 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I want to add another call to `rebasenode()` and it's better to not
  have to duplicate the check.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9075

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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):