Show More
@@ -753,3 +753,9 b' def handlereplycaps(op, inpart):' | |||
|
753 | 753 | manargs = dict(inpart.mandatoryparams) |
|
754 | 754 | advargs = dict(inpart.advisoryparams) |
|
755 | 755 | raise util.Abort(manargs['message'], hint=advargs.get('hint')) |
|
756 | ||
|
757 | @parthandler('b2x:error:unknownpart') | |
|
758 | def handlereplycaps(op, inpart): | |
|
759 | """Used to transmit unknown part error over the wire""" | |
|
760 | manargs = dict(inpart.mandatoryparams) | |
|
761 | raise UnknownPartError(manargs['parttype']) |
@@ -803,6 +803,12 b' def unbundle(repo, proto, heads):' | |||
|
803 | 803 | finally: |
|
804 | 804 | fp.close() |
|
805 | 805 | os.unlink(tempname) |
|
806 | except bundle2.UnknownPartError, exc: | |
|
807 | bundler = bundle2.bundle20(repo.ui) | |
|
808 | part = bundle2.bundlepart('B2X:ERROR:UNKNOWNPART', | |
|
809 | [('parttype', str(exc))]) | |
|
810 | bundler.addpart(part) | |
|
811 | return streamres(bundler.getchunks()) | |
|
806 | 812 | except util.Abort, inst: |
|
807 | 813 | # The old code we moved used sys.stderr directly. |
|
808 | 814 | # We did not change it to minimise code change. |
@@ -908,6 +908,8 b' Setting up' | |||
|
908 | 908 | > part = None |
|
909 | 909 | > if reason == 'abort': |
|
910 | 910 | > part = bundle2.bundlepart('test:abort') |
|
911 | > if reason == 'unknown': | |
|
912 | > part = bundle2.bundlepart('TEST:UNKNOWN') | |
|
911 | 913 | > if part is not None: |
|
912 | 914 | > bundler.addpart(part) |
|
913 | 915 | > return extradata |
@@ -969,3 +971,27 b' Doing the actual push: Abort error' | |||
|
969 | 971 | [255] |
|
970 | 972 | |
|
971 | 973 | |
|
974 | Doing the actual push: unknown mandatory parts | |
|
975 | ||
|
976 | $ cat << EOF >> $HGRCPATH | |
|
977 | > [failpush] | |
|
978 | > reason = unknown | |
|
979 | > EOF | |
|
980 | ||
|
981 | $ hg -R main push other -r e7ec4e813ba6 | |
|
982 | pushing to other | |
|
983 | searching for changes | |
|
984 | abort: missing support for 'test:unknown' | |
|
985 | [255] | |
|
986 | ||
|
987 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 | |
|
988 | pushing to ssh://user@dummy/other | |
|
989 | searching for changes | |
|
990 | abort: missing support for "'test:unknown'" | |
|
991 | [255] | |
|
992 | ||
|
993 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | |
|
994 | pushing to http://localhost:$HGPORT2/ | |
|
995 | searching for changes | |
|
996 | abort: missing support for "'test:unknown'" | |
|
997 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now