##// END OF EJS Templates
rebase: consolidate check for --abort/--stop/--continue conflicts
Yuya Nishihara -
r39134:a4250605 default
parent child Browse files
Show More
@@ -807,12 +807,14 b' def rebase(ui, repo, **opts):'
807 dryrun = opts.get('dry_run')
807 dryrun = opts.get('dry_run')
808 confirm = opts.get('confirm')
808 confirm = opts.get('confirm')
809 stop = opts.get('stop')
809 stop = opts.get('stop')
810 selactions = [k for k in ['abort', 'stop', 'continue'] if opts.get(k)]
811 if len(selactions) > 1:
812 raise error.Abort(_('cannot use --%s with --%s')
813 % tuple(selactions[:2]))
810 if stop:
814 if stop:
811 if opts.get('dry_run') or opts.get('confirm'):
815 if opts.get('dry_run') or opts.get('confirm'):
812 raise error.Abort(_('cannot use --stop with --dry-run '
816 raise error.Abort(_('cannot use --stop with --dry-run '
813 'or --confirm'))
817 'or --confirm'))
814 if opts.get('abort') or opts.get('continue'):
815 raise error.Abort(_('cannot use --stop with --abort or --continue'))
816 if dryrun:
818 if dryrun:
817 if opts.get('abort'):
819 if opts.get('abort'):
818 raise error.Abort(_('cannot specify both --dry-run and --abort'))
820 raise error.Abort(_('cannot specify both --dry-run and --abort'))
@@ -950,8 +952,6 b' def _origrebase(ui, repo, opts, rbsrt, i'
950 _('message can only be specified with collapse'))
952 _('message can only be specified with collapse'))
951
953
952 if contf or abortf:
954 if contf or abortf:
953 if contf and abortf:
954 raise error.Abort(_('cannot use both abort and continue'))
955 if rbsrt.collapsef:
955 if rbsrt.collapsef:
956 raise error.Abort(
956 raise error.Abort(
957 _('cannot use collapse with continue or abort'))
957 _('cannot use collapse with continue or abort'))
@@ -2020,7 +2020,7 b' Test --stop raise errors with conflictin'
2020 (use 'hg rebase --continue' or 'hg rebase --abort')
2020 (use 'hg rebase --continue' or 'hg rebase --abort')
2021 [255]
2021 [255]
2022 $ hg rebase --stop --continue
2022 $ hg rebase --stop --continue
2023 abort: cannot use --stop with --abort or --continue
2023 abort: cannot use --stop with --continue
2024 [255]
2024 [255]
2025
2025
2026 Test --stop moves bookmarks of original revisions to new rebased nodes:
2026 Test --stop moves bookmarks of original revisions to new rebased nodes:
@@ -61,7 +61,7 b' These fail:'
61 [1]
61 [1]
62
62
63 $ hg rebase --continue --abort
63 $ hg rebase --continue --abort
64 abort: cannot use both abort and continue
64 abort: cannot use --abort with --continue
65 [255]
65 [255]
66
66
67 $ hg rebase --continue --collapse
67 $ hg rebase --continue --collapse
General Comments 0
You need to be logged in to leave comments. Login now