changeset 43897:dda49ec2b54a

fix: use cmdutil.check_at_most_one_arg() Differential Revision: https://phab.mercurial-scm.org/D7638
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 12 Dec 2019 15:51:09 -0800
parents 3781da40eaa6
children 023ad45e2fd2
files hgext/fix.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/fix.py	Tue Dec 17 10:26:44 2019 +0300
+++ b/hgext/fix.py	Thu Dec 12 15:51:09 2019 -0800
@@ -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'):