Patchwork D8511: status: use cmdutil.check_at_most_one_arg() for checking --rev/--change

login
register
mail settings
Submitter phabricator
Date May 8, 2020, 4:01 p.m.
Message ID <differential-rev-PHID-DREV-mizyddwrzpa5n6ckvvwr-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46293/
State Superseded
Headers show

Comments

phabricator - May 8, 2020, 4:01 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  There are apparently no tests for this either.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6784,6 +6784,7 @@ 
 
     """
 
+    cmdutil.check_at_most_one_arg(opts, 'rev', 'change')
     opts = pycompat.byteskwargs(opts)
     revs = opts.get(b'rev')
     change = opts.get(b'change')
@@ -6794,10 +6795,7 @@ 
         else:
             terse = ui.config(b'commands', b'status.terse')
 
-    if revs and change:
-        msg = _(b'cannot specify --rev and --change at the same time')
-        raise error.Abort(msg)
-    elif revs and terse:
+    if revs and terse:
         msg = _(b'cannot use --terse with --rev')
         raise error.Abort(msg)
     elif change: