D7638: fix: use cmdutil.check_at_most_one_arg()

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Mon Dec 16 18:20:23 EST 2019


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

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'):



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


More information about the Mercurial-devel mailing list