diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -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 --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -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)