##// END OF EJS Templates
wireprotov2: define response data as CBOR...
Gregory Szorc -
r37740:89a16704 default
parent child Browse files
Show More
@@ -3014,11 +3014,7 b' def debugwireproto(ui, repo, path=None, '
3014 res = e.callcommand(command, args).result()
3014 res = e.callcommand(command, args).result()
3015
3015
3016 if isinstance(res, wireprotov2peer.commandresponse):
3016 if isinstance(res, wireprotov2peer.commandresponse):
3017 if res.cbor:
3017 val = list(res.cborobjects())
3018 val = list(res.cborobjects())
3019 else:
3020 val = [res.b.getvalue()]
3021
3022 ui.status(_('response: %s\n') % stringutil.pprint(val))
3018 ui.status(_('response: %s\n') % stringutil.pprint(val))
3023
3019
3024 else:
3020 else:
@@ -671,7 +671,11 b' 0x02'
671 Response Data (``0x04``)
671 Response Data (``0x04``)
672 ------------------------
672 ------------------------
673
673
674 This frame contains raw response data to an issued command.
674 This frame contains response data to an issued command.
675
676 Response data ALWAYS consists of a series of 0 or more CBOR encoded
677 values. A CBOR value may be using indefinite length encoding. And the
678 bytes constituting the value may span several frames.
675
679
676 The following flag values are defined for this type:
680 The following flag values are defined for this type:
677
681
@@ -681,8 +685,6 b' 0x01'
681 0x02
685 0x02
682 End of data. When set, the response data has been fully sent and
686 End of data. When set, the response data has been fully sent and
683 no additional frames for this response will be sent.
687 no additional frames for this response will be sent.
684 0x04
685 CBOR data. When set, the frame payload consists of CBOR data.
686
688
687 The ``0x01`` flag is mutually exclusive with the ``0x02`` flag.
689 The ``0x01`` flag is mutually exclusive with the ``0x02`` flag.
688
690
@@ -81,12 +81,10 b' FLAGS_COMMAND_DATA = {'
81
81
82 FLAG_BYTES_RESPONSE_CONTINUATION = 0x01
82 FLAG_BYTES_RESPONSE_CONTINUATION = 0x01
83 FLAG_BYTES_RESPONSE_EOS = 0x02
83 FLAG_BYTES_RESPONSE_EOS = 0x02
84 FLAG_BYTES_RESPONSE_CBOR = 0x04
85
84
86 FLAGS_BYTES_RESPONSE = {
85 FLAGS_BYTES_RESPONSE = {
87 b'continuation': FLAG_BYTES_RESPONSE_CONTINUATION,
86 b'continuation': FLAG_BYTES_RESPONSE_CONTINUATION,
88 b'eos': FLAG_BYTES_RESPONSE_EOS,
87 b'eos': FLAG_BYTES_RESPONSE_EOS,
89 b'cbor': FLAG_BYTES_RESPONSE_CBOR,
90 }
88 }
91
89
92 FLAG_ERROR_RESPONSE_PROTOCOL = 0x01
90 FLAG_ERROR_RESPONSE_PROTOCOL = 0x01
@@ -350,7 +348,7 b' def createcommandframes(stream, requesti'
350 if done:
348 if done:
351 break
349 break
352
350
353 def createbytesresponseframesfrombytes(stream, requestid, data, iscbor=False,
351 def createbytesresponseframesfrombytes(stream, requestid, data,
354 maxframesize=DEFAULT_MAX_FRAME_SIZE):
352 maxframesize=DEFAULT_MAX_FRAME_SIZE):
355 """Create a raw frame to send a bytes response from static bytes input.
353 """Create a raw frame to send a bytes response from static bytes input.
356
354
@@ -360,9 +358,6 b' def createbytesresponseframesfrombytes(s'
360 # Simple case of a single frame.
358 # Simple case of a single frame.
361 if len(data) <= maxframesize:
359 if len(data) <= maxframesize:
362 flags = FLAG_BYTES_RESPONSE_EOS
360 flags = FLAG_BYTES_RESPONSE_EOS
363 if iscbor:
364 flags |= FLAG_BYTES_RESPONSE_CBOR
365
366 yield stream.makeframe(requestid=requestid,
361 yield stream.makeframe(requestid=requestid,
367 typeid=FRAME_TYPE_BYTES_RESPONSE,
362 typeid=FRAME_TYPE_BYTES_RESPONSE,
368 flags=flags,
363 flags=flags,
@@ -380,9 +375,6 b' def createbytesresponseframesfrombytes(s'
380 else:
375 else:
381 flags = FLAG_BYTES_RESPONSE_CONTINUATION
376 flags = FLAG_BYTES_RESPONSE_CONTINUATION
382
377
383 if iscbor:
384 flags |= FLAG_BYTES_RESPONSE_CBOR
385
386 yield stream.makeframe(requestid=requestid,
378 yield stream.makeframe(requestid=requestid,
387 typeid=FRAME_TYPE_BYTES_RESPONSE,
379 typeid=FRAME_TYPE_BYTES_RESPONSE,
388 flags=flags,
380 flags=flags,
@@ -616,7 +608,7 b' class serverreactor(object):'
616
608
617 return meth(frame)
609 return meth(frame)
618
610
619 def onbytesresponseready(self, stream, requestid, data, iscbor=False):
611 def onbytesresponseready(self, stream, requestid, data):
620 """Signal that a bytes response is ready to be sent to the client.
612 """Signal that a bytes response is ready to be sent to the client.
621
613
622 The raw bytes response is passed as an argument.
614 The raw bytes response is passed as an argument.
@@ -625,8 +617,7 b' class serverreactor(object):'
625
617
626 def sendframes():
618 def sendframes():
627 for frame in createbytesresponseframesfrombytes(stream, requestid,
619 for frame in createbytesresponseframesfrombytes(stream, requestid,
628 data,
620 data):
629 iscbor=iscbor):
630 yield frame
621 yield frame
631
622
632 self._activecommands.remove(requestid)
623 self._activecommands.remove(requestid)
@@ -1067,6 +1058,5 b' class clientreactor(object):'
1067 'request': request,
1058 'request': request,
1068 'expectmore': frame.flags & FLAG_BYTES_RESPONSE_CONTINUATION,
1059 'expectmore': frame.flags & FLAG_BYTES_RESPONSE_CONTINUATION,
1069 'eos': frame.flags & FLAG_BYTES_RESPONSE_EOS,
1060 'eos': frame.flags & FLAG_BYTES_RESPONSE_EOS,
1070 'cbor': frame.flags & FLAG_BYTES_RESPONSE_CBOR,
1071 'data': frame.payload,
1061 'data': frame.payload,
1072 }
1062 }
@@ -25,7 +25,6 b' class commandresponse(object):'
25 self.requestid = requestid
25 self.requestid = requestid
26 self.command = command
26 self.command = command
27
27
28 self.cbor = False
29 self.b = util.bytesio()
28 self.b = util.bytesio()
30
29
31 def cborobjects(self):
30 def cborobjects(self):
@@ -124,9 +123,6 b' class clienthandler(object):'
124 if action == 'responsedata':
123 if action == 'responsedata':
125 response.b.write(meta['data'])
124 response.b.write(meta['data'])
126
125
127 if meta['cbor']:
128 response.cbor = True
129
130 if meta['eos']:
126 if meta['eos']:
131 # If the command has a decoder, resolve the future to the
127 # If the command has a decoder, resolve the future to the
132 # decoded value. Otherwise resolve to the rich response object.
128 # decoded value. Otherwise resolve to the rich response object.
@@ -26,7 +26,7 b' from . import ('
26 wireprototypes,
26 wireprototypes,
27 )
27 )
28
28
29 FRAMINGTYPE = b'application/mercurial-exp-framing-0003'
29 FRAMINGTYPE = b'application/mercurial-exp-framing-0004'
30
30
31 HTTP_WIREPROTO_V2 = wireprototypes.HTTP_WIREPROTO_V2
31 HTTP_WIREPROTO_V2 = wireprototypes.HTTP_WIREPROTO_V2
32
32
@@ -309,8 +309,7 b' def _httpv2runcommand(ui, repo, req, res'
309 encoded = cbor.dumps(rsp.value, canonical=True)
309 encoded = cbor.dumps(rsp.value, canonical=True)
310 action, meta = reactor.onbytesresponseready(outstream,
310 action, meta = reactor.onbytesresponseready(outstream,
311 command['requestid'],
311 command['requestid'],
312 encoded,
312 encoded)
313 iscbor=True)
314 else:
313 else:
315 action, meta = reactor.onapplicationerror(
314 action, meta = reactor.onapplicationerror(
316 _('unhandled response type from wire proto command'))
315 _('unhandled response type from wire proto command'))
@@ -98,7 +98,7 b' Missing Accept header results in 406'
98 s> Content-Type: text/plain\r\n
98 s> Content-Type: text/plain\r\n
99 s> Content-Length: 85\r\n
99 s> Content-Length: 85\r\n
100 s> \r\n
100 s> \r\n
101 s> client MUST specify Accept header with value: application/mercurial-exp-framing-0003\n
101 s> client MUST specify Accept header with value: application/mercurial-exp-framing-0004\n
102
102
103 Bad Accept header results in 406
103 Bad Accept header results in 406
104
104
@@ -121,7 +121,7 b' Bad Accept header results in 406'
121 s> Content-Type: text/plain\r\n
121 s> Content-Type: text/plain\r\n
122 s> Content-Length: 85\r\n
122 s> Content-Length: 85\r\n
123 s> \r\n
123 s> \r\n
124 s> client MUST specify Accept header with value: application/mercurial-exp-framing-0003\n
124 s> client MUST specify Accept header with value: application/mercurial-exp-framing-0004\n
125
125
126 Bad Content-Type header results in 415
126 Bad Content-Type header results in 415
127
127
@@ -134,7 +134,7 b' Bad Content-Type header results in 415'
134 using raw connection to peer
134 using raw connection to peer
135 s> POST /api/exp-http-v2-0001/ro/customreadonly HTTP/1.1\r\n
135 s> POST /api/exp-http-v2-0001/ro/customreadonly HTTP/1.1\r\n
136 s> Accept-Encoding: identity\r\n
136 s> Accept-Encoding: identity\r\n
137 s> accept: application/mercurial-exp-framing-0003\r\n
137 s> accept: application/mercurial-exp-framing-0004\r\n
138 s> content-type: badmedia\r\n
138 s> content-type: badmedia\r\n
139 s> user-agent: test\r\n
139 s> user-agent: test\r\n
140 s> host: $LOCALIP:$HGPORT\r\n (glob)
140 s> host: $LOCALIP:$HGPORT\r\n (glob)
@@ -146,7 +146,7 b' Bad Content-Type header results in 415'
146 s> Content-Type: text/plain\r\n
146 s> Content-Type: text/plain\r\n
147 s> Content-Length: 88\r\n
147 s> Content-Length: 88\r\n
148 s> \r\n
148 s> \r\n
149 s> client MUST send Content-Type header with value: application/mercurial-exp-framing-0003\n
149 s> client MUST send Content-Type header with value: application/mercurial-exp-framing-0004\n
150
150
151 Request to read-only command works out of the box
151 Request to read-only command works out of the box
152
152
@@ -161,7 +161,7 b' Request to read-only command works out o'
161 s> POST /api/exp-http-v2-0001/ro/customreadonly HTTP/1.1\r\n
161 s> POST /api/exp-http-v2-0001/ro/customreadonly HTTP/1.1\r\n
162 s> Accept-Encoding: identity\r\n
162 s> Accept-Encoding: identity\r\n
163 s> *\r\n (glob)
163 s> *\r\n (glob)
164 s> content-type: application/mercurial-exp-framing-0003\r\n
164 s> content-type: application/mercurial-exp-framing-0004\r\n
165 s> user-agent: test\r\n
165 s> user-agent: test\r\n
166 s> content-length: 29\r\n
166 s> content-length: 29\r\n
167 s> host: $LOCALIP:$HGPORT\r\n (glob)
167 s> host: $LOCALIP:$HGPORT\r\n (glob)
@@ -171,11 +171,11 b' Request to read-only command works out o'
171 s> HTTP/1.1 200 OK\r\n
171 s> HTTP/1.1 200 OK\r\n
172 s> Server: testing stub value\r\n
172 s> Server: testing stub value\r\n
173 s> Date: $HTTP_DATE$\r\n
173 s> Date: $HTTP_DATE$\r\n
174 s> Content-Type: application/mercurial-exp-framing-0003\r\n
174 s> Content-Type: application/mercurial-exp-framing-0004\r\n
175 s> Transfer-Encoding: chunked\r\n
175 s> Transfer-Encoding: chunked\r\n
176 s> \r\n
176 s> \r\n
177 s> 25\r\n
177 s> 27\r\n
178 s> \x1d\x00\x00\x01\x00\x02\x01Bcustomreadonly bytes response
178 s> \x1f\x00\x00\x01\x00\x02\x01BX\x1dcustomreadonly bytes response
179 s> \r\n
179 s> \r\n
180 s> 0\r\n
180 s> 0\r\n
181 s> \r\n
181 s> \r\n
@@ -187,8 +187,8 b' Request to read-only command works out o'
187 sending customreadonly command
187 sending customreadonly command
188 s> POST /api/exp-http-v2-0001/ro/customreadonly HTTP/1.1\r\n
188 s> POST /api/exp-http-v2-0001/ro/customreadonly HTTP/1.1\r\n
189 s> Accept-Encoding: identity\r\n
189 s> Accept-Encoding: identity\r\n
190 s> accept: application/mercurial-exp-framing-0003\r\n
190 s> accept: application/mercurial-exp-framing-0004\r\n
191 s> content-type: application/mercurial-exp-framing-0003\r\n
191 s> content-type: application/mercurial-exp-framing-0004\r\n
192 s> content-length: 29\r\n
192 s> content-length: 29\r\n
193 s> host: $LOCALIP:$HGPORT\r\n (glob)
193 s> host: $LOCALIP:$HGPORT\r\n (glob)
194 s> user-agent: Mercurial debugwireproto\r\n
194 s> user-agent: Mercurial debugwireproto\r\n
@@ -198,14 +198,14 b' Request to read-only command works out o'
198 s> HTTP/1.1 200 OK\r\n
198 s> HTTP/1.1 200 OK\r\n
199 s> Server: testing stub value\r\n
199 s> Server: testing stub value\r\n
200 s> Date: $HTTP_DATE$\r\n
200 s> Date: $HTTP_DATE$\r\n
201 s> Content-Type: application/mercurial-exp-framing-0003\r\n
201 s> Content-Type: application/mercurial-exp-framing-0004\r\n
202 s> Transfer-Encoding: chunked\r\n
202 s> Transfer-Encoding: chunked\r\n
203 s> \r\n
203 s> \r\n
204 s> 25\r\n
204 s> 27\r\n
205 s> \x1d\x00\x00\x01\x00\x02\x01B
205 s> \x1f\x00\x00\x01\x00\x02\x01B
206 s> customreadonly bytes response
206 s> X\x1dcustomreadonly bytes response
207 s> \r\n
207 s> \r\n
208 received frame(size=29; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
208 received frame(size=31; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
209 s> 0\r\n
209 s> 0\r\n
210 s> \r\n
210 s> \r\n
211 response: [b'customreadonly bytes response']
211 response: [b'customreadonly bytes response']
@@ -301,8 +301,8 b' Authorized request for valid read-write '
301 using raw connection to peer
301 using raw connection to peer
302 s> POST /api/exp-http-v2-0001/rw/customreadonly HTTP/1.1\r\n
302 s> POST /api/exp-http-v2-0001/rw/customreadonly HTTP/1.1\r\n
303 s> Accept-Encoding: identity\r\n
303 s> Accept-Encoding: identity\r\n
304 s> accept: application/mercurial-exp-framing-0003\r\n
304 s> accept: application/mercurial-exp-framing-0004\r\n
305 s> content-type: application/mercurial-exp-framing-0003\r\n
305 s> content-type: application/mercurial-exp-framing-0004\r\n
306 s> user-agent: test\r\n
306 s> user-agent: test\r\n
307 s> content-length: 29\r\n
307 s> content-length: 29\r\n
308 s> host: $LOCALIP:$HGPORT\r\n (glob)
308 s> host: $LOCALIP:$HGPORT\r\n (glob)
@@ -312,11 +312,11 b' Authorized request for valid read-write '
312 s> HTTP/1.1 200 OK\r\n
312 s> HTTP/1.1 200 OK\r\n
313 s> Server: testing stub value\r\n
313 s> Server: testing stub value\r\n
314 s> Date: $HTTP_DATE$\r\n
314 s> Date: $HTTP_DATE$\r\n
315 s> Content-Type: application/mercurial-exp-framing-0003\r\n
315 s> Content-Type: application/mercurial-exp-framing-0004\r\n
316 s> Transfer-Encoding: chunked\r\n
316 s> Transfer-Encoding: chunked\r\n
317 s> \r\n
317 s> \r\n
318 s> 25\r\n
318 s> 27\r\n
319 s> \x1d\x00\x00\x01\x00\x02\x01Bcustomreadonly bytes response
319 s> \x1f\x00\x00\x01\x00\x02\x01BX\x1dcustomreadonly bytes response
320 s> \r\n
320 s> \r\n
321 s> 0\r\n
321 s> 0\r\n
322 s> \r\n
322 s> \r\n
@@ -331,7 +331,7 b' Authorized request for unknown command i'
331 using raw connection to peer
331 using raw connection to peer
332 s> POST /api/exp-http-v2-0001/rw/badcommand HTTP/1.1\r\n
332 s> POST /api/exp-http-v2-0001/rw/badcommand HTTP/1.1\r\n
333 s> Accept-Encoding: identity\r\n
333 s> Accept-Encoding: identity\r\n
334 s> accept: application/mercurial-exp-framing-0003\r\n
334 s> accept: application/mercurial-exp-framing-0004\r\n
335 s> user-agent: test\r\n
335 s> user-agent: test\r\n
336 s> host: $LOCALIP:$HGPORT\r\n (glob)
336 s> host: $LOCALIP:$HGPORT\r\n (glob)
337 s> \r\n
337 s> \r\n
@@ -393,8 +393,8 b' Command frames can be reflected via debu'
393 using raw connection to peer
393 using raw connection to peer
394 s> POST /api/exp-http-v2-0001/ro/debugreflect HTTP/1.1\r\n
394 s> POST /api/exp-http-v2-0001/ro/debugreflect HTTP/1.1\r\n
395 s> Accept-Encoding: identity\r\n
395 s> Accept-Encoding: identity\r\n
396 s> accept: application/mercurial-exp-framing-0003\r\n
396 s> accept: application/mercurial-exp-framing-0004\r\n
397 s> content-type: application/mercurial-exp-framing-0003\r\n
397 s> content-type: application/mercurial-exp-framing-0004\r\n
398 s> user-agent: test\r\n
398 s> user-agent: test\r\n
399 s> content-length: 47\r\n
399 s> content-length: 47\r\n
400 s> host: $LOCALIP:$HGPORT\r\n (glob)
400 s> host: $LOCALIP:$HGPORT\r\n (glob)
@@ -424,8 +424,8 b' Multiple requests to regular command URL'
424 using raw connection to peer
424 using raw connection to peer
425 s> POST /api/exp-http-v2-0001/ro/customreadonly HTTP/1.1\r\n
425 s> POST /api/exp-http-v2-0001/ro/customreadonly HTTP/1.1\r\n
426 s> Accept-Encoding: identity\r\n
426 s> Accept-Encoding: identity\r\n
427 s> accept: application/mercurial-exp-framing-0003\r\n
427 s> accept: application/mercurial-exp-framing-0004\r\n
428 s> content-type: application/mercurial-exp-framing-0003\r\n
428 s> content-type: application/mercurial-exp-framing-0004\r\n
429 s> user-agent: test\r\n
429 s> user-agent: test\r\n
430 s> content-length: 29\r\n
430 s> content-length: 29\r\n
431 s> host: $LOCALIP:$HGPORT\r\n (glob)
431 s> host: $LOCALIP:$HGPORT\r\n (glob)
@@ -435,11 +435,11 b' Multiple requests to regular command URL'
435 s> HTTP/1.1 200 OK\r\n
435 s> HTTP/1.1 200 OK\r\n
436 s> Server: testing stub value\r\n
436 s> Server: testing stub value\r\n
437 s> Date: $HTTP_DATE$\r\n
437 s> Date: $HTTP_DATE$\r\n
438 s> Content-Type: application/mercurial-exp-framing-0003\r\n
438 s> Content-Type: application/mercurial-exp-framing-0004\r\n
439 s> Transfer-Encoding: chunked\r\n
439 s> Transfer-Encoding: chunked\r\n
440 s> \r\n
440 s> \r\n
441 s> 25\r\n
441 s> 27\r\n
442 s> \x1d\x00\x00\x01\x00\x02\x01Bcustomreadonly bytes response
442 s> \x1f\x00\x00\x01\x00\x02\x01BX\x1dcustomreadonly bytes response
443 s> \r\n
443 s> \r\n
444 s> 0\r\n
444 s> 0\r\n
445 s> \r\n
445 s> \r\n
@@ -468,14 +468,14 b' Multiple requests to "multirequest" URL '
468 s> HTTP/1.1 200 OK\r\n
468 s> HTTP/1.1 200 OK\r\n
469 s> Server: testing stub value\r\n
469 s> Server: testing stub value\r\n
470 s> Date: $HTTP_DATE$\r\n
470 s> Date: $HTTP_DATE$\r\n
471 s> Content-Type: application/mercurial-exp-framing-0003\r\n
471 s> Content-Type: application/mercurial-exp-framing-0004\r\n
472 s> Transfer-Encoding: chunked\r\n
472 s> Transfer-Encoding: chunked\r\n
473 s> \r\n
473 s> \r\n
474 s> 25\r\n
474 s> 27\r\n
475 s> \x1d\x00\x00\x01\x00\x02\x01Bcustomreadonly bytes response
475 s> \x1f\x00\x00\x01\x00\x02\x01BX\x1dcustomreadonly bytes response
476 s> \r\n
476 s> \r\n
477 s> 25\r\n
477 s> 27\r\n
478 s> \x1d\x00\x00\x03\x00\x02\x00Bcustomreadonly bytes response
478 s> \x1f\x00\x00\x03\x00\x02\x00BX\x1dcustomreadonly bytes response
479 s> \r\n
479 s> \r\n
480 s> 0\r\n
480 s> 0\r\n
481 s> \r\n
481 s> \r\n
@@ -495,8 +495,8 b' Interleaved requests to "multirequest" a'
495 using raw connection to peer
495 using raw connection to peer
496 s> POST /api/exp-http-v2-0001/ro/multirequest HTTP/1.1\r\n
496 s> POST /api/exp-http-v2-0001/ro/multirequest HTTP/1.1\r\n
497 s> Accept-Encoding: identity\r\n
497 s> Accept-Encoding: identity\r\n
498 s> accept: application/mercurial-exp-framing-0003\r\n
498 s> accept: application/mercurial-exp-framing-0004\r\n
499 s> content-type: application/mercurial-exp-framing-0003\r\n
499 s> content-type: application/mercurial-exp-framing-0004\r\n
500 s> user-agent: test\r\n
500 s> user-agent: test\r\n
501 s> content-length: 115\r\n
501 s> content-length: 115\r\n
502 s> host: $LOCALIP:$HGPORT\r\n (glob)
502 s> host: $LOCALIP:$HGPORT\r\n (glob)
@@ -506,14 +506,14 b' Interleaved requests to "multirequest" a'
506 s> HTTP/1.1 200 OK\r\n
506 s> HTTP/1.1 200 OK\r\n
507 s> Server: testing stub value\r\n
507 s> Server: testing stub value\r\n
508 s> Date: $HTTP_DATE$\r\n
508 s> Date: $HTTP_DATE$\r\n
509 s> Content-Type: application/mercurial-exp-framing-0003\r\n
509 s> Content-Type: application/mercurial-exp-framing-0004\r\n
510 s> Transfer-Encoding: chunked\r\n
510 s> Transfer-Encoding: chunked\r\n
511 s> \r\n
511 s> \r\n
512 s> 28\r\n
512 s> 28\r\n
513 s> \x00\x00\x03\x00\x02\x01F\xa3Fphases@Ibookmarks@Jnamespaces@
513 s> \x00\x00\x03\x00\x02\x01B\xa3Fphases@Ibookmarks@Jnamespaces@
514 s> \r\n
514 s> \r\n
515 s> 9\r\n
515 s> 9\r\n
516 s> \x01\x00\x00\x01\x00\x02\x00F\xa0
516 s> \x01\x00\x00\x01\x00\x02\x00B\xa0
517 s> \r\n
517 s> \r\n
518 s> 0\r\n
518 s> 0\r\n
519 s> \r\n
519 s> \r\n
@@ -545,8 +545,8 b' Attempting to run a read-write command v'
545 using raw connection to peer
545 using raw connection to peer
546 s> POST /api/exp-http-v2-0001/ro/multirequest HTTP/1.1\r\n
546 s> POST /api/exp-http-v2-0001/ro/multirequest HTTP/1.1\r\n
547 s> Accept-Encoding: identity\r\n
547 s> Accept-Encoding: identity\r\n
548 s> accept: application/mercurial-exp-framing-0003\r\n
548 s> accept: application/mercurial-exp-framing-0004\r\n
549 s> content-type: application/mercurial-exp-framing-0003\r\n
549 s> content-type: application/mercurial-exp-framing-0004\r\n
550 s> user-agent: test\r\n
550 s> user-agent: test\r\n
551 s> content-length: 22\r\n
551 s> content-length: 22\r\n
552 s> host: $LOCALIP:$HGPORT\r\n (glob)
552 s> host: $LOCALIP:$HGPORT\r\n (glob)
@@ -305,12 +305,12 b' Client with HTTPv2 enabled automatically'
305 s> Content-Type: application/mercurial-cbor\r\n
305 s> Content-Type: application/mercurial-cbor\r\n
306 s> Content-Length: *\r\n (glob)
306 s> Content-Length: *\r\n (glob)
307 s> \r\n
307 s> \r\n
308 s> \xa3Dapis\xa1Pexp-http-v2-0001\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\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
308 s> \xa3Dapis\xa1Pexp-http-v2-0001\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\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0004GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
309 sending heads command
309 sending heads command
310 s> POST /api/exp-http-v2-0001/ro/heads HTTP/1.1\r\n
310 s> POST /api/exp-http-v2-0001/ro/heads HTTP/1.1\r\n
311 s> Accept-Encoding: identity\r\n
311 s> Accept-Encoding: identity\r\n
312 s> accept: application/mercurial-exp-framing-0003\r\n
312 s> accept: application/mercurial-exp-framing-0004\r\n
313 s> content-type: application/mercurial-exp-framing-0003\r\n
313 s> content-type: application/mercurial-exp-framing-0004\r\n
314 s> content-length: 20\r\n
314 s> content-length: 20\r\n
315 s> host: $LOCALIP:$HGPORT\r\n (glob)
315 s> host: $LOCALIP:$HGPORT\r\n (glob)
316 s> user-agent: Mercurial debugwireproto\r\n
316 s> user-agent: Mercurial debugwireproto\r\n
@@ -320,16 +320,16 b' Client with HTTPv2 enabled automatically'
320 s> HTTP/1.1 200 OK\r\n
320 s> HTTP/1.1 200 OK\r\n
321 s> Server: testing stub value\r\n
321 s> Server: testing stub value\r\n
322 s> Date: $HTTP_DATE$\r\n
322 s> Date: $HTTP_DATE$\r\n
323 s> Content-Type: application/mercurial-exp-framing-0003\r\n
323 s> Content-Type: application/mercurial-exp-framing-0004\r\n
324 s> Transfer-Encoding: chunked\r\n
324 s> Transfer-Encoding: chunked\r\n
325 s> \r\n
325 s> \r\n
326 s> 1e\r\n
326 s> 1e\r\n
327 s> \x16\x00\x00\x01\x00\x02\x01F
327 s> \x16\x00\x00\x01\x00\x02\x01B
328 s> \x81T\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
328 s> \x81T\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
329 s> \r\n
329 s> \r\n
330 received frame(size=22; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
330 received frame(size=22; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
331 s> 0\r\n
331 s> 0\r\n
332 s> \r\n
332 s> \r\n
333 response: [[b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00']]
333 response: [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00']
334
334
335 $ killdaemons.py
335 $ killdaemons.py
@@ -45,8 +45,8 b' No arguments returns something reasonabl'
45 sending branchmap command
45 sending branchmap command
46 s> POST /api/exp-http-v2-0001/ro/branchmap HTTP/1.1\r\n
46 s> POST /api/exp-http-v2-0001/ro/branchmap HTTP/1.1\r\n
47 s> Accept-Encoding: identity\r\n
47 s> Accept-Encoding: identity\r\n
48 s> accept: application/mercurial-exp-framing-0003\r\n
48 s> accept: application/mercurial-exp-framing-0004\r\n
49 s> content-type: application/mercurial-exp-framing-0003\r\n
49 s> content-type: application/mercurial-exp-framing-0004\r\n
50 s> content-length: 24\r\n
50 s> content-length: 24\r\n
51 s> host: $LOCALIP:$HGPORT\r\n (glob)
51 s> host: $LOCALIP:$HGPORT\r\n (glob)
52 s> user-agent: Mercurial debugwireproto\r\n
52 s> user-agent: Mercurial debugwireproto\r\n
@@ -56,15 +56,15 b' No arguments returns something reasonabl'
56 s> HTTP/1.1 200 OK\r\n
56 s> HTTP/1.1 200 OK\r\n
57 s> Server: testing stub value\r\n
57 s> Server: testing stub value\r\n
58 s> Date: $HTTP_DATE$\r\n
58 s> Date: $HTTP_DATE$\r\n
59 s> Content-Type: application/mercurial-exp-framing-0003\r\n
59 s> Content-Type: application/mercurial-exp-framing-0004\r\n
60 s> Transfer-Encoding: chunked\r\n
60 s> Transfer-Encoding: chunked\r\n
61 s> \r\n
61 s> \r\n
62 s> 78\r\n
62 s> 78\r\n
63 s> p\x00\x00\x01\x00\x02\x01F
63 s> p\x00\x00\x01\x00\x02\x01B
64 s> \xa3Gbranch1\x81T\xb5\xfa\xac\xdf\xd2c7h\xcb1R3l\xc0\x953\x81&f\x88Gbranch2\x81T"Aa\xc7X\x9a\xa4\x8f\xa8:H\xfe\xff^\x95\xb5j\xe3\'\xfcGdefault\x82T&\x80Z\xba\x1e`\n
64 s> \xa3Gbranch1\x81T\xb5\xfa\xac\xdf\xd2c7h\xcb1R3l\xc0\x953\x81&f\x88Gbranch2\x81T"Aa\xc7X\x9a\xa4\x8f\xa8:H\xfe\xff^\x95\xb5j\xe3\'\xfcGdefault\x82T&\x80Z\xba\x1e`\n
65 s> \x82\xe96a\x14\x9f#\x13\x86j"\x1a{T\xbe\x0e\xf7<\x17\xad\xe3\xfc\x89\xdcAp\x1e\xb9\xfc:\x91\xb5\x82\x82
65 s> \x82\xe96a\x14\x9f#\x13\x86j"\x1a{T\xbe\x0e\xf7<\x17\xad\xe3\xfc\x89\xdcAp\x1e\xb9\xfc:\x91\xb5\x82\x82
66 s> \r\n
66 s> \r\n
67 received frame(size=112; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
67 received frame(size=112; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
68 s> 0\r\n
68 s> 0\r\n
69 s> \r\n
69 s> \r\n
70 response: {b'branch1': [b'\xb5\xfa\xac\xdf\xd2c7h\xcb1R3l\xc0\x953\x81&f\x88'], b'branch2': [b'"Aa\xc7X\x9a\xa4\x8f\xa8:H\xfe\xff^\x95\xb5j\xe3\'\xfc'], b'default': [b'&\x80Z\xba\x1e`\n\x82\xe96a\x14\x9f#\x13\x86j"\x1a{', b'\xbe\x0e\xf7<\x17\xad\xe3\xfc\x89\xdcAp\x1e\xb9\xfc:\x91\xb5\x82\x82']}
70 response: {b'branch1': [b'\xb5\xfa\xac\xdf\xd2c7h\xcb1R3l\xc0\x953\x81&f\x88'], b'branch2': [b'"Aa\xc7X\x9a\xa4\x8f\xa8:H\xfe\xff^\x95\xb5j\xe3\'\xfc'], b'default': [b'&\x80Z\xba\x1e`\n\x82\xe96a\x14\x9f#\x13\x86j"\x1a{', b'\xbe\x0e\xf7<\x17\xad\xe3\xfc\x89\xdcAp\x1e\xb9\xfc:\x91\xb5\x82\x82']}
@@ -192,8 +192,8 b' Request for HTTPv2 service returns infor'
192 s> Content-Type: application/mercurial-cbor\r\n
192 s> Content-Type: application/mercurial-cbor\r\n
193 s> Content-Length: *\r\n (glob)
193 s> Content-Length: *\r\n (glob)
194 s> \r\n
194 s> \r\n
195 s> \xa3Dapis\xa1Pexp-http-v2-0001\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\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
195 s> \xa3Dapis\xa1Pexp-http-v2-0001\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\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0004GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
196 cbor> {b'apibase': b'api/', b'apis': {b'exp-http-v2-0001': {b'commands': {b'branchmap': {b'args': {}, b'permissions': [b'pull']}, b'capabilities': {b'args': {}, b'permissions': [b'pull']}, b'heads': {b'args': {b'publiconly': False}, b'permissions': [b'pull']}, b'known': {b'args': {b'nodes': [b'deadbeef']}, b'permissions': [b'pull']}, b'listkeys': {b'args': {b'namespace': b'ns'}, b'permissions': [b'pull']}, b'lookup': {b'args': {b'key': b'foo'}, b'permissions': [b'pull']}, b'pushkey': {b'args': {b'key': b'key', b'namespace': b'ns', b'new': b'new', b'old': b'old'}, b'permissions': [b'push']}}, b'compression': [{b'name': b'zstd'}, {b'name': b'zlib'}], b'framingmediatypes': [b'application/mercurial-exp-framing-0003'], b'rawrepoformats': [b'generaldelta', b'revlogv1']}}, b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash'}
196 cbor> {b'apibase': b'api/', b'apis': {b'exp-http-v2-0001': {b'commands': {b'branchmap': {b'args': {}, b'permissions': [b'pull']}, b'capabilities': {b'args': {}, b'permissions': [b'pull']}, b'heads': {b'args': {b'publiconly': False}, b'permissions': [b'pull']}, b'known': {b'args': {b'nodes': [b'deadbeef']}, b'permissions': [b'pull']}, b'listkeys': {b'args': {b'namespace': b'ns'}, b'permissions': [b'pull']}, b'lookup': {b'args': {b'key': b'foo'}, b'permissions': [b'pull']}, b'pushkey': {b'args': {b'key': b'key', b'namespace': b'ns', b'new': b'new', b'old': b'old'}, b'permissions': [b'push']}}, b'compression': [{b'name': b'zstd'}, {b'name': b'zlib'}], b'framingmediatypes': [b'application/mercurial-exp-framing-0004'], b'rawrepoformats': [b'generaldelta', b'revlogv1']}}, b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash'}
197
197
198 capabilities command returns expected info
198 capabilities command returns expected info
199
199
@@ -217,12 +217,12 b' capabilities command returns expected in'
217 s> Content-Type: application/mercurial-cbor\r\n
217 s> Content-Type: application/mercurial-cbor\r\n
218 s> Content-Length: *\r\n (glob)
218 s> Content-Length: *\r\n (glob)
219 s> \r\n
219 s> \r\n
220 s> \xa3Dapis\xa1Pexp-http-v2-0001\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\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
220 s> \xa3Dapis\xa1Pexp-http-v2-0001\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\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0004GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
221 sending capabilities command
221 sending capabilities command
222 s> POST /api/exp-http-v2-0001/ro/capabilities HTTP/1.1\r\n
222 s> POST /api/exp-http-v2-0001/ro/capabilities HTTP/1.1\r\n
223 s> Accept-Encoding: identity\r\n
223 s> Accept-Encoding: identity\r\n
224 s> accept: application/mercurial-exp-framing-0003\r\n
224 s> *\r\n (glob)
225 s> content-type: application/mercurial-exp-framing-0003\r\n
225 s> content-type: application/mercurial-exp-framing-0004\r\n
226 s> content-length: 27\r\n
226 s> content-length: 27\r\n
227 s> host: $LOCALIP:$HGPORT\r\n (glob)
227 s> host: $LOCALIP:$HGPORT\r\n (glob)
228 s> user-agent: Mercurial debugwireproto\r\n
228 s> user-agent: Mercurial debugwireproto\r\n
@@ -232,16 +232,16 b' capabilities command returns expected in'
232 s> HTTP/1.1 200 OK\r\n
232 s> HTTP/1.1 200 OK\r\n
233 s> Server: testing stub value\r\n
233 s> Server: testing stub value\r\n
234 s> Date: $HTTP_DATE$\r\n
234 s> Date: $HTTP_DATE$\r\n
235 s> Content-Type: application/mercurial-exp-framing-0003\r\n
235 s> Content-Type: application/mercurial-exp-framing-0004\r\n
236 s> Transfer-Encoding: chunked\r\n
236 s> Transfer-Encoding: chunked\r\n
237 s> \r\n
237 s> \r\n
238 s> *\r\n (glob)
238 s> 1d7\r\n
239 s> *\x00\x01\x00\x02\x01F (glob)
239 s> \xcf\x01\x00\x01\x00\x02\x01B
240 s> \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\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0003
240 s> \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\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0004
241 s> \r\n
241 s> \r\n
242 received frame(size=*; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor) (glob)
242 received frame(size=463; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
243 s> 0\r\n
243 s> 0\r\n
244 s> \r\n
244 s> \r\n
245 response: [{b'commands': {b'branchmap': {b'args': {}, b'permissions': [b'pull']}, b'capabilities': {b'args': {}, b'permissions': [b'pull']}, b'heads': {b'args': {b'publiconly': False}, b'permissions': [b'pull']}, b'known': {b'args': {b'nodes': [b'deadbeef']}, b'permissions': [b'pull']}, b'listkeys': {b'args': {b'namespace': b'ns'}, b'permissions': [b'pull']}, b'lookup': {b'args': {b'key': b'foo'}, b'permissions': [b'pull']}, b'pushkey': {b'args': {b'key': b'key', b'namespace': b'ns', b'new': b'new', b'old': b'old'}, b'permissions': [b'push']}}, b'compression': [{b'name': b'zstd'}, {b'name': b'zlib'}], b'framingmediatypes': [b'application/mercurial-exp-framing-0003'], b'rawrepoformats': [b'generaldelta', b'revlogv1']}]
245 response: [{b'commands': {b'branchmap': {b'args': {}, b'permissions': [b'pull']}, b'capabilities': {b'args': {}, b'permissions': [b'pull']}, b'heads': {b'args': {b'publiconly': False}, b'permissions': [b'pull']}, b'known': {b'args': {b'nodes': [b'deadbeef']}, b'permissions': [b'pull']}, b'listkeys': {b'args': {b'namespace': b'ns'}, b'permissions': [b'pull']}, b'lookup': {b'args': {b'key': b'foo'}, b'permissions': [b'pull']}, b'pushkey': {b'args': {b'key': b'key', b'namespace': b'ns', b'new': b'new', b'old': b'old'}, b'permissions': [b'push']}}, b'compression': [{b'name': b'zstd'}, {b'name': b'zlib'}], b'framingmediatypes': [b'application/mercurial-exp-framing-0004'], b'rawrepoformats': [b'generaldelta', b'revlogv1']}]
246
246
247 $ cat error.log
247 $ cat error.log
@@ -37,8 +37,8 b' All non-secret heads returned by default'
37 sending heads command
37 sending heads command
38 s> POST /api/exp-http-v2-0001/ro/heads HTTP/1.1\r\n
38 s> POST /api/exp-http-v2-0001/ro/heads HTTP/1.1\r\n
39 s> Accept-Encoding: identity\r\n
39 s> Accept-Encoding: identity\r\n
40 s> accept: application/mercurial-exp-framing-0003\r\n
40 s> accept: application/mercurial-exp-framing-0004\r\n
41 s> content-type: application/mercurial-exp-framing-0003\r\n
41 s> content-type: application/mercurial-exp-framing-0004\r\n
42 s> content-length: 20\r\n
42 s> content-length: 20\r\n
43 s> host: $LOCALIP:$HGPORT\r\n (glob)
43 s> host: $LOCALIP:$HGPORT\r\n (glob)
44 s> user-agent: Mercurial debugwireproto\r\n
44 s> user-agent: Mercurial debugwireproto\r\n
@@ -48,14 +48,14 b' All non-secret heads returned by default'
48 s> HTTP/1.1 200 OK\r\n
48 s> HTTP/1.1 200 OK\r\n
49 s> Server: testing stub value\r\n
49 s> Server: testing stub value\r\n
50 s> Date: $HTTP_DATE$\r\n
50 s> Date: $HTTP_DATE$\r\n
51 s> Content-Type: application/mercurial-exp-framing-0003\r\n
51 s> Content-Type: application/mercurial-exp-framing-0004\r\n
52 s> Transfer-Encoding: chunked\r\n
52 s> Transfer-Encoding: chunked\r\n
53 s> \r\n
53 s> \r\n
54 s> 48\r\n
54 s> 48\r\n
55 s> @\x00\x00\x01\x00\x02\x01F
55 s> @\x00\x00\x01\x00\x02\x01B
56 s> \x83T\x1dok\x91\xd4J\xab\xa6\xd5\xe5\x80\xbc0\xa9\x94\x850\xdb\xe0\x0bT\xaeI.6\xb0\xc83\x9f\xfa\xf3(\xd0\x0b\x85\xb4R]\xe1\x16^T)Dm-\xc5A\x9c_\x97Dz\x8b\xc0b\xe4\xcc2\x8b\xf2A
56 s> \x83T\x1dok\x91\xd4J\xab\xa6\xd5\xe5\x80\xbc0\xa9\x94\x850\xdb\xe0\x0bT\xaeI.6\xb0\xc83\x9f\xfa\xf3(\xd0\x0b\x85\xb4R]\xe1\x16^T)Dm-\xc5A\x9c_\x97Dz\x8b\xc0b\xe4\xcc2\x8b\xf2A
57 s> \r\n
57 s> \r\n
58 received frame(size=64; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
58 received frame(size=64; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
59 s> 0\r\n
59 s> 0\r\n
60 s> \r\n
60 s> \r\n
61 response: [b'\x1dok\x91\xd4J\xab\xa6\xd5\xe5\x80\xbc0\xa9\x94\x850\xdb\xe0\x0b', b'\xaeI.6\xb0\xc83\x9f\xfa\xf3(\xd0\x0b\x85\xb4R]\xe1\x16^', b')Dm-\xc5A\x9c_\x97Dz\x8b\xc0b\xe4\xcc2\x8b\xf2A']
61 response: [b'\x1dok\x91\xd4J\xab\xa6\xd5\xe5\x80\xbc0\xa9\x94\x850\xdb\xe0\x0b', b'\xaeI.6\xb0\xc83\x9f\xfa\xf3(\xd0\x0b\x85\xb4R]\xe1\x16^', b')Dm-\xc5A\x9c_\x97Dz\x8b\xc0b\xe4\xcc2\x8b\xf2A']
@@ -70,8 +70,8 b' Requesting just the public heads works'
70 sending heads command
70 sending heads command
71 s> POST /api/exp-http-v2-0001/ro/heads HTTP/1.1\r\n
71 s> POST /api/exp-http-v2-0001/ro/heads HTTP/1.1\r\n
72 s> Accept-Encoding: identity\r\n
72 s> Accept-Encoding: identity\r\n
73 s> accept: application/mercurial-exp-framing-0003\r\n
73 s> accept: application/mercurial-exp-framing-0004\r\n
74 s> content-type: application/mercurial-exp-framing-0003\r\n
74 s> content-type: application/mercurial-exp-framing-0004\r\n
75 s> content-length: 39\r\n
75 s> content-length: 39\r\n
76 s> host: $LOCALIP:$HGPORT\r\n (glob)
76 s> host: $LOCALIP:$HGPORT\r\n (glob)
77 s> user-agent: Mercurial debugwireproto\r\n
77 s> user-agent: Mercurial debugwireproto\r\n
@@ -81,14 +81,14 b' Requesting just the public heads works'
81 s> HTTP/1.1 200 OK\r\n
81 s> HTTP/1.1 200 OK\r\n
82 s> Server: testing stub value\r\n
82 s> Server: testing stub value\r\n
83 s> Date: $HTTP_DATE$\r\n
83 s> Date: $HTTP_DATE$\r\n
84 s> Content-Type: application/mercurial-exp-framing-0003\r\n
84 s> Content-Type: application/mercurial-exp-framing-0004\r\n
85 s> Transfer-Encoding: chunked\r\n
85 s> Transfer-Encoding: chunked\r\n
86 s> \r\n
86 s> \r\n
87 s> 1e\r\n
87 s> 1e\r\n
88 s> \x16\x00\x00\x01\x00\x02\x01F
88 s> \x16\x00\x00\x01\x00\x02\x01B
89 s> \x81Tx\xd2\xdc\xa46\xb2\xf5\xb1\x88\xac&~)\xb8\x1e\x07&m8\xfc
89 s> \x81Tx\xd2\xdc\xa46\xb2\xf5\xb1\x88\xac&~)\xb8\x1e\x07&m8\xfc
90 s> \r\n
90 s> \r\n
91 received frame(size=22; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
91 received frame(size=22; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
92 s> 0\r\n
92 s> 0\r\n
93 s> \r\n
93 s> \r\n
94 response: [b'x\xd2\xdc\xa46\xb2\xf5\xb1\x88\xac&~)\xb8\x1e\x07&m8\xfc']
94 response: [b'x\xd2\xdc\xa46\xb2\xf5\xb1\x88\xac&~)\xb8\x1e\x07&m8\xfc']
@@ -29,8 +29,8 b' No arguments returns something reasonabl'
29 sending known command
29 sending known command
30 s> POST /api/exp-http-v2-0001/ro/known HTTP/1.1\r\n
30 s> POST /api/exp-http-v2-0001/ro/known HTTP/1.1\r\n
31 s> Accept-Encoding: identity\r\n
31 s> Accept-Encoding: identity\r\n
32 s> accept: application/mercurial-exp-framing-0003\r\n
32 s> accept: application/mercurial-exp-framing-0004\r\n
33 s> content-type: application/mercurial-exp-framing-0003\r\n
33 s> content-type: application/mercurial-exp-framing-0004\r\n
34 s> content-length: 20\r\n
34 s> content-length: 20\r\n
35 s> host: $LOCALIP:$HGPORT\r\n (glob)
35 s> host: $LOCALIP:$HGPORT\r\n (glob)
36 s> user-agent: Mercurial debugwireproto\r\n
36 s> user-agent: Mercurial debugwireproto\r\n
@@ -40,14 +40,14 b' No arguments returns something reasonabl'
40 s> HTTP/1.1 200 OK\r\n
40 s> HTTP/1.1 200 OK\r\n
41 s> Server: testing stub value\r\n
41 s> Server: testing stub value\r\n
42 s> Date: $HTTP_DATE$\r\n
42 s> Date: $HTTP_DATE$\r\n
43 s> Content-Type: application/mercurial-exp-framing-0003\r\n
43 s> Content-Type: application/mercurial-exp-framing-0004\r\n
44 s> Transfer-Encoding: chunked\r\n
44 s> Transfer-Encoding: chunked\r\n
45 s> \r\n
45 s> \r\n
46 s> 9\r\n
46 s> 9\r\n
47 s> \x01\x00\x00\x01\x00\x02\x01F
47 s> \x01\x00\x00\x01\x00\x02\x01B
48 s> @
48 s> @
49 s> \r\n
49 s> \r\n
50 received frame(size=1; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
50 received frame(size=1; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
51 s> 0\r\n
51 s> 0\r\n
52 s> \r\n
52 s> \r\n
53 response: []
53 response: []
@@ -62,8 +62,8 b' Single known node works'
62 sending known command
62 sending known command
63 s> POST /api/exp-http-v2-0001/ro/known HTTP/1.1\r\n
63 s> POST /api/exp-http-v2-0001/ro/known HTTP/1.1\r\n
64 s> Accept-Encoding: identity\r\n
64 s> Accept-Encoding: identity\r\n
65 s> accept: application/mercurial-exp-framing-0003\r\n
65 s> accept: application/mercurial-exp-framing-0004\r\n
66 s> content-type: application/mercurial-exp-framing-0003\r\n
66 s> content-type: application/mercurial-exp-framing-0004\r\n
67 s> content-length: 54\r\n
67 s> content-length: 54\r\n
68 s> host: $LOCALIP:$HGPORT\r\n (glob)
68 s> host: $LOCALIP:$HGPORT\r\n (glob)
69 s> user-agent: Mercurial debugwireproto\r\n
69 s> user-agent: Mercurial debugwireproto\r\n
@@ -73,14 +73,14 b' Single known node works'
73 s> HTTP/1.1 200 OK\r\n
73 s> HTTP/1.1 200 OK\r\n
74 s> Server: testing stub value\r\n
74 s> Server: testing stub value\r\n
75 s> Date: $HTTP_DATE$\r\n
75 s> Date: $HTTP_DATE$\r\n
76 s> Content-Type: application/mercurial-exp-framing-0003\r\n
76 s> Content-Type: application/mercurial-exp-framing-0004\r\n
77 s> Transfer-Encoding: chunked\r\n
77 s> Transfer-Encoding: chunked\r\n
78 s> \r\n
78 s> \r\n
79 s> a\r\n
79 s> a\r\n
80 s> \x02\x00\x00\x01\x00\x02\x01F
80 s> \x02\x00\x00\x01\x00\x02\x01B
81 s> A1
81 s> A1
82 s> \r\n
82 s> \r\n
83 received frame(size=2; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
83 received frame(size=2; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
84 s> 0\r\n
84 s> 0\r\n
85 s> \r\n
85 s> \r\n
86 response: [True]
86 response: [True]
@@ -95,8 +95,8 b' Multiple nodes works'
95 sending known command
95 sending known command
96 s> POST /api/exp-http-v2-0001/ro/known HTTP/1.1\r\n
96 s> POST /api/exp-http-v2-0001/ro/known HTTP/1.1\r\n
97 s> Accept-Encoding: identity\r\n
97 s> Accept-Encoding: identity\r\n
98 s> accept: application/mercurial-exp-framing-0003\r\n
98 s> accept: application/mercurial-exp-framing-0004\r\n
99 s> content-type: application/mercurial-exp-framing-0003\r\n
99 s> content-type: application/mercurial-exp-framing-0004\r\n
100 s> content-length: 96\r\n
100 s> content-length: 96\r\n
101 s> host: $LOCALIP:$HGPORT\r\n (glob)
101 s> host: $LOCALIP:$HGPORT\r\n (glob)
102 s> user-agent: Mercurial debugwireproto\r\n
102 s> user-agent: Mercurial debugwireproto\r\n
@@ -106,14 +106,14 b' Multiple nodes works'
106 s> HTTP/1.1 200 OK\r\n
106 s> HTTP/1.1 200 OK\r\n
107 s> Server: testing stub value\r\n
107 s> Server: testing stub value\r\n
108 s> Date: $HTTP_DATE$\r\n
108 s> Date: $HTTP_DATE$\r\n
109 s> Content-Type: application/mercurial-exp-framing-0003\r\n
109 s> Content-Type: application/mercurial-exp-framing-0004\r\n
110 s> Transfer-Encoding: chunked\r\n
110 s> Transfer-Encoding: chunked\r\n
111 s> \r\n
111 s> \r\n
112 s> c\r\n
112 s> c\r\n
113 s> \x04\x00\x00\x01\x00\x02\x01F
113 s> \x04\x00\x00\x01\x00\x02\x01B
114 s> C101
114 s> C101
115 s> \r\n
115 s> \r\n
116 received frame(size=4; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
116 received frame(size=4; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
117 s> 0\r\n
117 s> 0\r\n
118 s> \r\n
118 s> \r\n
119 response: [True, False, True]
119 response: [True, False, True]
@@ -33,8 +33,8 b' Request for namespaces works'
33 sending listkeys command
33 sending listkeys command
34 s> POST /api/exp-http-v2-0001/ro/listkeys HTTP/1.1\r\n
34 s> POST /api/exp-http-v2-0001/ro/listkeys HTTP/1.1\r\n
35 s> Accept-Encoding: identity\r\n
35 s> Accept-Encoding: identity\r\n
36 s> accept: application/mercurial-exp-framing-0003\r\n
36 s> accept: application/mercurial-exp-framing-0004\r\n
37 s> content-type: application/mercurial-exp-framing-0003\r\n
37 s> content-type: application/mercurial-exp-framing-0004\r\n
38 s> content-length: 50\r\n
38 s> content-length: 50\r\n
39 s> host: $LOCALIP:$HGPORT\r\n (glob)
39 s> host: $LOCALIP:$HGPORT\r\n (glob)
40 s> user-agent: Mercurial debugwireproto\r\n
40 s> user-agent: Mercurial debugwireproto\r\n
@@ -44,14 +44,14 b' Request for namespaces works'
44 s> HTTP/1.1 200 OK\r\n
44 s> HTTP/1.1 200 OK\r\n
45 s> Server: testing stub value\r\n
45 s> Server: testing stub value\r\n
46 s> Date: $HTTP_DATE$\r\n
46 s> Date: $HTTP_DATE$\r\n
47 s> Content-Type: application/mercurial-exp-framing-0003\r\n
47 s> Content-Type: application/mercurial-exp-framing-0004\r\n
48 s> Transfer-Encoding: chunked\r\n
48 s> Transfer-Encoding: chunked\r\n
49 s> \r\n
49 s> \r\n
50 s> 28\r\n
50 s> 28\r\n
51 s> \x00\x00\x01\x00\x02\x01F
51 s> \x00\x00\x01\x00\x02\x01B
52 s> \xa3Fphases@Ibookmarks@Jnamespaces@
52 s> \xa3Fphases@Ibookmarks@Jnamespaces@
53 s> \r\n
53 s> \r\n
54 received frame(size=32; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
54 received frame(size=32; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
55 s> 0\r\n
55 s> 0\r\n
56 s> \r\n
56 s> \r\n
57 response: {b'bookmarks': b'', b'namespaces': b'', b'phases': b''}
57 response: {b'bookmarks': b'', b'namespaces': b'', b'phases': b''}
@@ -66,8 +66,8 b' Request for phases works'
66 sending listkeys command
66 sending listkeys command
67 s> POST /api/exp-http-v2-0001/ro/listkeys HTTP/1.1\r\n
67 s> POST /api/exp-http-v2-0001/ro/listkeys HTTP/1.1\r\n
68 s> Accept-Encoding: identity\r\n
68 s> Accept-Encoding: identity\r\n
69 s> accept: application/mercurial-exp-framing-0003\r\n
69 s> accept: application/mercurial-exp-framing-0004\r\n
70 s> content-type: application/mercurial-exp-framing-0003\r\n
70 s> content-type: application/mercurial-exp-framing-0004\r\n
71 s> content-length: 46\r\n
71 s> content-length: 46\r\n
72 s> host: $LOCALIP:$HGPORT\r\n (glob)
72 s> host: $LOCALIP:$HGPORT\r\n (glob)
73 s> user-agent: Mercurial debugwireproto\r\n
73 s> user-agent: Mercurial debugwireproto\r\n
@@ -77,14 +77,14 b' Request for phases works'
77 s> HTTP/1.1 200 OK\r\n
77 s> HTTP/1.1 200 OK\r\n
78 s> Server: testing stub value\r\n
78 s> Server: testing stub value\r\n
79 s> Date: $HTTP_DATE$\r\n
79 s> Date: $HTTP_DATE$\r\n
80 s> Content-Type: application/mercurial-exp-framing-0003\r\n
80 s> Content-Type: application/mercurial-exp-framing-0004\r\n
81 s> Transfer-Encoding: chunked\r\n
81 s> Transfer-Encoding: chunked\r\n
82 s> \r\n
82 s> \r\n
83 s> 45\r\n
83 s> 45\r\n
84 s> =\x00\x00\x01\x00\x02\x01F
84 s> =\x00\x00\x01\x00\x02\x01B
85 s> \xa2JpublishingDTrueX(be0ef73c17ade3fc89dc41701eb9fc3a91b58282A1
85 s> \xa2JpublishingDTrueX(be0ef73c17ade3fc89dc41701eb9fc3a91b58282A1
86 s> \r\n
86 s> \r\n
87 received frame(size=61; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
87 received frame(size=61; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
88 s> 0\r\n
88 s> 0\r\n
89 s> \r\n
89 s> \r\n
90 response: {b'be0ef73c17ade3fc89dc41701eb9fc3a91b58282': b'1', b'publishing': b'True'}
90 response: {b'be0ef73c17ade3fc89dc41701eb9fc3a91b58282': b'1', b'publishing': b'True'}
@@ -99,8 +99,8 b' Request for bookmarks works'
99 sending listkeys command
99 sending listkeys command
100 s> POST /api/exp-http-v2-0001/ro/listkeys HTTP/1.1\r\n
100 s> POST /api/exp-http-v2-0001/ro/listkeys HTTP/1.1\r\n
101 s> Accept-Encoding: identity\r\n
101 s> Accept-Encoding: identity\r\n
102 s> accept: application/mercurial-exp-framing-0003\r\n
102 s> accept: application/mercurial-exp-framing-0004\r\n
103 s> content-type: application/mercurial-exp-framing-0003\r\n
103 s> content-type: application/mercurial-exp-framing-0004\r\n
104 s> content-length: 49\r\n
104 s> content-length: 49\r\n
105 s> host: $LOCALIP:$HGPORT\r\n (glob)
105 s> host: $LOCALIP:$HGPORT\r\n (glob)
106 s> user-agent: Mercurial debugwireproto\r\n
106 s> user-agent: Mercurial debugwireproto\r\n
@@ -110,14 +110,14 b' Request for bookmarks works'
110 s> HTTP/1.1 200 OK\r\n
110 s> HTTP/1.1 200 OK\r\n
111 s> Server: testing stub value\r\n
111 s> Server: testing stub value\r\n
112 s> Date: $HTTP_DATE$\r\n
112 s> Date: $HTTP_DATE$\r\n
113 s> Content-Type: application/mercurial-exp-framing-0003\r\n
113 s> Content-Type: application/mercurial-exp-framing-0004\r\n
114 s> Transfer-Encoding: chunked\r\n
114 s> Transfer-Encoding: chunked\r\n
115 s> \r\n
115 s> \r\n
116 s> 35\r\n
116 s> 35\r\n
117 s> -\x00\x00\x01\x00\x02\x01F
117 s> -\x00\x00\x01\x00\x02\x01B
118 s> \xa1A@X(26805aba1e600a82e93661149f2313866a221a7b
118 s> \xa1A@X(26805aba1e600a82e93661149f2313866a221a7b
119 s> \r\n
119 s> \r\n
120 received frame(size=45; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
120 received frame(size=45; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
121 s> 0\r\n
121 s> 0\r\n
122 s> \r\n
122 s> \r\n
123 response: {b'@': b'26805aba1e600a82e93661149f2313866a221a7b'}
123 response: {b'@': b'26805aba1e600a82e93661149f2313866a221a7b'}
@@ -29,8 +29,8 b' lookup for known node works'
29 sending lookup command
29 sending lookup command
30 s> *\r\n (glob)
30 s> *\r\n (glob)
31 s> Accept-Encoding: identity\r\n
31 s> Accept-Encoding: identity\r\n
32 s> accept: application/mercurial-exp-framing-0003\r\n
32 s> accept: application/mercurial-exp-framing-0004\r\n
33 s> content-type: application/mercurial-exp-framing-0003\r\n
33 s> content-type: application/mercurial-exp-framing-0004\r\n
34 s> content-length: 73\r\n
34 s> content-length: 73\r\n
35 s> host: $LOCALIP:$HGPORT\r\n (glob)
35 s> host: $LOCALIP:$HGPORT\r\n (glob)
36 s> user-agent: Mercurial debugwireproto\r\n
36 s> user-agent: Mercurial debugwireproto\r\n
@@ -40,14 +40,14 b' lookup for known node works'
40 s> HTTP/1.1 200 OK\r\n
40 s> HTTP/1.1 200 OK\r\n
41 s> Server: testing stub value\r\n
41 s> Server: testing stub value\r\n
42 s> Date: $HTTP_DATE$\r\n
42 s> Date: $HTTP_DATE$\r\n
43 s> Content-Type: application/mercurial-exp-framing-0003\r\n
43 s> Content-Type: application/mercurial-exp-framing-0004\r\n
44 s> Transfer-Encoding: chunked\r\n
44 s> Transfer-Encoding: chunked\r\n
45 s> \r\n
45 s> \r\n
46 s> 1d\r\n
46 s> 1d\r\n
47 s> *\x00\x01\x00\x02\x01F (glob)
47 s> \x15\x00\x00\x01\x00\x02\x01B
48 s> TBk\xad\xa5\xc6u\x98\xcae\x03mW\xd9\xe4\xb6K\x0c\x1c\xe7\xa0
48 s> TBk\xad\xa5\xc6u\x98\xcae\x03mW\xd9\xe4\xb6K\x0c\x1c\xe7\xa0
49 s> \r\n
49 s> \r\n
50 received frame(size=*; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor) (glob)
50 received frame(size=21; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
51 s> 0\r\n
51 s> 0\r\n
52 s> \r\n
52 s> \r\n
53 response: b'Bk\xad\xa5\xc6u\x98\xcae\x03mW\xd9\xe4\xb6K\x0c\x1c\xe7\xa0'
53 response: b'Bk\xad\xa5\xc6u\x98\xcae\x03mW\xd9\xe4\xb6K\x0c\x1c\xe7\xa0'
@@ -32,8 +32,8 b' pushkey for a bookmark works'
32 sending pushkey command
32 sending pushkey command
33 s> *\r\n (glob)
33 s> *\r\n (glob)
34 s> Accept-Encoding: identity\r\n
34 s> Accept-Encoding: identity\r\n
35 s> accept: application/mercurial-exp-framing-0003\r\n
35 s> accept: application/mercurial-exp-framing-0004\r\n
36 s> content-type: application/mercurial-exp-framing-0003\r\n
36 s> content-type: application/mercurial-exp-framing-0004\r\n
37 s> content-length: 105\r\n
37 s> content-length: 105\r\n
38 s> host: $LOCALIP:$HGPORT\r\n (glob)
38 s> host: $LOCALIP:$HGPORT\r\n (glob)
39 s> user-agent: Mercurial debugwireproto\r\n
39 s> user-agent: Mercurial debugwireproto\r\n
@@ -43,14 +43,14 b' pushkey for a bookmark works'
43 s> HTTP/1.1 200 OK\r\n
43 s> HTTP/1.1 200 OK\r\n
44 s> Server: testing stub value\r\n
44 s> Server: testing stub value\r\n
45 s> Date: $HTTP_DATE$\r\n
45 s> Date: $HTTP_DATE$\r\n
46 s> Content-Type: application/mercurial-exp-framing-0003\r\n
46 s> Content-Type: application/mercurial-exp-framing-0004\r\n
47 s> Transfer-Encoding: chunked\r\n
47 s> Transfer-Encoding: chunked\r\n
48 s> \r\n
48 s> \r\n
49 s> 9\r\n
49 s> 9\r\n
50 s> *\x00\x01\x00\x02\x01F (glob)
50 s> \x01\x00\x00\x01\x00\x02\x01B
51 s> \xf5
51 s> \xf5
52 s> \r\n
52 s> \r\n
53 received frame(size=*; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor) (glob)
53 received frame(size=1; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
54 s> 0\r\n
54 s> 0\r\n
55 s> \r\n
55 s> \r\n
56 response: True
56 response: True
@@ -63,8 +63,8 b' pushkey for a bookmark works'
63 sending listkeys command
63 sending listkeys command
64 s> POST /api/exp-http-v2-0001/ro/listkeys HTTP/1.1\r\n
64 s> POST /api/exp-http-v2-0001/ro/listkeys HTTP/1.1\r\n
65 s> Accept-Encoding: identity\r\n
65 s> Accept-Encoding: identity\r\n
66 s> accept: application/mercurial-exp-framing-0003\r\n
66 s> accept: application/mercurial-exp-framing-0004\r\n
67 s> content-type: application/mercurial-exp-framing-0003\r\n
67 s> content-type: application/mercurial-exp-framing-0004\r\n
68 s> content-length: 49\r\n
68 s> content-length: 49\r\n
69 s> host: $LOCALIP:$HGPORT\r\n (glob)
69 s> host: $LOCALIP:$HGPORT\r\n (glob)
70 s> user-agent: Mercurial debugwireproto\r\n
70 s> user-agent: Mercurial debugwireproto\r\n
@@ -74,14 +74,14 b' pushkey for a bookmark works'
74 s> HTTP/1.1 200 OK\r\n
74 s> HTTP/1.1 200 OK\r\n
75 s> Server: testing stub value\r\n
75 s> Server: testing stub value\r\n
76 s> Date: $HTTP_DATE$\r\n
76 s> Date: $HTTP_DATE$\r\n
77 s> Content-Type: application/mercurial-exp-framing-0003\r\n
77 s> Content-Type: application/mercurial-exp-framing-0004\r\n
78 s> Transfer-Encoding: chunked\r\n
78 s> Transfer-Encoding: chunked\r\n
79 s> \r\n
79 s> \r\n
80 s> 35\r\n
80 s> 35\r\n
81 s> -\x00\x00\x01\x00\x02\x01F
81 s> -\x00\x00\x01\x00\x02\x01B
82 s> \xa1A@X(426bada5c67598ca65036d57d9e4b64b0c1ce7a0
82 s> \xa1A@X(426bada5c67598ca65036d57d9e4b64b0c1ce7a0
83 s> \r\n
83 s> \r\n
84 received frame(size=45; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
84 received frame(size=45; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos)
85 s> 0\r\n
85 s> 0\r\n
86 s> \r\n
86 s> \r\n
87 response: {b'@': b'426bada5c67598ca65036d57d9e4b64b0c1ce7a0'}
87 response: {b'@': b'426bada5c67598ca65036d57d9e4b64b0c1ce7a0'}
@@ -1,5 +1,5 b''
1 HTTPV2=exp-http-v2-0001
1 HTTPV2=exp-http-v2-0001
2 MEDIATYPE=application/mercurial-exp-framing-0003
2 MEDIATYPE=application/mercurial-exp-framing-0004
3
3
4 sendhttpraw() {
4 sendhttpraw() {
5 hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT/
5 hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT/
@@ -26,7 +26,7 b' def customreadonlyv1(repo, proto):'
26 @wireproto.wireprotocommand('customreadonly', permission='pull',
26 @wireproto.wireprotocommand('customreadonly', permission='pull',
27 transportpolicy=wireproto.POLICY_V2_ONLY)
27 transportpolicy=wireproto.POLICY_V2_ONLY)
28 def customreadonlyv2(repo, proto):
28 def customreadonlyv2(repo, proto):
29 return wireprototypes.bytesresponse(b'customreadonly bytes response')
29 return wireprototypes.cborresponse(b'customreadonly bytes response')
30
30
31 @wireproto.wireprotocommand('customreadwrite', permission='push')
31 @wireproto.wireprotocommand('customreadwrite', permission='push')
32 def customreadwrite(repo, proto):
32 def customreadwrite(repo, proto):
@@ -35,7 +35,7 b' def customreadwrite(repo, proto):'
35 @wireproto.wireprotocommand('customreadwrite', permission='push',
35 @wireproto.wireprotocommand('customreadwrite', permission='push',
36 transportpolicy=wireproto.POLICY_V2_ONLY)
36 transportpolicy=wireproto.POLICY_V2_ONLY)
37 def customreadwritev2(repo, proto):
37 def customreadwritev2(repo, proto):
38 return wireprototypes.bytesresponse(b'customreadwrite bytes response')
38 return wireprototypes.cborresponse(b'customreadwrite bytes response')
39 EOF
39 EOF
40
40
41 cat >> $HGRCPATH << EOF
41 cat >> $HGRCPATH << EOF
General Comments 0
You need to be logged in to leave comments. Login now