Mercurial > hg-stable
comparison tests/test-mq.t @ 12365:22f3353bcc36
tests: cleanup exit code handling in unified tests
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 21 Sep 2010 16:00:02 -0500 |
parents | 4134686b83e1 |
children | 02990e22150b |
comparison
equal
deleted
inserted
replaced
12364:e128fa4615f2 | 12365:22f3353bcc36 |
---|---|
202 | 202 |
203 init --mq with repo path | 203 init --mq with repo path |
204 | 204 |
205 $ hg init g | 205 $ hg init g |
206 $ hg init --mq g | 206 $ hg init --mq g |
207 $ test -d g/.hg/patches/.hg && echo "ok" || echo "failed" | 207 $ test -d g/.hg/patches/.hg |
208 ok | |
209 | 208 |
210 init --mq with nonexistent directory | 209 init --mq with nonexistent directory |
211 | 210 |
212 $ hg init --mq nonexistentdir | 211 $ hg init --mq nonexistentdir |
213 abort: repository nonexistentdir not found! | 212 abort: repository nonexistentdir not found! |
631 adding manifests | 630 adding manifests |
632 adding file changes | 631 adding file changes |
633 added 1 changesets with 1 changes to 1 files | 632 added 1 changesets with 1 changes to 1 files |
634 | 633 |
635 | 634 |
636 qpush/qpop error codes | |
637 | |
638 $ errorcode() | |
639 > { | |
640 > hg "$@" && echo " $@ succeeds" || echo " $@ fails" | |
641 > } | |
642 | |
643 | |
644 we want to start with some patches applied | 635 we want to start with some patches applied |
645 | 636 |
646 $ hg qpush -a | 637 $ hg qpush -a |
647 applying test.patch | 638 applying test.patch |
648 applying test1b.patch | 639 applying test1b.patch |
649 applying test2.patch | 640 applying test2.patch |
650 now at: test2.patch | 641 now at: test2.patch |
651 | 642 |
652 % pops all patches and succeeds | 643 % pops all patches and succeeds |
653 | 644 |
654 $ errorcode qpop -a | 645 $ hg qpop -a |
655 popping test2.patch | 646 popping test2.patch |
656 popping test1b.patch | 647 popping test1b.patch |
657 popping test.patch | 648 popping test.patch |
658 patch queue now empty | 649 patch queue now empty |
659 qpop -a succeeds | |
660 | 650 |
661 % does nothing and succeeds | 651 % does nothing and succeeds |
662 | 652 |
663 $ errorcode qpop -a | 653 $ hg qpop -a |
664 no patches applied | 654 no patches applied |
665 qpop -a succeeds | |
666 | 655 |
667 % fails - nothing else to pop | 656 % fails - nothing else to pop |
668 | 657 |
669 $ errorcode qpop | 658 $ hg qpop |
670 no patches applied | 659 no patches applied |
671 qpop fails | 660 [1] |
672 | 661 |
673 % pushes a patch and succeeds | 662 % pushes a patch and succeeds |
674 | 663 |
675 $ errorcode qpush | 664 $ hg qpush |
676 applying test.patch | 665 applying test.patch |
677 now at: test.patch | 666 now at: test.patch |
678 qpush succeeds | |
679 | 667 |
680 % pops a patch and succeeds | 668 % pops a patch and succeeds |
681 | 669 |
682 $ errorcode qpop | 670 $ hg qpop |
683 popping test.patch | 671 popping test.patch |
684 patch queue now empty | 672 patch queue now empty |
685 qpop succeeds | |
686 | 673 |
687 % pushes up to test1b.patch and succeeds | 674 % pushes up to test1b.patch and succeeds |
688 | 675 |
689 $ errorcode qpush test1b.patch | 676 $ hg qpush test1b.patch |
690 applying test.patch | 677 applying test.patch |
691 applying test1b.patch | 678 applying test1b.patch |
692 now at: test1b.patch | 679 now at: test1b.patch |
693 qpush test1b.patch succeeds | |
694 | 680 |
695 % does nothing and succeeds | 681 % does nothing and succeeds |
696 | 682 |
697 $ errorcode qpush test1b.patch | 683 $ hg qpush test1b.patch |
698 qpush: test1b.patch is already at the top | 684 qpush: test1b.patch is already at the top |
699 qpush test1b.patch succeeds | |
700 | 685 |
701 % does nothing and succeeds | 686 % does nothing and succeeds |
702 | 687 |
703 $ errorcode qpop test1b.patch | 688 $ hg qpop test1b.patch |
704 qpop: test1b.patch is already at the top | 689 qpop: test1b.patch is already at the top |
705 qpop test1b.patch succeeds | |
706 | 690 |
707 % fails - can't push to this patch | 691 % fails - can't push to this patch |
708 | 692 |
709 $ errorcode qpush test.patch | 693 $ hg qpush test.patch |
710 abort: cannot push to a previous patch: test.patch | 694 abort: cannot push to a previous patch: test.patch |
711 qpush test.patch fails | 695 [255] |
712 | 696 |
713 % fails - can't pop to this patch | 697 % fails - can't pop to this patch |
714 | 698 |
715 $ errorcode qpop test2.patch | 699 $ hg qpop test2.patch |
716 abort: patch test2.patch is not applied | 700 abort: patch test2.patch is not applied |
717 qpop test2.patch fails | 701 [255] |
718 | 702 |
719 % pops up to test.patch and succeeds | 703 % pops up to test.patch and succeeds |
720 | 704 |
721 $ errorcode qpop test.patch | 705 $ hg qpop test.patch |
722 popping test1b.patch | 706 popping test1b.patch |
723 now at: test.patch | 707 now at: test.patch |
724 qpop test.patch succeeds | |
725 | 708 |
726 % pushes all patches and succeeds | 709 % pushes all patches and succeeds |
727 | 710 |
728 $ errorcode qpush -a | 711 $ hg qpush -a |
729 applying test1b.patch | 712 applying test1b.patch |
730 applying test2.patch | 713 applying test2.patch |
731 now at: test2.patch | 714 now at: test2.patch |
732 qpush -a succeeds | |
733 | 715 |
734 % does nothing and succeeds | 716 % does nothing and succeeds |
735 | 717 |
736 $ errorcode qpush -a | 718 $ hg qpush -a |
737 all patches are currently applied | 719 all patches are currently applied |
738 qpush -a succeeds | |
739 | 720 |
740 % fails - nothing else to push | 721 % fails - nothing else to push |
741 | 722 |
742 $ errorcode qpush | 723 $ hg qpush |
743 patch series already fully applied | 724 patch series already fully applied |
744 qpush fails | 725 [1] |
745 | 726 |
746 % does nothing and succeeds | 727 % does nothing and succeeds |
747 | 728 |
748 $ errorcode qpush test2.patch | 729 $ hg qpush test2.patch |
749 qpush: test2.patch is already at the top | 730 qpush: test2.patch is already at the top |
750 qpush test2.patch succeeds | |
751 | |
752 | |
753 | 731 |
754 strip | 732 strip |
755 | 733 |
756 $ cd ../../b | 734 $ cd ../../b |
757 $ echo x>x | 735 $ echo x>x |
1085 $ test -f bucephalus && echo % bucephalus should not be there | 1063 $ test -f bucephalus && echo % bucephalus should not be there |
1086 [1] | 1064 [1] |
1087 $ hg qpush | 1065 $ hg qpush |
1088 applying addbucephalus | 1066 applying addbucephalus |
1089 now at: addbucephalus | 1067 now at: addbucephalus |
1090 $ test -f bucephalus || echo % bucephalus should be there | 1068 $ test -f bucephalus |
1091 $ python "$TESTDIR/md5sum.py" bucephalus | 1069 $ python "$TESTDIR/md5sum.py" bucephalus |
1092 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus | 1070 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus |
1093 | 1071 |
1094 | 1072 |
1095 | 1073 |