Patchwork D7638: fix: use cmdutil.check_unique_argument()

login
register
mail settings
Submitter phabricator
Date Dec. 13, 2019, 7:56 a.m.
Message ID <differential-rev-PHID-DREV-zgjlxwkunc4l4x34yw55-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43781/
State Superseded
Headers show

Comments

phabricator - Dec. 13, 2019, 7:56 a.m.
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/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_unique_argument(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'):