Mercurial > hg
comparison tests/test-tags.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 | 64de86fd0984 |
children | 95a615dd77bf |
comparison
equal
deleted
inserted
replaced
45826:21733e8c924f | 45827:8d72e29ad1e0 |
---|---|
503 | 503 |
504 Remove nonexistent tag: | 504 Remove nonexistent tag: |
505 | 505 |
506 $ hg tag --remove foobar | 506 $ hg tag --remove foobar |
507 abort: tag 'foobar' does not exist | 507 abort: tag 'foobar' does not exist |
508 [255] | 508 [10] |
509 $ hg tip | 509 $ hg tip |
510 changeset: 5:5f6e8655b1c7 | 510 changeset: 5:5f6e8655b1c7 |
511 tag: tip | 511 tag: tip |
512 user: test | 512 user: test |
513 date: Thu Jan 01 00:00:00 1970 +0000 | 513 date: Thu Jan 01 00:00:00 1970 +0000 |
553 | 553 |
554 Don't allow moving tag without -f: | 554 Don't allow moving tag without -f: |
555 | 555 |
556 $ hg tag -r 3 bar | 556 $ hg tag -r 3 bar |
557 abort: tag 'bar' already exists (use -f to force) | 557 abort: tag 'bar' already exists (use -f to force) |
558 [255] | 558 [10] |
559 $ hg tags | 559 $ hg tags |
560 tip 6:735c3ca72986 | 560 tip 6:735c3ca72986 |
561 bar 0:bbd179dfa0a7 | 561 bar 0:bbd179dfa0a7 |
562 | 562 |
563 Strip 1: expose an old head: | 563 Strip 1: expose an old head: |
620 $ hg ci -m 'add foo' # rev 0 | 620 $ hg ci -m 'add foo' # rev 0 |
621 | 621 |
622 $ hg tag -r 0 -l localtag | 622 $ hg tag -r 0 -l localtag |
623 $ hg tag --remove localtag | 623 $ hg tag --remove localtag |
624 abort: tag 'localtag' is not a global tag | 624 abort: tag 'localtag' is not a global tag |
625 [255] | 625 [10] |
626 $ | 626 $ |
627 $ hg tag -r 0 globaltag | 627 $ hg tag -r 0 globaltag |
628 $ hg tag --remove -l globaltag | 628 $ hg tag --remove -l globaltag |
629 abort: tag 'globaltag' is not a local tag | 629 abort: tag 'globaltag' is not a local tag |
630 [255] | 630 [10] |
631 $ hg tags -v | 631 $ hg tags -v |
632 tip 1:a0b6fe111088 | 632 tip 1:a0b6fe111088 |
633 localtag 0:bbd179dfa0a7 local | 633 localtag 0:bbd179dfa0a7 local |
634 globaltag 0:bbd179dfa0a7 | 634 globaltag 0:bbd179dfa0a7 |
635 | 635 |
822 date: Thu Jan 01 00:00:00 1970 +0000 | 822 date: Thu Jan 01 00:00:00 1970 +0000 |
823 summary: add a | 823 summary: add a |
824 | 824 |
825 $ hg tag --remove a | 825 $ hg tag --remove a |
826 abort: tag 'a' is already removed | 826 abort: tag 'a' is already removed |
827 [255] | 827 [10] |
828 $ hg log | 828 $ hg log |
829 changeset: 2:e7feacc7ec9e | 829 changeset: 2:e7feacc7ec9e |
830 tag: tip | 830 tag: tip |
831 user: test | 831 user: test |
832 date: Thu Jan 01 00:00:00 1970 +0000 | 832 date: Thu Jan 01 00:00:00 1970 +0000 |