Mercurial > hg
comparison mercurial/commands.py @ 45014:6118ad07b98d
graft: leverage cmdutil.check_incompatible_arguments() for --abort/--stop
Differential Revision: https://phab.mercurial-scm.org/D8669
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 25 Jun 2020 13:37:56 -0700 |
parents | c63a297fb964 |
children | 44d5233e66a9 |
comparison
equal
deleted
inserted
replaced
45010:c63a297fb964 | 45014:6118ad07b98d |
---|---|
2993 ) | 2993 ) |
2994 | 2994 |
2995 graftstate = statemod.cmdstate(repo, b'graftstate') | 2995 graftstate = statemod.cmdstate(repo, b'graftstate') |
2996 | 2996 |
2997 if opts.get(b'stop'): | 2997 if opts.get(b'stop'): |
2998 if any( | 2998 cmdutil.check_incompatible_arguments( |
2999 ( | 2999 opts, |
3000 opts.get(b'edit'), | 3000 b'stop', |
3001 opts.get(b'log'), | 3001 [ |
3002 opts.get(b'user'), | 3002 b'edit', |
3003 opts.get(b'date'), | 3003 b'log', |
3004 opts.get(b'currentdate'), | 3004 b'user', |
3005 opts.get(b'currentuser'), | 3005 b'date', |
3006 opts.get(b'rev'), | 3006 b'currentdate', |
3007 ) | 3007 b'currentuser', |
3008 ): | 3008 b'rev', |
3009 raise error.Abort(_(b"cannot specify any other flag with '--stop'")) | 3009 ], |
3010 ) | |
3010 return _stopgraft(ui, repo, graftstate) | 3011 return _stopgraft(ui, repo, graftstate) |
3011 elif opts.get(b'abort'): | 3012 elif opts.get(b'abort'): |
3012 if any( | 3013 cmdutil.check_incompatible_arguments( |
3013 ( | 3014 opts, |
3014 opts.get(b'edit'), | 3015 b'abort', |
3015 opts.get(b'log'), | 3016 [ |
3016 opts.get(b'user'), | 3017 b'edit', |
3017 opts.get(b'date'), | 3018 b'log', |
3018 opts.get(b'currentdate'), | 3019 b'user', |
3019 opts.get(b'currentuser'), | 3020 b'date', |
3020 opts.get(b'rev'), | 3021 b'currentdate', |
3021 ) | 3022 b'currentuser', |
3022 ): | 3023 b'rev', |
3023 raise error.Abort( | 3024 ], |
3024 _(b"cannot specify any other flag with '--abort'") | 3025 ) |
3025 ) | |
3026 | |
3027 return cmdutil.abortgraft(ui, repo, graftstate) | 3026 return cmdutil.abortgraft(ui, repo, graftstate) |
3028 elif opts.get(b'continue'): | 3027 elif opts.get(b'continue'): |
3029 cont = True | 3028 cont = True |
3030 if revs: | 3029 if revs: |
3031 raise error.Abort(_(b"can't specify --continue and revisions")) | 3030 raise error.Abort(_(b"can't specify --continue and revisions")) |