Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 44269:d4c1501225c4
cmdutil: change check_incompatible_arguments() *arg to single iterable
This makes it clearer on the call-sites that the first argument is
special. Thanks to Yuya for the suggestion.
Differential Revision: https://phab.mercurial-scm.org/D8018
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 27 Jan 2020 09:14:19 -0800 |
parents | 293cab97a766 |
children | 15eb90965a00 |
line wrap: on
line diff
--- a/mercurial/commands.py Mon Jan 27 12:38:59 2020 -0800 +++ b/mercurial/commands.py Mon Jan 27 09:14:19 2020 -0800 @@ -1228,7 +1228,7 @@ action = cmdutil.check_at_most_one_arg(opts, b'delete', b'rename', b'list') if action: - cmdutil.check_incompatible_arguments(opts, action, b'rev') + cmdutil.check_incompatible_arguments(opts, action, [b'rev']) elif names or rev: action = b'add' elif inactive: @@ -1236,7 +1236,9 @@ else: action = b'list' - cmdutil.check_incompatible_arguments(opts, b'inactive', b'delete', b'list') + cmdutil.check_incompatible_arguments( + opts, b'inactive', [b'delete', b'list'] + ) if not names and action in {b'add', b'delete'}: raise error.Abort(_(b"bookmark name required")) @@ -4847,7 +4849,7 @@ abort = opts.get(b'abort') if abort and repo.dirstate.p2() == nullid: cmdutil.wrongtooltocontinue(repo, _(b'merge')) - cmdutil.check_incompatible_arguments(opts, b'abort', b'rev', b'preview') + cmdutil.check_incompatible_arguments(opts, b'abort', [b'rev', b'preview']) if abort: state = cmdutil.getunfinishedstate(repo) if state and state._opname != b'merge':