# HG changeset patch # User Martin von Zweigbergk # Date 1576219395 28800 # Node ID 08b8bf4a8516bcee8ff1807f91104d4b2d1e6438 # Parent 0b769e1cbe89d03ef90732c2e6aa43612ee565fe rebase: use cmdutil.check_at_most_one_arg() for -b/-s/-r Differential Revision: https://phab.mercurial-scm.org/D7643 diff -r 0b769e1cbe89 -r 08b8bf4a8516 hgext/rebase.py --- a/hgext/rebase.py Thu Dec 12 23:11:33 2019 -0800 +++ b/hgext/rebase.py Thu Dec 12 22:43:15 2019 -0800 @@ -1025,6 +1025,7 @@ opts, action, b'confirm', b'dry_run' ) cmdutil.check_at_most_one_arg(opts, b'confirm', b'dry_run') + cmdutil.check_at_most_one_arg(opts, b'rev', b'source', b'base') if action or repo.currenttransaction() is not None: # in-memory rebase is not compatible with resuming rebases. @@ -1259,12 +1260,6 @@ # destspace is here to work around issues with `hg pull --rebase` see # issue5214 for details - if srcf and basef: - raise error.Abort(_(b'cannot specify both a source and a base')) - if revf and basef: - raise error.Abort(_(b'cannot specify both a revision and a base')) - if revf and srcf: - raise error.Abort(_(b'cannot specify both a revision and a source')) cmdutil.checkunfinished(repo) if not inmemory: diff -r 0b769e1cbe89 -r 08b8bf4a8516 tests/test-rebase-parameters.t --- a/tests/test-rebase-parameters.t Thu Dec 12 23:11:33 2019 -0800 +++ b/tests/test-rebase-parameters.t Thu Dec 12 22:43:15 2019 -0800 @@ -73,14 +73,14 @@ [255] $ hg rebase --base 5 --source 4 - abort: cannot specify both a source and a base + abort: cannot specify both --source and --base [255] $ hg rebase --rev 5 --source 4 - abort: cannot specify both a revision and a source + abort: cannot specify both --rev and --source [255] $ hg rebase --base 5 --rev 4 - abort: cannot specify both a revision and a base + abort: cannot specify both --rev and --base [255] $ hg rebase --base 6