comparison hgext/rebase.py @ 43927:905b21783968

rebase: use cmdutil.check_incompatible_arguments() for action+confirm/dryrun Differential Revision: https://phab.mercurial-scm.org/D7661
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 13 Dec 2019 14:50:42 -0800
parents daed70e95d60
children 0b769e1cbe89
comparison
equal deleted inserted replaced
43926:daed70e95d60 43927:905b21783968
1020 opts = pycompat.byteskwargs(opts) 1020 opts = pycompat.byteskwargs(opts)
1021 inmemory = ui.configbool(b'rebase', b'experimental.inmemory') 1021 inmemory = ui.configbool(b'rebase', b'experimental.inmemory')
1022 dryrun = opts.get(b'dry_run') 1022 dryrun = opts.get(b'dry_run')
1023 confirm = opts.get(b'confirm') 1023 confirm = opts.get(b'confirm')
1024 action = cmdutil.check_at_most_one_arg(opts, b'abort', b'stop', b'continue') 1024 action = cmdutil.check_at_most_one_arg(opts, b'abort', b'stop', b'continue')
1025 if dryrun and action: 1025 if action:
1026 raise error.Abort(_(b'cannot specify both --dry-run and --%s') % action) 1026 cmdutil.check_incompatible_arguments(
1027 if confirm and action: 1027 opts, action, b'confirm', b'dry_run'
1028 raise error.Abort(_(b'cannot specify both --confirm and --%s') % action) 1028 )
1029 cmdutil.check_at_most_one_arg(opts, b'confirm', b'dry_run') 1029 cmdutil.check_at_most_one_arg(opts, b'confirm', b'dry_run')
1030 1030
1031 if action or repo.currenttransaction() is not None: 1031 if action or repo.currenttransaction() is not None:
1032 # in-memory rebase is not compatible with resuming rebases. 1032 # in-memory rebase is not compatible with resuming rebases.
1033 # (Or if it is run within a transaction, since the restart logic can 1033 # (Or if it is run within a transaction, since the restart logic can