##// END OF EJS Templates
rebase: use cmdutil.check_at_most_one_arg() for --confirm/--dry-run...
Martin von Zweigbergk -
r44378:daed70e9 default
parent child Browse files
Show More
@@ -1026,8 +1026,7 b' def rebase(ui, repo, **opts):'
1026 raise error.Abort(_(b'cannot specify both --dry-run and --%s') % action)
1026 raise error.Abort(_(b'cannot specify both --dry-run and --%s') % action)
1027 if confirm and action:
1027 if confirm and action:
1028 raise error.Abort(_(b'cannot specify both --confirm and --%s') % action)
1028 raise error.Abort(_(b'cannot specify both --confirm and --%s') % action)
1029 if dryrun and confirm:
1029 cmdutil.check_at_most_one_arg(opts, b'confirm', b'dry_run')
1030 raise error.Abort(_(b'cannot specify both --confirm and --dry-run'))
1031
1030
1032 if action or repo.currenttransaction() is not None:
1031 if action or repo.currenttransaction() is not None:
1033 # in-memory rebase is not compatible with resuming rebases.
1032 # in-memory rebase is not compatible with resuming rebases.
@@ -268,6 +268,7 b' def check_at_most_one_arg(opts, *args):'
268 previous = None
268 previous = None
269 for x in args:
269 for x in args:
270 if opts.get(x):
270 if opts.get(x):
271 x = x.replace(b'_', b'-')
271 if previous:
272 if previous:
272 raise error.Abort(
273 raise error.Abort(
273 _(b'cannot specify both --%s and --%s') % (previous, x)
274 _(b'cannot specify both --%s and --%s') % (previous, x)
General Comments 0
You need to be logged in to leave comments. Login now