D7645: rebase: use cmdutil.check_unique_argument() for action+revision

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri Dec 13 07:56:25 UTC 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/rebase.py
  tests/test-rebase-parameters.t

CHANGE DETAILS

diff --git a/tests/test-rebase-parameters.t b/tests/test-rebase-parameters.t
--- a/tests/test-rebase-parameters.t
+++ b/tests/test-rebase-parameters.t
@@ -69,7 +69,7 @@
   [255]
 
   $ hg rebase --continue --dest 4
-  abort: abort and continue do not allow specifying revisions
+  abort: cannot specify both --continue and --dest
   [255]
 
   $ hg rebase --base 5 --source 4
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1022,6 +1022,9 @@
     action = cmdutil.check_unique_argument(opts, b'abort', b'stop', b'continue')
     if action:
         cmdutil.check_unique_argument(opts, b'confirm', b'dry-run', action)
+        cmdutil.check_unique_argument(
+            opts, action, b'rev', b'source', b'base', b'dest'
+        )
     cmdutil.check_unique_argument(opts, b'confirm', b'dry-run')
     cmdutil.check_unique_argument(opts, b'rev', b'source', b'base')
 
@@ -1189,10 +1192,6 @@
                 raise error.Abort(
                     _(b'cannot use collapse with continue or abort')
                 )
-            if srcf or basef or destf:
-                raise error.Abort(
-                    _(b'abort and continue do not allow specifying revisions')
-                )
             if action == b'abort' and opts.get(b'tool', False):
                 ui.warn(_(b'tool option will be ignored\n'))
             if action == b'continue':



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


More information about the Mercurial-devel mailing list