##// END OF EJS Templates
bundle2: attribute remote failures to remote (issue4788)...
Gregory Szorc -
r26829:58f1645f stable
parent child Browse files
Show More
@@ -1408,10 +1408,14 b' def handlereplycaps(op, inpart):'
1408 if op.reply is None:
1408 if op.reply is None:
1409 op.reply = bundle20(op.ui, caps)
1409 op.reply = bundle20(op.ui, caps)
1410
1410
1411 class AbortFromPart(error.Abort):
1412 """Sub-class of Abort that denotes an error from a bundle2 part."""
1413
1411 @parthandler('error:abort', ('message', 'hint'))
1414 @parthandler('error:abort', ('message', 'hint'))
1412 def handleerrorabort(op, inpart):
1415 def handleerrorabort(op, inpart):
1413 """Used to transmit abort error over the wire"""
1416 """Used to transmit abort error over the wire"""
1414 raise error.Abort(inpart.params['message'], hint=inpart.params.get('hint'))
1417 raise AbortFromPart(inpart.params['message'],
1418 hint=inpart.params.get('hint'))
1415
1419
1416 @parthandler('error:pushkey', ('namespace', 'key', 'new', 'old', 'ret',
1420 @parthandler('error:pushkey', ('namespace', 'key', 'new', 'old', 'ret',
1417 'in-reply-to'))
1421 'in-reply-to'))
@@ -798,6 +798,9 b' def _pushbundle2(pushop):'
798 op = bundle2.processbundle(pushop.repo, reply, trgetter)
798 op = bundle2.processbundle(pushop.repo, reply, trgetter)
799 except error.BundleValueError as exc:
799 except error.BundleValueError as exc:
800 raise error.Abort('missing support for %s' % exc)
800 raise error.Abort('missing support for %s' % exc)
801 except bundle2.AbortFromPart as exc:
802 pushop.ui.status(_('remote: %s\n') % exc)
803 raise error.Abort(_('push failed on remote'), hint=exc.hint)
801 except error.PushkeyFailed as exc:
804 except error.PushkeyFailed as exc:
802 partid = int(exc.partid)
805 partid = int(exc.partid)
803 if partid not in pushop.pkfailcb:
806 if partid not in pushop.pkfailcb:
@@ -518,14 +518,16 b' Doing the actual push: Abort error'
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
@@ -624,7 +626,8 b' Doing the actual push: hook abort'
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
@@ -639,7 +642,8 b' Doing the actual push: hook abort'
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)
@@ -684,7 +688,8 b' Check error from hook during the unbundl'
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/
@@ -697,7 +702,8 b' Check error from hook during the unbundl'
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.
@@ -733,7 +739,8 b' Check output capture control.'
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/
@@ -746,7 +753,8 b' Check output capture control.'
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
@@ -928,7 +936,8 b' Test lazily acquiring the lock during un'
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
@@ -533,7 +533,8 b' remote hook failure is attributed to rem'
533 remote: adding manifests
533 remote: adding manifests
534 remote: adding file changes
534 remote: adding file changes
535 remote: added 1 changesets with 1 changes to 1 files
535 remote: added 1 changesets with 1 changes to 1 files
536 remote: hook failure!transaction abort!
536 remote: hook failure!
537 remote: transaction abort!
537 remote: rollback completed
538 remote: rollback completed
538 remote: abort: pretxnchangegroup.fail hook failed
539 remote: abort: pretxnchangegroup.fail hook failed
539 [1]
540 [1]
@@ -397,7 +397,8 b' Test hg-ssh in read-only mode:'
397 pushing to ssh://user@dummy/*/remote (glob)
397 pushing to ssh://user@dummy/*/remote (glob)
398 searching for changes
398 searching for changes
399 remote: Permission denied
399 remote: Permission denied
400 abort: pretxnopen.hg-ssh hook failed
400 remote: pretxnopen.hg-ssh hook failed
401 abort: push failed on remote
401 [255]
402 [255]
402
403
403 $ cd ..
404 $ cd ..
@@ -527,6 +528,7 b' remote hook failure is attributed to rem'
527 remote: hook failure!
528 remote: hook failure!
528 remote: transaction abort!
529 remote: transaction abort!
529 remote: rollback completed
530 remote: rollback completed
530 abort: pretxnchangegroup.fail hook failed
531 remote: pretxnchangegroup.fail hook failed
532 abort: push failed on remote
531 [255]
533 [255]
532
534
General Comments 0
You need to be logged in to leave comments. Login now