comparison tests/test-bundle2-exchange.t @ 26829:58f1645f72c3 stable

bundle2: attribute remote failures to remote (issue4788) Before bundle2, hook output from hook failures was prefixed with "remote: ". Up to this point with bundle2, the output was converted to the message to print in an Abort exception. This had 2 implications: 1) It was unclear whether an error message came from the local repo or the remote 2) The exit code changed from 1 to 255 This patch changes the handling of error:abort bundle2 parts during push to prefix the error message with "remote: ". This restores the old behavior. We still preserve the behavior of raising an Abort during bundle2 application failure. This is a regression from pre-bundle2 because the exit code changed. Because we no longer raise an Abort with the remote's message, we needed to insert a message for the new Abort. So, I invented a new error message for that. This is another change from pre-bundle2. However, I like the new error message because it states unambiguously who aborted the push failed, which I think is important for users so they can decide what's next.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 24 Oct 2015 00:39:22 +0100
parents 56b2bcea2529
children b288fb2724bf
comparison
equal deleted inserted replaced
26828:00e75baa810f 26829:58f1645f72c3
516 [255] 516 [255]
517 517
518 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 518 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
519 pushing to ssh://user@dummy/other 519 pushing to ssh://user@dummy/other
520 searching for changes 520 searching for changes
521 abort: Abandon ship! 521 remote: Abandon ship!
522 abort: push failed on remote
522 (don't panic) 523 (don't panic)
523 [255] 524 [255]
524 525
525 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 526 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
526 pushing to http://localhost:$HGPORT2/ 527 pushing to http://localhost:$HGPORT2/
527 searching for changes 528 searching for changes
528 abort: Abandon ship! 529 remote: Abandon ship!
530 abort: push failed on remote
529 (don't panic) 531 (don't panic)
530 [255] 532 [255]
531 533
532 534
533 Doing the actual push: unknown mandatory parts 535 Doing the actual push: unknown mandatory parts
622 remote: pre-close-tip:e7ec4e813ba6 draft 624 remote: pre-close-tip:e7ec4e813ba6 draft
623 remote: You shall not pass! 625 remote: You shall not pass!
624 remote: transaction abort! 626 remote: transaction abort!
625 remote: Cleaning up the mess... 627 remote: Cleaning up the mess...
626 remote: rollback completed 628 remote: rollback completed
627 abort: pretxnclose.failpush hook exited with status 1 629 remote: pretxnclose.failpush hook exited with status 1
630 abort: push failed on remote
628 [255] 631 [255]
629 632
630 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 633 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
631 pushing to http://localhost:$HGPORT2/ 634 pushing to http://localhost:$HGPORT2/
632 searching for changes 635 searching for changes
637 remote: pre-close-tip:e7ec4e813ba6 draft 640 remote: pre-close-tip:e7ec4e813ba6 draft
638 remote: You shall not pass! 641 remote: You shall not pass!
639 remote: transaction abort! 642 remote: transaction abort!
640 remote: Cleaning up the mess... 643 remote: Cleaning up the mess...
641 remote: rollback completed 644 remote: rollback completed
642 abort: pretxnclose.failpush hook exited with status 1 645 remote: pretxnclose.failpush hook exited with status 1
646 abort: push failed on remote
643 [255] 647 [255]
644 648
645 (check that no 'pending' files remain) 649 (check that no 'pending' files remain)
646 650
647 $ ls -1 other/.hg/bookmarks* 651 $ ls -1 other/.hg/bookmarks*
682 remote: added 1 changesets with 1 changes to 1 files 686 remote: added 1 changesets with 1 changes to 1 files
683 remote: Fail early! 687 remote: Fail early!
684 remote: transaction abort! 688 remote: transaction abort!
685 remote: Cleaning up the mess... 689 remote: Cleaning up the mess...
686 remote: rollback completed 690 remote: rollback completed
687 abort: pretxnchangegroup hook exited with status 1 691 remote: pretxnchangegroup hook exited with status 1
692 abort: push failed on remote
688 [255] 693 [255]
689 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 694 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
690 pushing to http://localhost:$HGPORT2/ 695 pushing to http://localhost:$HGPORT2/
691 searching for changes 696 searching for changes
692 remote: adding changesets 697 remote: adding changesets
695 remote: added 1 changesets with 1 changes to 1 files 700 remote: added 1 changesets with 1 changes to 1 files
696 remote: Fail early! 701 remote: Fail early!
697 remote: transaction abort! 702 remote: transaction abort!
698 remote: Cleaning up the mess... 703 remote: Cleaning up the mess...
699 remote: rollback completed 704 remote: rollback completed
700 abort: pretxnchangegroup hook exited with status 1 705 remote: pretxnchangegroup hook exited with status 1
706 abort: push failed on remote
701 [255] 707 [255]
702 708
703 Check output capture control. 709 Check output capture control.
704 710
705 (should be still forced for http, disabled for local and ssh) 711 (should be still forced for http, disabled for local and ssh)
731 remote: added 1 changesets with 1 changes to 1 files 737 remote: added 1 changesets with 1 changes to 1 files
732 remote: Fail early! 738 remote: Fail early!
733 remote: transaction abort! 739 remote: transaction abort!
734 remote: Cleaning up the mess... 740 remote: Cleaning up the mess...
735 remote: rollback completed 741 remote: rollback completed
736 abort: pretxnchangegroup hook exited with status 1 742 remote: pretxnchangegroup hook exited with status 1
743 abort: push failed on remote
737 [255] 744 [255]
738 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 745 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
739 pushing to http://localhost:$HGPORT2/ 746 pushing to http://localhost:$HGPORT2/
740 searching for changes 747 searching for changes
741 remote: adding changesets 748 remote: adding changesets
744 remote: added 1 changesets with 1 changes to 1 files 751 remote: added 1 changesets with 1 changes to 1 files
745 remote: Fail early! 752 remote: Fail early!
746 remote: transaction abort! 753 remote: transaction abort!
747 remote: Cleaning up the mess... 754 remote: Cleaning up the mess...
748 remote: rollback completed 755 remote: rollback completed
749 abort: pretxnchangegroup hook exited with status 1 756 remote: pretxnchangegroup hook exited with status 1
757 abort: push failed on remote
750 [255] 758 [255]
751 759
752 Check abort from mandatory pushkey 760 Check abort from mandatory pushkey
753 761
754 $ cat > mandatorypart.py << EOF 762 $ cat > mandatorypart.py << EOF
926 $ cd lazylockclient 934 $ cd lazylockclient
927 $ touch a && hg ci -Aqm a 935 $ touch a && hg ci -Aqm a
928 $ hg push 936 $ hg push
929 pushing to ssh://user@dummy/lazylock 937 pushing to ssh://user@dummy/lazylock
930 searching for changes 938 searching for changes
931 abort: Lock should not be taken 939 remote: Lock should not be taken
940 abort: push failed on remote
932 [255] 941 [255]
933 942
934 $ cat >> ../lazylock/.hg/hgrc <<EOF 943 $ cat >> ../lazylock/.hg/hgrc <<EOF
935 > [experimental] 944 > [experimental]
936 > bundle2lazylocking=True 945 > bundle2lazylocking=True