Mercurial > hg
diff mercurial/commands.py @ 45009:7d494425167c
graft: leverage cmdutil.check_at_most_one_arg() for --abort/--stop/--continue
Differential Revision: https://phab.mercurial-scm.org/D8667
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 25 Jun 2020 13:27:37 -0700 |
parents | e1ea913da2ed |
children | c63a297fb964 |
line wrap: on
line diff
--- a/mercurial/commands.py Sat Jun 27 21:45:20 2020 -0400 +++ b/mercurial/commands.py Thu Jun 25 13:27:37 2020 -0700 @@ -2982,6 +2982,8 @@ editform=b'graft', **pycompat.strkwargs(opts) ) + cmdutil.check_at_most_one_arg(opts, b'abort', b'stop', b'continue') + cont = False if opts.get(b'no_commit'): if opts.get(b'edit'): @@ -3004,13 +3006,6 @@ graftstate = statemod.cmdstate(repo, b'graftstate') if opts.get(b'stop'): - if opts.get(b'continue'): - raise error.Abort( - _(b"cannot use '--continue' and '--stop' together") - ) - if opts.get(b'abort'): - raise error.Abort(_(b"cannot use '--abort' and '--stop' together")) - if any( ( opts.get(b'edit'), @@ -3025,10 +3020,6 @@ raise error.Abort(_(b"cannot specify any other flag with '--stop'")) return _stopgraft(ui, repo, graftstate) elif opts.get(b'abort'): - if opts.get(b'continue'): - raise error.Abort( - _(b"cannot use '--continue' and '--abort' together") - ) if any( ( opts.get(b'edit'),