Mercurial > hg
comparison hgext/rebase.py @ 44194: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 | 1cb7ae9b0071 |
children | 3d2de64c49d2 |
comparison
equal
deleted
inserted
replaced
44193:3c265cef6edc | 44194:d4c1501225c4 |
---|---|
1009 opts = pycompat.byteskwargs(opts) | 1009 opts = pycompat.byteskwargs(opts) |
1010 inmemory = ui.configbool(b'rebase', b'experimental.inmemory') | 1010 inmemory = ui.configbool(b'rebase', b'experimental.inmemory') |
1011 action = cmdutil.check_at_most_one_arg(opts, b'abort', b'stop', b'continue') | 1011 action = cmdutil.check_at_most_one_arg(opts, b'abort', b'stop', b'continue') |
1012 if action: | 1012 if action: |
1013 cmdutil.check_incompatible_arguments( | 1013 cmdutil.check_incompatible_arguments( |
1014 opts, action, b'confirm', b'dry_run' | 1014 opts, action, [b'confirm', b'dry_run'] |
1015 ) | 1015 ) |
1016 cmdutil.check_incompatible_arguments( | 1016 cmdutil.check_incompatible_arguments( |
1017 opts, action, b'rev', b'source', b'base', b'dest' | 1017 opts, action, [b'rev', b'source', b'base', b'dest'] |
1018 ) | 1018 ) |
1019 cmdutil.check_at_most_one_arg(opts, b'confirm', b'dry_run') | 1019 cmdutil.check_at_most_one_arg(opts, b'confirm', b'dry_run') |
1020 cmdutil.check_at_most_one_arg(opts, b'rev', b'source', b'base') | 1020 cmdutil.check_at_most_one_arg(opts, b'rev', b'source', b'base') |
1021 | 1021 |
1022 if action or repo.currenttransaction() is not None: | 1022 if action or repo.currenttransaction() is not None: |
1026 inmemory = False | 1026 inmemory = False |
1027 | 1027 |
1028 if opts.get(b'auto_orphans'): | 1028 if opts.get(b'auto_orphans'): |
1029 disallowed_opts = set(opts) - {b'auto_orphans'} | 1029 disallowed_opts = set(opts) - {b'auto_orphans'} |
1030 cmdutil.check_incompatible_arguments( | 1030 cmdutil.check_incompatible_arguments( |
1031 opts, b'auto_orphans', *disallowed_opts | 1031 opts, b'auto_orphans', disallowed_opts |
1032 ) | 1032 ) |
1033 | 1033 |
1034 userrevs = list(repo.revs(opts.get(b'auto_orphans'))) | 1034 userrevs = list(repo.revs(opts.get(b'auto_orphans'))) |
1035 opts[b'rev'] = [revsetlang.formatspec(b'%ld and orphan()', userrevs)] | 1035 opts[b'rev'] = [revsetlang.formatspec(b'%ld and orphan()', userrevs)] |
1036 opts[b'dest'] = b'_destautoorphanrebase(SRC)' | 1036 opts[b'dest'] = b'_destautoorphanrebase(SRC)' |