##// END OF EJS Templates
graft: leverage cmdutil.check_at_most_one_arg() for --abort/--stop/--continue...
Martin von Zweigbergk -
r45548:7d494425 default
parent child Browse files
Show More
@@ -2982,6 +2982,8 b' def _dograft(ui, repo, *revs, **opts):'
2982 2982 editform=b'graft', **pycompat.strkwargs(opts)
2983 2983 )
2984 2984
2985 cmdutil.check_at_most_one_arg(opts, b'abort', b'stop', b'continue')
2986
2985 2987 cont = False
2986 2988 if opts.get(b'no_commit'):
2987 2989 if opts.get(b'edit'):
@@ -3004,13 +3006,6 b' def _dograft(ui, repo, *revs, **opts):'
3004 3006 graftstate = statemod.cmdstate(repo, b'graftstate')
3005 3007
3006 3008 if opts.get(b'stop'):
3007 if opts.get(b'continue'):
3008 raise error.Abort(
3009 _(b"cannot use '--continue' and '--stop' together")
3010 )
3011 if opts.get(b'abort'):
3012 raise error.Abort(_(b"cannot use '--abort' and '--stop' together"))
3013
3014 3009 if any(
3015 3010 (
3016 3011 opts.get(b'edit'),
@@ -3025,10 +3020,6 b' def _dograft(ui, repo, *revs, **opts):'
3025 3020 raise error.Abort(_(b"cannot specify any other flag with '--stop'"))
3026 3021 return _stopgraft(ui, repo, graftstate)
3027 3022 elif opts.get(b'abort'):
3028 if opts.get(b'continue'):
3029 raise error.Abort(
3030 _(b"cannot use '--continue' and '--abort' together")
3031 )
3032 3023 if any(
3033 3024 (
3034 3025 opts.get(b'edit'),
@@ -249,7 +249,7 b' Testing the --stop flag of `hg graft` wh'
249 249 [1]
250 250
251 251 $ hg graft --stop --continue
252 abort: cannot use '--continue' and '--stop' together
252 abort: cannot specify both --stop and --continue
253 253 [255]
254 254
255 255 $ hg graft --stop -U
@@ -355,11 +355,11 b' when stripping is required'
355 355 [1]
356 356
357 357 $ hg graft --continue --abort
358 abort: cannot use '--continue' and '--abort' together
358 abort: cannot specify both --abort and --continue
359 359 [255]
360 360
361 361 $ hg graft --abort --stop
362 abort: cannot use '--abort' and '--stop' together
362 abort: cannot specify both --abort and --stop
363 363 [255]
364 364
365 365 $ hg graft --abort --currentuser
General Comments 0
You need to be logged in to leave comments. Login now