Patchwork D7663: transplant: use check_incompatible_arguments()

login
register
mail settings
Submitter phabricator
Date Dec. 17, 2019, 8:01 a.m.
Message ID <fa38b22560769acaf6d9a509c94e438c@localhost.localdomain>
Download mbox | patch
Permalink /patch/43907/
State Not Applicable
Headers show

Comments

phabricator - Dec. 17, 2019, 8:01 a.m.
Closed by commit rHGd50b4ad1d4a5: transplant: use check_incompatible_arguments() (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7663?vs=18719&id=18798

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7663/new/

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

AFFECTED FILES
  hgext/transplant.py
  tests/test-transplant.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-transplant.t b/tests/test-transplant.t
--- a/tests/test-transplant.t
+++ b/tests/test-transplant.t
@@ -18,10 +18,10 @@ 
   abort: no source URL, branch revision, or revision list provided
   [255]
   $ hg transplant --continue --all
-  abort: --continue is incompatible with --branch, --all and --merge
+  abort: cannot specify both --continue and --all
   [255]
   $ hg transplant --stop --all
-  abort: --stop is incompatible with --branch, --all and --merge
+  abort: cannot specify both --stop and --all
   [255]
   $ hg transplant --all tip
   abort: --all requires a branch revision
diff --git a/hgext/transplant.py b/hgext/transplant.py
--- a/hgext/transplant.py
+++ b/hgext/transplant.py
@@ -760,22 +760,14 @@ 
 
     def checkopts(opts, revs):
         if opts.get(b'continue'):
-            if opts.get(b'branch') or opts.get(b'all') or opts.get(b'merge'):
-                raise error.Abort(
-                    _(
-                        b'--continue is incompatible with '
-                        b'--branch, --all and --merge'
-                    )
-                )
+            cmdutil.check_incompatible_arguments(
+                opts, b'continue', b'branch', b'all', b'merge'
+            )
             return
         if opts.get(b'stop'):
-            if opts.get(b'branch') or opts.get(b'all') or opts.get(b'merge'):
-                raise error.Abort(
-                    _(
-                        b'--stop is incompatible with '
-                        b'--branch, --all and --merge'
-                    )
-                )
+            cmdutil.check_incompatible_arguments(
+                opts, b'stop', b'branch', b'all', b'merge'
+            )
             return
         if not (
             opts.get(b'source')