Patchwork D7643: rebase: use cmdutil.check_unique_argument() for -b/-s/-r

login
register
mail settings
Submitter phabricator
Date Dec. 13, 2019, 11 p.m.
Message ID <a0ed0fde6480ee90145b616af45f8891@localhost.localdomain>
Download mbox | patch
Permalink /patch/43823/
State Not Applicable
Headers show

Comments

phabricator - Dec. 13, 2019, 11 p.m.
martinvonz updated this revision to Diff 18713.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7643?vs=18678&id=18713

BRANCH
  default

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

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

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

CHANGE DETAILS




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

Patch

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
@@ -73,14 +73,14 @@ 
   [255]
 
   $ hg rebase --base 5 --source 4
-  abort: cannot specify both a source and a base
+  abort: cannot specify both --source and --base
   [255]
 
   $ hg rebase --rev 5 --source 4
-  abort: cannot specify both a revision and a source
+  abort: cannot specify both --rev and --source
   [255]
   $ hg rebase --base 5 --rev 4
-  abort: cannot specify both a revision and a base
+  abort: cannot specify both --rev and --base
   [255]
 
   $ hg rebase --base 6
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1025,6 +1025,7 @@ 
             opts, action, b'confirm', b'dry-run'
         )
     cmdutil.check_unique_argument(opts, b'confirm', b'dry-run')
+    cmdutil.check_unique_argument(opts, b'rev', b'source', b'base')
 
     if action or repo.currenttransaction() is not None:
         # in-memory rebase is not compatible with resuming rebases.
@@ -1259,12 +1260,6 @@ 
 
     # destspace is here to work around issues with `hg pull --rebase` see
     # issue5214 for details
-    if srcf and basef:
-        raise error.Abort(_(b'cannot specify both a source and a base'))
-    if revf and basef:
-        raise error.Abort(_(b'cannot specify both a revision and a base'))
-    if revf and srcf:
-        raise error.Abort(_(b'cannot specify both a revision and a source'))
 
     cmdutil.checkunfinished(repo)
     if not inmemory: