Show More
@@ -9,9 +9,6 b' from __future__ import absolute_import' | |||||
9 | import contextlib |
|
9 | import contextlib | |
10 |
|
10 | |||
11 | from .i18n import _ |
|
11 | from .i18n import _ | |
12 | from .thirdparty import ( |
|
|||
13 | cbor, |
|
|||
14 | ) |
|
|||
15 | from . import ( |
|
12 | from . import ( | |
16 | encoding, |
|
13 | encoding, | |
17 | error, |
|
14 | error, | |
@@ -22,6 +19,7 b' from . import (' | |||||
22 | wireprototypes, |
|
19 | wireprototypes, | |
23 | ) |
|
20 | ) | |
24 | from .utils import ( |
|
21 | from .utils import ( | |
|
22 | cborutil, | |||
25 | interfaceutil, |
|
23 | interfaceutil, | |
26 | ) |
|
24 | ) | |
27 |
|
25 | |||
@@ -302,8 +300,11 b' def _httpv2runcommand(ui, repo, req, res' | |||||
302 | res.status = b'200 OK' |
|
300 | res.status = b'200 OK' | |
303 | res.headers[b'Content-Type'] = FRAMINGTYPE |
|
301 | res.headers[b'Content-Type'] = FRAMINGTYPE | |
304 |
|
302 | |||
|
303 | # TODO consider adding a type to represent an iterable of values to | |||
|
304 | # be CBOR encoded. | |||
305 | if isinstance(rsp, wireprototypes.cborresponse): |
|
305 | if isinstance(rsp, wireprototypes.cborresponse): | |
306 | encoded = cbor.dumps(rsp.value, canonical=True) |
|
306 | # TODO consider calling oncommandresponsereadygen(). | |
|
307 | encoded = b''.join(cborutil.streamencode(rsp.value)) | |||
307 | action, meta = reactor.oncommandresponseready(outstream, |
|
308 | action, meta = reactor.oncommandresponseready(outstream, | |
308 | command['requestid'], |
|
309 | command['requestid'], | |
309 | encoded) |
|
310 | encoded) |
@@ -517,7 +517,7 b' Interleaved requests to "multirequest" a' | |||||
517 | s> Transfer-Encoding: chunked\r\n |
|
517 | s> Transfer-Encoding: chunked\r\n | |
518 | s> \r\n |
|
518 | s> \r\n | |
519 | s> 33\r\n |
|
519 | s> 33\r\n | |
520 |
s> +\x00\x00\x03\x00\x02\x012\xa1FstatusBok\xa3 |
|
520 | s> +\x00\x00\x03\x00\x02\x012\xa1FstatusBok\xa3Ibookmarks@Jnamespaces@Fphases@ | |
521 | s> \r\n |
|
521 | s> \r\n | |
522 | s> 14\r\n |
|
522 | s> 14\r\n | |
523 | s> \x0c\x00\x00\x01\x00\x02\x002\xa1FstatusBok\xa0 |
|
523 | s> \x0c\x00\x00\x01\x00\x02\x002\xa1FstatusBok\xa0 |
@@ -335,7 +335,7 b' capabilities command returns expected in' | |||||
335 | s> \r\n |
|
335 | s> \r\n | |
336 | s> 1d7\r\n |
|
336 | s> 1d7\r\n | |
337 | s> \xcf\x01\x00\x01\x00\x02\x012 |
|
337 | s> \xcf\x01\x00\x01\x00\x02\x012 | |
338 | s> \xa1FstatusBok\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x81\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0005 |
|
338 | s> \xa1FstatusBok\xa4Hcommands\xa7Ibranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyInamespaceBnsCnewCnewColdColdKpermissions\x81DpushKcompression\x81\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0005Nrawrepoformats\x82LgeneraldeltaHrevlogv1 | |
339 | s> \r\n |
|
339 | s> \r\n | |
340 | received frame(size=463; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) |
|
340 | received frame(size=463; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) | |
341 | s> 0\r\n |
|
341 | s> 0\r\n |
@@ -49,7 +49,7 b' Request for namespaces works' | |||||
49 | s> \r\n |
|
49 | s> \r\n | |
50 | s> 33\r\n |
|
50 | s> 33\r\n | |
51 | s> +\x00\x00\x01\x00\x02\x012 |
|
51 | s> +\x00\x00\x01\x00\x02\x012 | |
52 |
s> \xa1FstatusBok\xa3 |
|
52 | s> \xa1FstatusBok\xa3Ibookmarks@Jnamespaces@Fphases@ | |
53 | s> \r\n |
|
53 | s> \r\n | |
54 | received frame(size=43; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) |
|
54 | received frame(size=43; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) | |
55 | s> 0\r\n |
|
55 | s> 0\r\n | |
@@ -86,7 +86,7 b' Request for phases works' | |||||
86 | s> \r\n |
|
86 | s> \r\n | |
87 | s> 50\r\n |
|
87 | s> 50\r\n | |
88 | s> H\x00\x00\x01\x00\x02\x012 |
|
88 | s> H\x00\x00\x01\x00\x02\x012 | |
89 |
s> \xa1FstatusBok\xa2 |
|
89 | s> \xa1FstatusBok\xa2X(be0ef73c17ade3fc89dc41701eb9fc3a91b58282A1JpublishingDTrue | |
90 | s> \r\n |
|
90 | s> \r\n | |
91 | received frame(size=72; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) |
|
91 | received frame(size=72; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) | |
92 | s> 0\r\n |
|
92 | s> 0\r\n |
General Comments 0
You need to be logged in to leave comments.
Login now