##// END OF EJS Templates
wireprotov2: implement commands as a generator of objects...
Gregory Szorc -
r39595:07b58266 default
parent child Browse files
Show More
@@ -308,3 +308,14 b' class PeerTransportError(Abort):'
308 class InMemoryMergeConflictsError(Exception):
308 class InMemoryMergeConflictsError(Exception):
309 """Exception raised when merge conflicts arose during an in-memory merge."""
309 """Exception raised when merge conflicts arose during an in-memory merge."""
310 __bytes__ = _tobytes
310 __bytes__ = _tobytes
311
312 class WireprotoCommandError(Exception):
313 """Represents an error during execution of a wire protocol command.
314
315 Should only be thrown by wire protocol version 2 commands.
316
317 The error is a formatter string and an optional iterable of arguments.
318 """
319 def __init__(self, message, args=None):
320 self.message = message
321 self.messageargs = args
@@ -514,3 +514,6 b' error (optional)'
514 message
514 message
515 (array of maps) A message describing the error. The message uses the
515 (array of maps) A message describing the error. The message uses the
516 same format as those in the ``Human Output Side-Channel`` frame.
516 same format as those in the ``Human Output Side-Channel`` frame.
517
518 TODO formalize when error frames can be seen and how errors can be
519 recognized midway through a command response.
@@ -388,16 +388,14 b' def createcommandresponseframesfrombytes'
388
388
389 def createbytesresponseframesfromgen(stream, requestid, gen,
389 def createbytesresponseframesfromgen(stream, requestid, gen,
390 maxframesize=DEFAULT_MAX_FRAME_SIZE):
390 maxframesize=DEFAULT_MAX_FRAME_SIZE):
391 overall = b''.join(cborutil.streamencode({b'status': b'ok'}))
391 """Generator of frames from a generator of byte chunks.
392
392
393 yield stream.makeframe(requestid=requestid,
393 This assumes that another frame will follow whatever this emits. i.e.
394 typeid=FRAME_TYPE_COMMAND_RESPONSE,
394 this always emits the continuation flag and never emits the end-of-stream
395 flags=FLAG_COMMAND_RESPONSE_CONTINUATION,
395 flag.
396 payload=overall)
396 """
397
398 cb = util.chunkbuffer(gen)
397 cb = util.chunkbuffer(gen)
399
398 flags = FLAG_COMMAND_RESPONSE_CONTINUATION
400 flags = 0
401
399
402 while True:
400 while True:
403 chunk = cb.read(maxframesize)
401 chunk = cb.read(maxframesize)
@@ -411,12 +409,20 b' def createbytesresponseframesfromgen(str'
411
409
412 flags |= FLAG_COMMAND_RESPONSE_CONTINUATION
410 flags |= FLAG_COMMAND_RESPONSE_CONTINUATION
413
411
414 flags ^= FLAG_COMMAND_RESPONSE_CONTINUATION
412 def createcommandresponseokframe(stream, requestid):
415 flags |= FLAG_COMMAND_RESPONSE_EOS
413 overall = b''.join(cborutil.streamencode({b'status': b'ok'}))
416 yield stream.makeframe(requestid=requestid,
414
417 typeid=FRAME_TYPE_COMMAND_RESPONSE,
415 return stream.makeframe(requestid=requestid,
418 flags=flags,
416 typeid=FRAME_TYPE_COMMAND_RESPONSE,
419 payload=b'')
417 flags=FLAG_COMMAND_RESPONSE_CONTINUATION,
418 payload=overall)
419
420 def createcommandresponseeosframe(stream, requestid):
421 """Create an empty payload frame representing command end-of-stream."""
422 return stream.makeframe(requestid=requestid,
423 typeid=FRAME_TYPE_COMMAND_RESPONSE,
424 flags=FLAG_COMMAND_RESPONSE_EOS,
425 payload=b'')
420
426
421 def createcommanderrorresponse(stream, requestid, message, args=None):
427 def createcommanderrorresponse(stream, requestid, message, args=None):
422 # TODO should this be using a list of {'msg': ..., 'args': {}} so atom
428 # TODO should this be using a list of {'msg': ..., 'args': {}} so atom
@@ -686,14 +692,69 b' class serverreactor(object):'
686 'framegen': result,
692 'framegen': result,
687 }
693 }
688
694
689 def oncommandresponsereadygen(self, stream, requestid, gen):
695 def oncommandresponsereadyobjects(self, stream, requestid, objs):
690 """Signal that a bytes response is ready, with data as a generator."""
696 """Signal that objects are ready to be sent to the client.
697
698 ``objs`` is an iterable of objects (typically a generator) that will
699 be encoded via CBOR and added to frames, which will be sent to the
700 client.
701 """
691 ensureserverstream(stream)
702 ensureserverstream(stream)
692
703
704 # We need to take care over exception handling. Uncaught exceptions
705 # when generating frames could lead to premature end of the frame
706 # stream and the possibility of the server or client process getting
707 # in a bad state.
708 #
709 # Keep in mind that if ``objs`` is a generator, advancing it could
710 # raise exceptions that originated in e.g. wire protocol command
711 # functions. That is why we differentiate between exceptions raised
712 # when iterating versus other exceptions that occur.
713 #
714 # In all cases, when the function finishes, the request is fully
715 # handled and no new frames for it should be seen.
716
693 def sendframes():
717 def sendframes():
694 for frame in createbytesresponseframesfromgen(stream, requestid,
718 emitted = False
695 gen):
719 while True:
696 yield frame
720 try:
721 o = next(objs)
722 except StopIteration:
723 if emitted:
724 yield createcommandresponseeosframe(stream, requestid)
725 break
726
727 except error.WireprotoCommandError as e:
728 for frame in createcommanderrorresponse(
729 stream, requestid, e.message, e.messageargs):
730 yield frame
731 break
732
733 except Exception as e:
734 for frame in createerrorframe(stream, requestid,
735 '%s' % e,
736 errtype='server'):
737 yield frame
738
739 break
740
741 try:
742 if not emitted:
743 yield createcommandresponseokframe(stream, requestid)
744 emitted = True
745
746 # TODO buffer chunks so emitted frame payloads can be
747 # larger.
748 for frame in createbytesresponseframesfromgen(
749 stream, requestid, cborutil.streamencode(o)):
750 yield frame
751 except Exception as e:
752 for frame in createerrorframe(stream, requestid,
753 '%s' % e,
754 errtype='server'):
755 yield frame
756
757 break
697
758
698 self._activecommands.remove(requestid)
759 self._activecommands.remove(requestid)
699
760
@@ -106,27 +106,6 b' class streamreslegacy(object):'
106 def __init__(self, gen=None):
106 def __init__(self, gen=None):
107 self.gen = gen
107 self.gen = gen
108
108
109 class cborresponse(object):
110 """Encode the response value as CBOR."""
111 def __init__(self, v):
112 self.value = v
113
114 class v2errorresponse(object):
115 """Represents a command error for version 2 transports."""
116 def __init__(self, message, args=None):
117 self.message = message
118 self.args = args
119
120 class v2streamingresponse(object):
121 """A response whose data is supplied by a generator.
122
123 The generator can either consist of data structures to CBOR
124 encode or a stream of already-encoded bytes.
125 """
126 def __init__(self, gen, compressible=True):
127 self.gen = gen
128 self.compressible = compressible
129
130 # list of nodes encoding / decoding
109 # list of nodes encoding / decoding
131 def decodelist(l, sep=' '):
110 def decodelist(l, sep=' '):
132 if l:
111 if l:
@@ -124,6 +124,8 b' class clienthandler(object):'
124 else:
124 else:
125 raise e
125 raise e
126
126
127 return
128
127 if frame.requestid not in self._requests:
129 if frame.requestid not in self._requests:
128 raise error.ProgrammingError(
130 raise error.ProgrammingError(
129 'received frame for unknown request; this is either a bug in '
131 'received frame for unknown request; this is either a bug in '
@@ -19,7 +19,6 b' from . import ('
19 wireprototypes,
19 wireprototypes,
20 )
20 )
21 from .utils import (
21 from .utils import (
22 cborutil,
23 interfaceutil,
22 interfaceutil,
24 )
23 )
25
24
@@ -295,31 +294,19 b' def _httpv2runcommand(ui, repo, req, res'
295 res.setbodybytes(_('command in frame must match command in URL'))
294 res.setbodybytes(_('command in frame must match command in URL'))
296 return True
295 return True
297
296
298 rsp = dispatch(repo, proto, command['command'])
299
300 res.status = b'200 OK'
297 res.status = b'200 OK'
301 res.headers[b'Content-Type'] = FRAMINGTYPE
298 res.headers[b'Content-Type'] = FRAMINGTYPE
302
299
303 # TODO consider adding a type to represent an iterable of values to
300 try:
304 # be CBOR encoded.
301 objs = dispatch(repo, proto, command['command'])
305 if isinstance(rsp, wireprototypes.cborresponse):
302
306 # TODO consider calling oncommandresponsereadygen().
303 action, meta = reactor.oncommandresponsereadyobjects(
307 encoded = b''.join(cborutil.streamencode(rsp.value))
304 outstream, command['requestid'], objs)
308 action, meta = reactor.oncommandresponseready(outstream,
305
309 command['requestid'],
306 except Exception as e:
310 encoded)
311 elif isinstance(rsp, wireprototypes.v2streamingresponse):
312 action, meta = reactor.oncommandresponsereadygen(outstream,
313 command['requestid'],
314 rsp.gen)
315 elif isinstance(rsp, wireprototypes.v2errorresponse):
316 action, meta = reactor.oncommanderror(outstream,
317 command['requestid'],
318 rsp.message,
319 rsp.args)
320 else:
321 action, meta = reactor.onservererror(
307 action, meta = reactor.onservererror(
322 _('unhandled response type from wire proto command'))
308 outstream, command['requestid'],
309 _('exception when invoking command: %s') % e)
323
310
324 if action == 'sendframes':
311 if action == 'sendframes':
325 res.setbodygen(meta['framegen'])
312 res.setbodygen(meta['framegen'])
@@ -430,6 +417,12 b' def wireprotocommand(name, args=None, pe'
430 respectively. Default is to assume command requires ``push`` permissions
417 respectively. Default is to assume command requires ``push`` permissions
431 because otherwise commands not declaring their permissions could modify
418 because otherwise commands not declaring their permissions could modify
432 a repository that is supposed to be read-only.
419 a repository that is supposed to be read-only.
420
421 Wire protocol commands are generators of objects to be serialized and
422 sent to the client.
423
424 If a command raises an uncaught exception, this will be translated into
425 a command error.
433 """
426 """
434 transports = {k for k, v in wireprototypes.TRANSPORTS.items()
427 transports = {k for k, v in wireprototypes.TRANSPORTS.items()
435 if v['version'] == 2}
428 if v['version'] == 2}
@@ -460,16 +453,12 b' def wireprotocommand(name, args=None, pe'
460
453
461 @wireprotocommand('branchmap', permission='pull')
454 @wireprotocommand('branchmap', permission='pull')
462 def branchmapv2(repo, proto):
455 def branchmapv2(repo, proto):
463 branchmap = {encoding.fromlocal(k): v
456 yield {encoding.fromlocal(k): v
464 for k, v in repo.branchmap().iteritems()}
457 for k, v in repo.branchmap().iteritems()}
465
466 return wireprototypes.cborresponse(branchmap)
467
458
468 @wireprotocommand('capabilities', permission='pull')
459 @wireprotocommand('capabilities', permission='pull')
469 def capabilitiesv2(repo, proto):
460 def capabilitiesv2(repo, proto):
470 caps = _capabilitiesv2(repo, proto)
461 yield _capabilitiesv2(repo, proto)
471
472 return wireprototypes.cborresponse(caps)
473
462
474 @wireprotocommand('heads',
463 @wireprotocommand('heads',
475 args={
464 args={
@@ -480,7 +469,7 b' def headsv2(repo, proto, publiconly=Fals'
480 if publiconly:
469 if publiconly:
481 repo = repo.filtered('immutable')
470 repo = repo.filtered('immutable')
482
471
483 return wireprototypes.cborresponse(repo.heads())
472 yield repo.heads()
484
473
485 @wireprotocommand('known',
474 @wireprotocommand('known',
486 args={
475 args={
@@ -490,7 +479,7 b' def headsv2(repo, proto, publiconly=Fals'
490 def knownv2(repo, proto, nodes=None):
479 def knownv2(repo, proto, nodes=None):
491 nodes = nodes or []
480 nodes = nodes or []
492 result = b''.join(b'1' if n else b'0' for n in repo.known(nodes))
481 result = b''.join(b'1' if n else b'0' for n in repo.known(nodes))
493 return wireprototypes.cborresponse(result)
482 yield result
494
483
495 @wireprotocommand('listkeys',
484 @wireprotocommand('listkeys',
496 args={
485 args={
@@ -502,7 +491,7 b' def listkeysv2(repo, proto, namespace=No'
502 keys = {encoding.fromlocal(k): encoding.fromlocal(v)
491 keys = {encoding.fromlocal(k): encoding.fromlocal(v)
503 for k, v in keys.iteritems()}
492 for k, v in keys.iteritems()}
504
493
505 return wireprototypes.cborresponse(keys)
494 yield keys
506
495
507 @wireprotocommand('lookup',
496 @wireprotocommand('lookup',
508 args={
497 args={
@@ -515,7 +504,7 b' def lookupv2(repo, proto, key):'
515 # TODO handle exception.
504 # TODO handle exception.
516 node = repo.lookup(key)
505 node = repo.lookup(key)
517
506
518 return wireprototypes.cborresponse(node)
507 yield node
519
508
520 @wireprotocommand('pushkey',
509 @wireprotocommand('pushkey',
521 args={
510 args={
@@ -527,9 +516,7 b' def lookupv2(repo, proto, key):'
527 permission='push')
516 permission='push')
528 def pushkeyv2(repo, proto, namespace, key, old, new):
517 def pushkeyv2(repo, proto, namespace, key, old, new):
529 # TODO handle ui output redirection
518 # TODO handle ui output redirection
530 r = repo.pushkey(encoding.tolocal(namespace),
519 yield repo.pushkey(encoding.tolocal(namespace),
531 encoding.tolocal(key),
520 encoding.tolocal(key),
532 encoding.tolocal(old),
521 encoding.tolocal(old),
533 encoding.tolocal(new))
522 encoding.tolocal(new))
534
535 return wireprototypes.cborresponse(r)
@@ -176,8 +176,14 b' Request to read-only command works out o'
176 s> Content-Type: application/mercurial-exp-framing-0005\r\n
176 s> Content-Type: application/mercurial-exp-framing-0005\r\n
177 s> Transfer-Encoding: chunked\r\n
177 s> Transfer-Encoding: chunked\r\n
178 s> \r\n
178 s> \r\n
179 s> 32\r\n
179 s> 13\r\n
180 s> *\x00\x00\x01\x00\x02\x012\xa1FstatusBokX\x1dcustomreadonly bytes response
180 s> \x0b\x00\x00\x01\x00\x02\x011\xa1FstatusBok
181 s> \r\n
182 s> 27\r\n
183 s> \x1f\x00\x00\x01\x00\x02\x001X\x1dcustomreadonly bytes response
184 s> \r\n
185 s> 8\r\n
186 s> \x00\x00\x00\x01\x00\x02\x002
181 s> \r\n
187 s> \r\n
182 s> 0\r\n
188 s> 0\r\n
183 s> \r\n
189 s> \r\n
@@ -203,13 +209,22 b' Request to read-only command works out o'
203 s> Content-Type: application/mercurial-exp-framing-0005\r\n
209 s> Content-Type: application/mercurial-exp-framing-0005\r\n
204 s> Transfer-Encoding: chunked\r\n
210 s> Transfer-Encoding: chunked\r\n
205 s> \r\n
211 s> \r\n
206 s> 32\r\n
212 s> 13\r\n
207 s> *\x00\x00\x01\x00\x02\x012
213 s> \x0b\x00\x00\x01\x00\x02\x011
208 s> \xa1FstatusBokX\x1dcustomreadonly bytes response
214 s> \xa1FstatusBok
209 s> \r\n
215 s> \r\n
210 received frame(size=42; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos)
216 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
217 s> 27\r\n
218 s> \x1f\x00\x00\x01\x00\x02\x001
219 s> X\x1dcustomreadonly bytes response
220 s> \r\n
221 received frame(size=31; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
222 s> 8\r\n
223 s> \x00\x00\x00\x01\x00\x02\x002
224 s> \r\n
211 s> 0\r\n
225 s> 0\r\n
212 s> \r\n
226 s> \r\n
227 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
213 response: [
228 response: [
214 {
229 {
215 b'status': b'ok'
230 b'status': b'ok'
@@ -322,8 +337,14 b' Authorized request for valid read-write '
322 s> Content-Type: application/mercurial-exp-framing-0005\r\n
337 s> Content-Type: application/mercurial-exp-framing-0005\r\n
323 s> Transfer-Encoding: chunked\r\n
338 s> Transfer-Encoding: chunked\r\n
324 s> \r\n
339 s> \r\n
325 s> 32\r\n
340 s> 13\r\n
326 s> *\x00\x00\x01\x00\x02\x012\xa1FstatusBokX\x1dcustomreadonly bytes response
341 s> \x0b\x00\x00\x01\x00\x02\x011\xa1FstatusBok
342 s> \r\n
343 s> 27\r\n
344 s> \x1f\x00\x00\x01\x00\x02\x001X\x1dcustomreadonly bytes response
345 s> \r\n
346 s> 8\r\n
347 s> \x00\x00\x00\x01\x00\x02\x002
327 s> \r\n
348 s> \r\n
328 s> 0\r\n
349 s> 0\r\n
329 s> \r\n
350 s> \r\n
@@ -445,8 +466,14 b' Multiple requests to regular command URL'
445 s> Content-Type: application/mercurial-exp-framing-0005\r\n
466 s> Content-Type: application/mercurial-exp-framing-0005\r\n
446 s> Transfer-Encoding: chunked\r\n
467 s> Transfer-Encoding: chunked\r\n
447 s> \r\n
468 s> \r\n
448 s> 32\r\n
469 s> 13\r\n
449 s> *\x00\x00\x01\x00\x02\x012\xa1FstatusBokX\x1dcustomreadonly bytes response
470 s> \x0b\x00\x00\x01\x00\x02\x011\xa1FstatusBok
471 s> \r\n
472 s> 27\r\n
473 s> \x1f\x00\x00\x01\x00\x02\x001X\x1dcustomreadonly bytes response
474 s> \r\n
475 s> 8\r\n
476 s> \x00\x00\x00\x01\x00\x02\x002
450 s> \r\n
477 s> \r\n
451 s> 0\r\n
478 s> 0\r\n
452 s> \r\n
479 s> \r\n
@@ -478,11 +505,23 b' Multiple requests to "multirequest" URL '
478 s> Content-Type: application/mercurial-exp-framing-0005\r\n
505 s> Content-Type: application/mercurial-exp-framing-0005\r\n
479 s> Transfer-Encoding: chunked\r\n
506 s> Transfer-Encoding: chunked\r\n
480 s> \r\n
507 s> \r\n
481 s> 32\r\n
508 s> 13\r\n
482 s> *\x00\x00\x01\x00\x02\x012\xa1FstatusBokX\x1dcustomreadonly bytes response
509 s> \x0b\x00\x00\x01\x00\x02\x011\xa1FstatusBok
510 s> \r\n
511 s> 27\r\n
512 s> \x1f\x00\x00\x01\x00\x02\x001X\x1dcustomreadonly bytes response
513 s> \r\n
514 s> 8\r\n
515 s> \x00\x00\x00\x01\x00\x02\x002
483 s> \r\n
516 s> \r\n
484 s> 32\r\n
517 s> 13\r\n
485 s> *\x00\x00\x03\x00\x02\x002\xa1FstatusBokX\x1dcustomreadonly bytes response
518 s> \x0b\x00\x00\x03\x00\x02\x001\xa1FstatusBok
519 s> \r\n
520 s> 27\r\n
521 s> \x1f\x00\x00\x03\x00\x02\x001X\x1dcustomreadonly bytes response
522 s> \r\n
523 s> 8\r\n
524 s> \x00\x00\x00\x03\x00\x02\x002
486 s> \r\n
525 s> \r\n
487 s> 0\r\n
526 s> 0\r\n
488 s> \r\n
527 s> \r\n
@@ -516,11 +555,23 b' Interleaved requests to "multirequest" a'
516 s> Content-Type: application/mercurial-exp-framing-0005\r\n
555 s> Content-Type: application/mercurial-exp-framing-0005\r\n
517 s> Transfer-Encoding: chunked\r\n
556 s> Transfer-Encoding: chunked\r\n
518 s> \r\n
557 s> \r\n
519 s> 33\r\n
558 s> 13\r\n
520 s> +\x00\x00\x03\x00\x02\x012\xa1FstatusBok\xa3Ibookmarks@Jnamespaces@Fphases@
559 s> \x0b\x00\x00\x03\x00\x02\x011\xa1FstatusBok
560 s> \r\n
561 s> 28\r\n
562 s> \x00\x00\x03\x00\x02\x001\xa3Ibookmarks@Jnamespaces@Fphases@
563 s> \r\n
564 s> 8\r\n
565 s> \x00\x00\x00\x03\x00\x02\x002
521 s> \r\n
566 s> \r\n
522 s> 14\r\n
567 s> 13\r\n
523 s> \x0c\x00\x00\x01\x00\x02\x002\xa1FstatusBok\xa0
568 s> \x0b\x00\x00\x01\x00\x02\x001\xa1FstatusBok
569 s> \r\n
570 s> 9\r\n
571 s> \x01\x00\x00\x01\x00\x02\x001\xa0
572 s> \r\n
573 s> 8\r\n
574 s> \x00\x00\x00\x01\x00\x02\x002
524 s> \r\n
575 s> \r\n
525 s> 0\r\n
576 s> 0\r\n
526 s> \r\n
577 s> \r\n
@@ -331,13 +331,22 b' Client with HTTPv2 enabled automatically'
331 s> Content-Type: application/mercurial-exp-framing-0005\r\n
331 s> Content-Type: application/mercurial-exp-framing-0005\r\n
332 s> Transfer-Encoding: chunked\r\n
332 s> Transfer-Encoding: chunked\r\n
333 s> \r\n
333 s> \r\n
334 s> 29\r\n
334 s> 13\r\n
335 s> !\x00\x00\x01\x00\x02\x012
335 s> \x0b\x00\x00\x01\x00\x02\x011
336 s> \xa1FstatusBok\x81T\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
336 s> \xa1FstatusBok
337 s> \r\n
337 s> \r\n
338 received frame(size=33; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos)
338 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
339 s> 1e\r\n
340 s> \x16\x00\x00\x01\x00\x02\x001
341 s> \x81T\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
342 s> \r\n
343 received frame(size=22; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
344 s> 8\r\n
345 s> \x00\x00\x00\x01\x00\x02\x002
346 s> \r\n
339 s> 0\r\n
347 s> 0\r\n
340 s> \r\n
348 s> \r\n
349 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
341 response: [
350 response: [
342 b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
351 b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
343 ]
352 ]
@@ -59,14 +59,23 b' No arguments returns something reasonabl'
59 s> Content-Type: application/mercurial-exp-framing-0005\r\n
59 s> Content-Type: application/mercurial-exp-framing-0005\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> 83\r\n
62 s> 13\r\n
63 s> {\x00\x00\x01\x00\x02\x012
63 s> \x0b\x00\x00\x01\x00\x02\x011
64 s> \xa1FstatusBok\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> \xa1FstatusBok
65 s> \r\n
66 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
67 s> 78\r\n
68 s> p\x00\x00\x01\x00\x02\x001
69 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
70 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
71 s> \r\n
67 received frame(size=123; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos)
72 received frame(size=112; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
73 s> 8\r\n
74 s> \x00\x00\x00\x01\x00\x02\x002
75 s> \r\n
68 s> 0\r\n
76 s> 0\r\n
69 s> \r\n
77 s> \r\n
78 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
70 response: {
79 response: {
71 b'branch1': [
80 b'branch1': [
72 b'\xb5\xfa\xac\xdf\xd2c7h\xcb1R3l\xc0\x953\x81&f\x88'
81 b'\xb5\xfa\xac\xdf\xd2c7h\xcb1R3l\xc0\x953\x81&f\x88'
@@ -333,13 +333,22 b' capabilities command returns expected in'
333 s> Content-Type: application/mercurial-exp-framing-0005\r\n
333 s> Content-Type: application/mercurial-exp-framing-0005\r\n
334 s> Transfer-Encoding: chunked\r\n
334 s> Transfer-Encoding: chunked\r\n
335 s> \r\n
335 s> \r\n
336 s> 1d7\r\n
336 s> 13\r\n
337 s> \xcf\x01\x00\x01\x00\x02\x012
337 s> \x0b\x00\x00\x01\x00\x02\x011
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
338 s> \xa1FstatusBok
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=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
341 s> 1cc\r\n
342 s> \xc4\x01\x00\x01\x00\x02\x001
343 s> \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
344 s> \r\n
345 received frame(size=452; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
346 s> 8\r\n
347 s> \x00\x00\x00\x01\x00\x02\x002
348 s> \r\n
341 s> 0\r\n
349 s> 0\r\n
342 s> \r\n
350 s> \r\n
351 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
343 response: [
352 response: [
344 {
353 {
345 b'status': b'ok'
354 b'status': b'ok'
@@ -51,13 +51,22 b' All non-secret heads returned by default'
51 s> Content-Type: application/mercurial-exp-framing-0005\r\n
51 s> Content-Type: application/mercurial-exp-framing-0005\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> 53\r\n
54 s> 13\r\n
55 s> K\x00\x00\x01\x00\x02\x012
55 s> \x0b\x00\x00\x01\x00\x02\x011
56 s> \xa1FstatusBok\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> \xa1FstatusBok
57 s> \r\n
57 s> \r\n
58 received frame(size=75; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos)
58 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
59 s> 48\r\n
60 s> @\x00\x00\x01\x00\x02\x001
61 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
62 s> \r\n
63 received frame(size=64; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
64 s> 8\r\n
65 s> \x00\x00\x00\x01\x00\x02\x002
66 s> \r\n
59 s> 0\r\n
67 s> 0\r\n
60 s> \r\n
68 s> \r\n
69 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
61 response: [
70 response: [
62 b'\x1dok\x91\xd4J\xab\xa6\xd5\xe5\x80\xbc0\xa9\x94\x850\xdb\xe0\x0b',
71 b'\x1dok\x91\xd4J\xab\xa6\xd5\xe5\x80\xbc0\xa9\x94\x850\xdb\xe0\x0b',
63 b'\xaeI.6\xb0\xc83\x9f\xfa\xf3(\xd0\x0b\x85\xb4R]\xe1\x16^',
72 b'\xaeI.6\xb0\xc83\x9f\xfa\xf3(\xd0\x0b\x85\xb4R]\xe1\x16^',
@@ -88,13 +97,22 b' Requesting just the public heads works'
88 s> Content-Type: application/mercurial-exp-framing-0005\r\n
97 s> Content-Type: application/mercurial-exp-framing-0005\r\n
89 s> Transfer-Encoding: chunked\r\n
98 s> Transfer-Encoding: chunked\r\n
90 s> \r\n
99 s> \r\n
91 s> 29\r\n
100 s> 13\r\n
92 s> !\x00\x00\x01\x00\x02\x012
101 s> \x0b\x00\x00\x01\x00\x02\x011
93 s> \xa1FstatusBok\x81Tx\xd2\xdc\xa46\xb2\xf5\xb1\x88\xac&~)\xb8\x1e\x07&m8\xfc
102 s> \xa1FstatusBok
94 s> \r\n
103 s> \r\n
95 received frame(size=33; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos)
104 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
105 s> 1e\r\n
106 s> \x16\x00\x00\x01\x00\x02\x001
107 s> \x81Tx\xd2\xdc\xa46\xb2\xf5\xb1\x88\xac&~)\xb8\x1e\x07&m8\xfc
108 s> \r\n
109 received frame(size=22; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
110 s> 8\r\n
111 s> \x00\x00\x00\x01\x00\x02\x002
112 s> \r\n
96 s> 0\r\n
113 s> 0\r\n
97 s> \r\n
114 s> \r\n
115 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
98 response: [
116 response: [
99 b'x\xd2\xdc\xa46\xb2\xf5\xb1\x88\xac&~)\xb8\x1e\x07&m8\xfc'
117 b'x\xd2\xdc\xa46\xb2\xf5\xb1\x88\xac&~)\xb8\x1e\x07&m8\xfc'
100 ]
118 ]
@@ -43,13 +43,22 b' No arguments returns something reasonabl'
43 s> Content-Type: application/mercurial-exp-framing-0005\r\n
43 s> Content-Type: application/mercurial-exp-framing-0005\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> 14\r\n
46 s> 13\r\n
47 s> \x0c\x00\x00\x01\x00\x02\x012
47 s> \x0b\x00\x00\x01\x00\x02\x011
48 s> \xa1FstatusBok@
48 s> \xa1FstatusBok
49 s> \r\n
49 s> \r\n
50 received frame(size=12; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos)
50 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
51 s> 9\r\n
52 s> \x01\x00\x00\x01\x00\x02\x001
53 s> @
54 s> \r\n
55 received frame(size=1; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
56 s> 8\r\n
57 s> \x00\x00\x00\x01\x00\x02\x002
58 s> \r\n
51 s> 0\r\n
59 s> 0\r\n
52 s> \r\n
60 s> \r\n
61 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
53 response: []
62 response: []
54
63
55 Single known node works
64 Single known node works
@@ -76,13 +85,22 b' Single known node works'
76 s> Content-Type: application/mercurial-exp-framing-0005\r\n
85 s> Content-Type: application/mercurial-exp-framing-0005\r\n
77 s> Transfer-Encoding: chunked\r\n
86 s> Transfer-Encoding: chunked\r\n
78 s> \r\n
87 s> \r\n
79 s> 15\r\n
88 s> 13\r\n
80 s> \r\x00\x00\x01\x00\x02\x012
89 s> \x0b\x00\x00\x01\x00\x02\x011
81 s> \xa1FstatusBokA1
90 s> \xa1FstatusBok
82 s> \r\n
91 s> \r\n
83 received frame(size=13; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos)
92 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
93 s> a\r\n
94 s> \x02\x00\x00\x01\x00\x02\x001
95 s> A1
96 s> \r\n
97 received frame(size=2; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
98 s> 8\r\n
99 s> \x00\x00\x00\x01\x00\x02\x002
100 s> \r\n
84 s> 0\r\n
101 s> 0\r\n
85 s> \r\n
102 s> \r\n
103 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
86 response: [
104 response: [
87 True
105 True
88 ]
106 ]
@@ -111,13 +129,22 b' Multiple nodes works'
111 s> Content-Type: application/mercurial-exp-framing-0005\r\n
129 s> Content-Type: application/mercurial-exp-framing-0005\r\n
112 s> Transfer-Encoding: chunked\r\n
130 s> Transfer-Encoding: chunked\r\n
113 s> \r\n
131 s> \r\n
114 s> 17\r\n
132 s> 13\r\n
115 s> \x0f\x00\x00\x01\x00\x02\x012
133 s> \x0b\x00\x00\x01\x00\x02\x011
116 s> \xa1FstatusBokC101
134 s> \xa1FstatusBok
117 s> \r\n
135 s> \r\n
118 received frame(size=15; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos)
136 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
137 s> c\r\n
138 s> \x04\x00\x00\x01\x00\x02\x001
139 s> C101
140 s> \r\n
141 received frame(size=4; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
142 s> 8\r\n
143 s> \x00\x00\x00\x01\x00\x02\x002
144 s> \r\n
119 s> 0\r\n
145 s> 0\r\n
120 s> \r\n
146 s> \r\n
147 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
121 response: [
148 response: [
122 True,
149 True,
123 False,
150 False,
@@ -47,13 +47,22 b' Request for namespaces works'
47 s> Content-Type: application/mercurial-exp-framing-0005\r\n
47 s> Content-Type: application/mercurial-exp-framing-0005\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> 33\r\n
50 s> 13\r\n
51 s> +\x00\x00\x01\x00\x02\x012
51 s> \x0b\x00\x00\x01\x00\x02\x011
52 s> \xa1FstatusBok\xa3Ibookmarks@Jnamespaces@Fphases@
52 s> \xa1FstatusBok
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=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
55 s> 28\r\n
56 s> \x00\x00\x01\x00\x02\x001
57 s> \xa3Ibookmarks@Jnamespaces@Fphases@
58 s> \r\n
59 received frame(size=32; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
60 s> 8\r\n
61 s> \x00\x00\x00\x01\x00\x02\x002
62 s> \r\n
55 s> 0\r\n
63 s> 0\r\n
56 s> \r\n
64 s> \r\n
65 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
57 response: {
66 response: {
58 b'bookmarks': b'',
67 b'bookmarks': b'',
59 b'namespaces': b'',
68 b'namespaces': b'',
@@ -84,13 +93,22 b' Request for phases works'
84 s> Content-Type: application/mercurial-exp-framing-0005\r\n
93 s> Content-Type: application/mercurial-exp-framing-0005\r\n
85 s> Transfer-Encoding: chunked\r\n
94 s> Transfer-Encoding: chunked\r\n
86 s> \r\n
95 s> \r\n
87 s> 50\r\n
96 s> 13\r\n
88 s> H\x00\x00\x01\x00\x02\x012
97 s> \x0b\x00\x00\x01\x00\x02\x011
89 s> \xa1FstatusBok\xa2X(be0ef73c17ade3fc89dc41701eb9fc3a91b58282A1JpublishingDTrue
98 s> \xa1FstatusBok
90 s> \r\n
99 s> \r\n
91 received frame(size=72; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos)
100 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
101 s> 45\r\n
102 s> =\x00\x00\x01\x00\x02\x001
103 s> \xa2X(be0ef73c17ade3fc89dc41701eb9fc3a91b58282A1JpublishingDTrue
104 s> \r\n
105 received frame(size=61; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
106 s> 8\r\n
107 s> \x00\x00\x00\x01\x00\x02\x002
108 s> \r\n
92 s> 0\r\n
109 s> 0\r\n
93 s> \r\n
110 s> \r\n
111 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
94 response: {
112 response: {
95 b'be0ef73c17ade3fc89dc41701eb9fc3a91b58282': b'1',
113 b'be0ef73c17ade3fc89dc41701eb9fc3a91b58282': b'1',
96 b'publishing': b'True'
114 b'publishing': b'True'
@@ -120,13 +138,22 b' Request for bookmarks works'
120 s> Content-Type: application/mercurial-exp-framing-0005\r\n
138 s> Content-Type: application/mercurial-exp-framing-0005\r\n
121 s> Transfer-Encoding: chunked\r\n
139 s> Transfer-Encoding: chunked\r\n
122 s> \r\n
140 s> \r\n
123 s> 40\r\n
141 s> 13\r\n
124 s> 8\x00\x00\x01\x00\x02\x012
142 s> \x0b\x00\x00\x01\x00\x02\x011
125 s> \xa1FstatusBok\xa1A@X(26805aba1e600a82e93661149f2313866a221a7b
143 s> \xa1FstatusBok
126 s> \r\n
144 s> \r\n
127 received frame(size=56; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos)
145 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
146 s> 35\r\n
147 s> -\x00\x00\x01\x00\x02\x001
148 s> \xa1A@X(26805aba1e600a82e93661149f2313866a221a7b
149 s> \r\n
150 received frame(size=45; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
151 s> 8\r\n
152 s> \x00\x00\x00\x01\x00\x02\x002
153 s> \r\n
128 s> 0\r\n
154 s> 0\r\n
129 s> \r\n
155 s> \r\n
156 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
130 response: {
157 response: {
131 b'@': b'26805aba1e600a82e93661149f2313866a221a7b'
158 b'@': b'26805aba1e600a82e93661149f2313866a221a7b'
132 }
159 }
@@ -43,13 +43,22 b' lookup for known node works'
43 s> Content-Type: application/mercurial-exp-framing-0005\r\n
43 s> Content-Type: application/mercurial-exp-framing-0005\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> 28\r\n
46 s> 13\r\n
47 s> \x00\x00\x01\x00\x02\x012
47 s> \x0b\x00\x00\x01\x00\x02\x011
48 s> \xa1FstatusBokTBk\xad\xa5\xc6u\x98\xcae\x03mW\xd9\xe4\xb6K\x0c\x1c\xe7\xa0
48 s> \xa1FstatusBok
49 s> \r\n
49 s> \r\n
50 received frame(size=32; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos)
50 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
51 s> 1d\r\n
52 s> \x15\x00\x00\x01\x00\x02\x001
53 s> TBk\xad\xa5\xc6u\x98\xcae\x03mW\xd9\xe4\xb6K\x0c\x1c\xe7\xa0
54 s> \r\n
55 received frame(size=21; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
56 s> 8\r\n
57 s> \x00\x00\x00\x01\x00\x02\x002
58 s> \r\n
51 s> 0\r\n
59 s> 0\r\n
52 s> \r\n
60 s> \r\n
61 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
53 response: b'Bk\xad\xa5\xc6u\x98\xcae\x03mW\xd9\xe4\xb6K\x0c\x1c\xe7\xa0'
62 response: b'Bk\xad\xa5\xc6u\x98\xcae\x03mW\xd9\xe4\xb6K\x0c\x1c\xe7\xa0'
54
63
55 $ cat error.log
64 $ cat error.log
@@ -46,13 +46,22 b' pushkey for a bookmark works'
46 s> Content-Type: application/mercurial-exp-framing-0005\r\n
46 s> Content-Type: application/mercurial-exp-framing-0005\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> 14\r\n
49 s> 13\r\n
50 s> \x0c\x00\x00\x01\x00\x02\x012
50 s> \x0b\x00\x00\x01\x00\x02\x011
51 s> \xa1FstatusBok\xf5
51 s> \xa1FstatusBok
52 s> \r\n
52 s> \r\n
53 received frame(size=12; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos)
53 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
54 s> 9\r\n
55 s> \x01\x00\x00\x01\x00\x02\x001
56 s> \xf5
57 s> \r\n
58 received frame(size=1; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
59 s> 8\r\n
60 s> \x00\x00\x00\x01\x00\x02\x002
61 s> \r\n
54 s> 0\r\n
62 s> 0\r\n
55 s> \r\n
63 s> \r\n
64 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
56 response: True
65 response: True
57
66
58 $ sendhttpv2peer << EOF
67 $ sendhttpv2peer << EOF
@@ -77,13 +86,22 b' pushkey for a bookmark works'
77 s> Content-Type: application/mercurial-exp-framing-0005\r\n
86 s> Content-Type: application/mercurial-exp-framing-0005\r\n
78 s> Transfer-Encoding: chunked\r\n
87 s> Transfer-Encoding: chunked\r\n
79 s> \r\n
88 s> \r\n
80 s> 40\r\n
89 s> 13\r\n
81 s> 8\x00\x00\x01\x00\x02\x012
90 s> \x0b\x00\x00\x01\x00\x02\x011
82 s> \xa1FstatusBok\xa1A@X(426bada5c67598ca65036d57d9e4b64b0c1ce7a0
91 s> \xa1FstatusBok
83 s> \r\n
92 s> \r\n
84 received frame(size=56; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos)
93 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
94 s> 35\r\n
95 s> -\x00\x00\x01\x00\x02\x001
96 s> \xa1A@X(426bada5c67598ca65036d57d9e4b64b0c1ce7a0
97 s> \r\n
98 received frame(size=45; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
99 s> 8\r\n
100 s> \x00\x00\x00\x01\x00\x02\x002
101 s> \r\n
85 s> 0\r\n
102 s> 0\r\n
86 s> \r\n
103 s> \r\n
104 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
87 response: {
105 response: {
88 b'@': b'426bada5c67598ca65036d57d9e4b64b0c1ce7a0'
106 b'@': b'426bada5c67598ca65036d57d9e4b64b0c1ce7a0'
89 }
107 }
@@ -26,7 +26,7 b' def customreadonlyv1(repo, proto):'
26
26
27 @wireprotov2server.wireprotocommand(b'customreadonly', permission=b'pull')
27 @wireprotov2server.wireprotocommand(b'customreadonly', permission=b'pull')
28 def customreadonlyv2(repo, proto):
28 def customreadonlyv2(repo, proto):
29 return wireprototypes.cborresponse(b'customreadonly bytes response')
29 yield b'customreadonly bytes response'
30
30
31 @wireprotov1server.wireprotocommand(b'customreadwrite', permission=b'push')
31 @wireprotov1server.wireprotocommand(b'customreadwrite', permission=b'push')
32 def customreadwrite(repo, proto):
32 def customreadwrite(repo, proto):
@@ -34,7 +34,7 b' def customreadwrite(repo, proto):'
34
34
35 @wireprotov2server.wireprotocommand(b'customreadwrite', permission=b'push')
35 @wireprotov2server.wireprotocommand(b'customreadwrite', permission=b'push')
36 def customreadwritev2(repo, proto):
36 def customreadwritev2(repo, proto):
37 return wireprototypes.cborresponse(b'customreadwrite bytes response')
37 yield b'customreadwrite bytes response'
38 EOF
38 EOF
39
39
40 cat >> $HGRCPATH << EOF
40 cat >> $HGRCPATH << EOF
General Comments 0
You need to be logged in to leave comments. Login now