Mercurial > hg
comparison tests/test-phases.t @ 46417:768056549737
errors: use exit code 40 for when a hook fails
A hook can be used for checking inputs, state, configuration,
security, etc., so it's unclear which of the existing exit codes to
use. Let's instead add one specifically for failed hooks. I picked 40.
Differential Revision: https://phab.mercurial-scm.org/D9910
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 29 Jan 2021 12:16:55 -0800 |
parents | 9dc1351d0b5f |
children | 84a93fa7ecfd |
comparison
equal
deleted
inserted
replaced
46416:bc3f3b59d0a4 | 46417:768056549737 |
---|---|
755 6: draft | 755 6: draft |
756 $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" phase -f -s 6 | 756 $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" phase -f -s 6 |
757 transaction abort! | 757 transaction abort! |
758 rollback completed | 758 rollback completed |
759 abort: pretxnclose hook exited with status 1 | 759 abort: pretxnclose hook exited with status 1 |
760 [255] | 760 [40] |
761 $ cp .hg/store/phaseroots.pending.saved .hg/store/phaseroots.pending | 761 $ cp .hg/store/phaseroots.pending.saved .hg/store/phaseroots.pending |
762 | 762 |
763 (check (in)visibility of phaseroot while transaction running in repo) | 763 (check (in)visibility of phaseroot while transaction running in repo) |
764 | 764 |
765 $ cat > $TESTTMP/checkpending.sh <<EOF | 765 $ cat > $TESTTMP/checkpending.sh <<EOF |
778 @push-dest | 778 @push-dest |
779 6: draft | 779 6: draft |
780 transaction abort! | 780 transaction abort! |
781 rollback completed | 781 rollback completed |
782 abort: pretxnclose hook exited with status 1 | 782 abort: pretxnclose hook exited with status 1 |
783 [255] | 783 [40] |
784 | 784 |
785 Check that pretxnclose-phase hook can control phase movement | 785 Check that pretxnclose-phase hook can control phase movement |
786 | 786 |
787 $ hg phase --force b3325c91a4d9 --secret | 787 $ hg phase --force b3325c91a4d9 --secret |
788 test-debug-phase: move rev 3: 0 -> 2 | 788 test-debug-phase: move rev 3: 0 -> 2 |
852 | 852 |
853 $ hg phase --public b3325c91a4d9 | 853 $ hg phase --public b3325c91a4d9 |
854 transaction abort! | 854 transaction abort! |
855 rollback completed | 855 rollback completed |
856 abort: pretxnclose-phase.nopublish_D hook exited with status 1 | 856 abort: pretxnclose-phase.nopublish_D hook exited with status 1 |
857 [255] | 857 [40] |
858 $ hg phase --public a603bfb5a83e | 858 $ hg phase --public a603bfb5a83e |
859 transaction abort! | 859 transaction abort! |
860 rollback completed | 860 rollback completed |
861 abort: pretxnclose-phase.nopublish_D hook exited with status 1 | 861 abort: pretxnclose-phase.nopublish_D hook exited with status 1 |
862 [255] | 862 [40] |
863 $ hg phase --draft 17a481b3bccb | 863 $ hg phase --draft 17a481b3bccb |
864 test-debug-phase: move rev 3: 2 -> 1 | 864 test-debug-phase: move rev 3: 2 -> 1 |
865 test-debug-phase: move rev 4: 2 -> 1 | 865 test-debug-phase: move rev 4: 2 -> 1 |
866 test-debug-phase: move rev 7: 2 -> 1 | 866 test-debug-phase: move rev 7: 2 -> 1 |
867 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: secret -> draft | 867 test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: secret -> draft |
869 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> draft | 869 test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> draft |
870 $ hg phase --public 17a481b3bccb | 870 $ hg phase --public 17a481b3bccb |
871 transaction abort! | 871 transaction abort! |
872 rollback completed | 872 rollback completed |
873 abort: pretxnclose-phase.nopublish_D hook exited with status 1 | 873 abort: pretxnclose-phase.nopublish_D hook exited with status 1 |
874 [255] | 874 [40] |
875 | 875 |
876 $ cd .. | 876 $ cd .. |
877 | 877 |
878 Test for the "internal" phase | 878 Test for the "internal" phase |
879 ============================= | 879 ============================= |