# HG changeset patch # User Martin von Zweigbergk # Date 1576277388 28800 # Node ID daed70e95d604980d295e4b38b59a5cc8b5ab542 # Parent 7929bb58146fa9b8ae6239d6c1d6284d6ce745fe 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 diff -r 7929bb58146f -r daed70e95d60 hgext/rebase.py --- a/hgext/rebase.py Tue Dec 17 21:25:54 2019 -0500 +++ b/hgext/rebase.py Fri Dec 13 14:49:48 2019 -0800 @@ -1026,8 +1026,7 @@ raise error.Abort(_(b'cannot specify both --dry-run and --%s') % action) if confirm and action: raise error.Abort(_(b'cannot specify both --confirm and --%s') % action) - if dryrun and confirm: - raise error.Abort(_(b'cannot specify both --confirm and --dry-run')) + cmdutil.check_at_most_one_arg(opts, b'confirm', b'dry_run') if action or repo.currenttransaction() is not None: # in-memory rebase is not compatible with resuming rebases. diff -r 7929bb58146f -r daed70e95d60 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Tue Dec 17 21:25:54 2019 -0500 +++ b/mercurial/cmdutil.py Fri Dec 13 14:49:48 2019 -0800 @@ -268,6 +268,7 @@ previous = None for x in args: if opts.get(x): + x = x.replace(b'_', b'-') if previous: raise error.Abort( _(b'cannot specify both --%s and --%s') % (previous, x)