##// END OF EJS Templates
rebase: use cmdutil.check_incompatible_arguments() for action+confirm/dryrun...
Martin von Zweigbergk -
r44379:905b2178 default
parent child Browse files
Show More
@@ -1022,10 +1022,10 b' def rebase(ui, repo, **opts):'
1022 dryrun = opts.get(b'dry_run')
1022 dryrun = opts.get(b'dry_run')
1023 confirm = opts.get(b'confirm')
1023 confirm = opts.get(b'confirm')
1024 action = cmdutil.check_at_most_one_arg(opts, b'abort', b'stop', b'continue')
1024 action = cmdutil.check_at_most_one_arg(opts, b'abort', b'stop', b'continue')
1025 if dryrun and action:
1025 if action:
1026 raise error.Abort(_(b'cannot specify both --dry-run and --%s') % action)
1026 cmdutil.check_incompatible_arguments(
1027 if confirm and action:
1027 opts, action, b'confirm', b'dry_run'
1028 raise error.Abort(_(b'cannot specify both --confirm and --%s') % action)
1028 )
1029 cmdutil.check_at_most_one_arg(opts, b'confirm', b'dry_run')
1029 cmdutil.check_at_most_one_arg(opts, b'confirm', b'dry_run')
1030
1030
1031 if action or repo.currenttransaction() is not None:
1031 if action or repo.currenttransaction() is not None:
@@ -332,10 +332,10 b' Test dry-run rebasing'
332
332
333 Make sure it throws error while passing --continue or --abort with --dry-run
333 Make sure it throws error while passing --continue or --abort with --dry-run
334 $ hg rebase -s 2 -d 6 -n --continue
334 $ hg rebase -s 2 -d 6 -n --continue
335 abort: cannot specify both --dry-run and --continue
335 abort: cannot specify both --continue and --dry-run
336 [255]
336 [255]
337 $ hg rebase -s 2 -d 6 -n --abort
337 $ hg rebase -s 2 -d 6 -n --abort
338 abort: cannot specify both --dry-run and --abort
338 abort: cannot specify both --abort and --dry-run
339 [255]
339 [255]
340
340
341 Check dryrun gives correct results when there is no conflict in rebasing
341 Check dryrun gives correct results when there is no conflict in rebasing
@@ -548,10 +548,10 b' Check it gives error when both --dryrun '
548 abort: cannot specify both --confirm and --dry-run
548 abort: cannot specify both --confirm and --dry-run
549 [255]
549 [255]
550 $ hg rebase -s 2 -d . --confirm --abort
550 $ hg rebase -s 2 -d . --confirm --abort
551 abort: cannot specify both --confirm and --abort
551 abort: cannot specify both --abort and --confirm
552 [255]
552 [255]
553 $ hg rebase -s 2 -d . --confirm --continue
553 $ hg rebase -s 2 -d . --confirm --continue
554 abort: cannot specify both --confirm and --continue
554 abort: cannot specify both --continue and --confirm
555 [255]
555 [255]
556
556
557 Test --confirm option when there are no conflicts:
557 Test --confirm option when there are no conflicts:
@@ -2054,7 +2054,7 b' Test --stop raise errors with conflictin'
2054 unresolved conflicts (see hg resolve, then hg rebase --continue)
2054 unresolved conflicts (see hg resolve, then hg rebase --continue)
2055 [1]
2055 [1]
2056 $ hg rebase --stop --dry-run
2056 $ hg rebase --stop --dry-run
2057 abort: cannot specify both --dry-run and --stop
2057 abort: cannot specify both --stop and --dry-run
2058 [255]
2058 [255]
2059
2059
2060 $ hg rebase -s 3 -d 5
2060 $ hg rebase -s 3 -d 5
General Comments 0
You need to be logged in to leave comments. Login now