comparison hgext/rebase.py @ 43926:daed70e95d60

rebase: use cmdutil.check_at_most_one_arg() for --confirm/--dry-run I've also updated the helper to work with the hyphenated --dry-run option. Differential Revision: https://phab.mercurial-scm.org/D7641
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 13 Dec 2019 14:49:48 -0800
parents fff21278554b
children 905b21783968
comparison
equal deleted inserted replaced
43925:7929bb58146f 43926:daed70e95d60
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 dryrun and action:
1026 raise error.Abort(_(b'cannot specify both --dry-run and --%s') % action) 1026 raise error.Abort(_(b'cannot specify both --dry-run and --%s') % action)
1027 if confirm and action: 1027 if confirm and action:
1028 raise error.Abort(_(b'cannot specify both --confirm and --%s') % action) 1028 raise error.Abort(_(b'cannot specify both --confirm and --%s') % action)
1029 if dryrun and confirm: 1029 cmdutil.check_at_most_one_arg(opts, b'confirm', b'dry_run')
1030 raise error.Abort(_(b'cannot specify both --confirm and --dry-run'))
1031 1030
1032 if action or repo.currenttransaction() is not None: 1031 if action or repo.currenttransaction() is not None:
1033 # in-memory rebase is not compatible with resuming rebases. 1032 # in-memory rebase is not compatible with resuming rebases.
1034 # (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
1035 # fail the entire transaction.) 1034 # fail the entire transaction.)