comparison tests/test-rebase-inmemory.t @ 45827:8d72e29ad1e0

errors: introduce InputError and use it from commands and cmdutil This patch introduces a `InputError` class and replaces many uses of `error.Abort` by it in `commands` and `cmdutil`. This is a part of https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan. There will later be a different class for state errors (to raise e.g. when there's an unfinished operation). It's not always clear when one should report an input error and when it should be a state error. We can always adjust later if I got something wrong in this patch (but feel free to point out any you notice now). Differential Revision: https://phab.mercurial-scm.org/D9167
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 06 Oct 2020 22:36:15 -0700
parents 21733e8c924f
children 527ce85c2e60
comparison
equal deleted inserted replaced
45826:21733e8c924f 45827:8d72e29ad1e0
331 a 331 a
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 --continue and --dry-run 335 abort: cannot specify both --continue and --dry-run
336 [255] 336 [10]
337 $ hg rebase -s 2 -d 6 -n --abort 337 $ hg rebase -s 2 -d 6 -n --abort
338 abort: cannot specify both --abort and --dry-run 338 abort: cannot specify both --abort and --dry-run
339 [255] 339 [10]
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
342 $ hg rebase -s 2 -d 6 -n 342 $ hg rebase -s 2 -d 6 -n
343 starting dry-run rebase; repository will not be changed 343 starting dry-run rebase; repository will not be changed
344 rebasing 2:177f92b77385 "c" 344 rebasing 2:177f92b77385 "c"
537 a 537 a
538 538
539 Check it gives error when both --dryrun and --confirm is used: 539 Check it gives error when both --dryrun and --confirm is used:
540 $ hg rebase -s 2 -d . --confirm --dry-run 540 $ hg rebase -s 2 -d . --confirm --dry-run
541 abort: cannot specify both --confirm and --dry-run 541 abort: cannot specify both --confirm and --dry-run
542 [255] 542 [10]
543 $ hg rebase -s 2 -d . --confirm --abort 543 $ hg rebase -s 2 -d . --confirm --abort
544 abort: cannot specify both --abort and --confirm 544 abort: cannot specify both --abort and --confirm
545 [255] 545 [10]
546 $ hg rebase -s 2 -d . --confirm --continue 546 $ hg rebase -s 2 -d . --confirm --continue
547 abort: cannot specify both --continue and --confirm 547 abort: cannot specify both --continue and --confirm
548 [255] 548 [10]
549 549
550 Test --confirm option when there are no conflicts: 550 Test --confirm option when there are no conflicts:
551 $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF 551 $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF
552 > n 552 > n
553 > EOF 553 > EOF