Patchwork D7995: merge: call hg.abortmerge() directly and return early

login
register
mail settings
Submitter phabricator
Date Jan. 25, 2020, 12:17 a.m.
Message ID <differential-rev-PHID-DREV-jgfn2xkjqk5fxdgv5hah-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44643/
State Superseded
Headers show

Comments

phabricator - Jan. 25, 2020, 12:17 a.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  It's seem really weird to go through a lot of unrelated code before we
  call `hg.merge(..., abort=True)` when we can just call
  `hg.abortmerge()` and return early.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4857,6 +4857,8 @@ 
             )
         if node:
             raise error.Abort(_(b"cannot specify a node with --abort"))
+        return hg.abortmerge(repo.ui, repo)
+
     if opts.get(b'rev') and node:
         raise error.Abort(_(b"please specify just one revision"))
     if not node:
@@ -4865,7 +4867,7 @@ 
     if node:
         node = scmutil.revsingle(repo, node).node()
 
-    if not node and not abort:
+    if not node:
         if ui.configbool(b'commands', b'merge.require-rev'):
             raise error.Abort(
                 _(
@@ -4898,7 +4900,6 @@ 
             force=force,
             mergeforce=force,
             labels=labels,
-            abort=abort,
         )