Patchwork D7638: fix: use cmdutil.check_at_most_one_arg()

login
register
mail settings
Submitter phabricator
Date Dec. 16, 2019, 11:20 p.m.
Message ID <15edca2d37a4a9f55881d80a3153a266@localhost.localdomain>
Download mbox | patch
Permalink /patch/43873/
State Not Applicable
Headers show

Comments

phabricator - Dec. 16, 2019, 11:20 p.m.
martinvonz retitled this revision from "fix: use cmdutil.check_unique_argument()" to "fix: use cmdutil.check_at_most_one_arg()".
martinvonz updated this revision to Diff 18764.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7638?vs=18673&id=18764

BRANCH
  default

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

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

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -249,9 +249,8 @@ 
     override this default behavior, though it is not usually desirable to do so.
     """
     opts = pycompat.byteskwargs(opts)
+    cmdutil.check_at_most_one_arg(opts, b'all', b'rev')
     if opts[b'all']:
-        if opts[b'rev']:
-            raise error.Abort(_(b'cannot specify both "--rev" and "--all"'))
         opts[b'rev'] = [b'not public() and not obsolete()']
         opts[b'working_dir'] = True
     with repo.wlock(), repo.lock(), repo.transaction(b'fix'):