Show More
@@ -311,6 +311,10 b' def _httpv2runcommand(ui, repo, req, res' | |||
|
311 | 311 | action, meta = reactor.oncommandresponsereadyobjects( |
|
312 | 312 | outstream, command['requestid'], objs) |
|
313 | 313 | |
|
314 | except error.WireprotoCommandError as e: | |
|
315 | action, meta = reactor.oncommanderror( | |
|
316 | outstream, command['requestid'], e.message, e.messageargs) | |
|
317 | ||
|
314 | 318 | except Exception as e: |
|
315 | 319 | action, meta = reactor.onservererror( |
|
316 | 320 | outstream, command['requestid'], |
@@ -348,13 +352,39 b' class httpv2protocolhandler(object):' | |||
|
348 | 352 | return HTTP_WIREPROTO_V2 |
|
349 | 353 | |
|
350 | 354 | def getargs(self, args): |
|
355 | # First look for args that were passed but aren't registered on this | |
|
356 | # command. | |
|
357 | extra = set(self._args) - set(args) | |
|
358 | if extra: | |
|
359 | raise error.WireprotoCommandError( | |
|
360 | 'unsupported argument to command: %s' % | |
|
361 | ', '.join(sorted(extra))) | |
|
362 | ||
|
363 | # And look for required arguments that are missing. | |
|
364 | missing = {a for a in args if args[a]['required']} - set(self._args) | |
|
365 | ||
|
366 | if missing: | |
|
367 | raise error.WireprotoCommandError( | |
|
368 | 'missing required arguments: %s' % ', '.join(sorted(missing))) | |
|
369 | ||
|
370 | # Now derive the arguments to pass to the command, taking into | |
|
371 | # account the arguments specified by the client. | |
|
351 | 372 | data = {} |
|
352 |
for k, |
|
|
353 | if k == '*': | |
|
354 | raise NotImplementedError('do not support * args') | |
|
355 | elif k in self._args: | |
|
356 |
|
|
|
357 | data[k] = self._args[k] | |
|
373 | for k, meta in sorted(args.items()): | |
|
374 | # This argument wasn't passed by the client. | |
|
375 | if k not in self._args: | |
|
376 | data[k] = meta['default']() | |
|
377 | continue | |
|
378 | ||
|
379 | v = self._args[k] | |
|
380 | ||
|
381 | # Sets may be expressed as lists. Silently normalize. | |
|
382 | if meta['type'] == 'set' and isinstance(v, list): | |
|
383 | v = set(v) | |
|
384 | ||
|
385 | # TODO consider more/stronger type validation. | |
|
386 | ||
|
387 | data[k] = v | |
|
358 | 388 | |
|
359 | 389 | return data |
|
360 | 390 | |
@@ -404,8 +434,10 b' def _capabilitiesv2(repo, proto):' | |||
|
404 | 434 | # TODO expose available changesetdata fields. |
|
405 | 435 | |
|
406 | 436 | for command, entry in COMMANDS.items(): |
|
437 | args = {arg: meta['example'] for arg, meta in entry.args.items()} | |
|
438 | ||
|
407 | 439 | caps['commands'][command] = { |
|
408 |
'args': |
|
|
440 | 'args': args, | |
|
409 | 441 | 'permissions': [entry.permission], |
|
410 | 442 | } |
|
411 | 443 | |
@@ -500,7 +532,23 b' def wireprotocommand(name, args=None, pe' | |||
|
500 | 532 | |
|
501 | 533 | ``name`` is the name of the wire protocol command being provided. |
|
502 | 534 | |
|
503 |
``args`` is a dict |
|
|
535 | ``args`` is a dict defining arguments accepted by the command. Keys are | |
|
536 | the argument name. Values are dicts with the following keys: | |
|
537 | ||
|
538 | ``type`` | |
|
539 | The argument data type. Must be one of the following string | |
|
540 | literals: ``bytes``, ``int``, ``list``, ``dict``, ``set``, | |
|
541 | or ``bool``. | |
|
542 | ||
|
543 | ``default`` | |
|
544 | A callable returning the default value for this argument. If not | |
|
545 | specified, ``None`` will be the default value. | |
|
546 | ||
|
547 | ``required`` | |
|
548 | Bool indicating whether the argument is required. | |
|
549 | ||
|
550 | ``example`` | |
|
551 | An example value for this argument. | |
|
504 | 552 | |
|
505 | 553 | ``permission`` defines the permission type needed to run this command. |
|
506 | 554 | Can be ``push`` or ``pull``. These roughly map to read-write and read-only, |
@@ -529,6 +577,36 b' def wireprotocommand(name, args=None, pe' | |||
|
529 | 577 | raise error.ProgrammingError('arguments for version 2 commands ' |
|
530 | 578 | 'must be declared as dicts') |
|
531 | 579 | |
|
580 | for arg, meta in args.items(): | |
|
581 | if arg == '*': | |
|
582 | raise error.ProgrammingError('* argument name not allowed on ' | |
|
583 | 'version 2 commands') | |
|
584 | ||
|
585 | if not isinstance(meta, dict): | |
|
586 | raise error.ProgrammingError('arguments for version 2 commands ' | |
|
587 | 'must declare metadata as a dict') | |
|
588 | ||
|
589 | if 'type' not in meta: | |
|
590 | raise error.ProgrammingError('%s argument for command %s does not ' | |
|
591 | 'declare type field' % (arg, name)) | |
|
592 | ||
|
593 | if meta['type'] not in ('bytes', 'int', 'list', 'dict', 'set', 'bool'): | |
|
594 | raise error.ProgrammingError('%s argument for command %s has ' | |
|
595 | 'illegal type: %s' % (arg, name, | |
|
596 | meta['type'])) | |
|
597 | ||
|
598 | if 'example' not in meta: | |
|
599 | raise error.ProgrammingError('%s argument for command %s does not ' | |
|
600 | 'declare example field' % (arg, name)) | |
|
601 | ||
|
602 | if 'default' in meta and meta.get('required'): | |
|
603 | raise error.ProgrammingError('%s argument for command %s is marked ' | |
|
604 | 'as required but has a default value' % | |
|
605 | (arg, name)) | |
|
606 | ||
|
607 | meta.setdefault('default', lambda: None) | |
|
608 | meta.setdefault('required', False) | |
|
609 | ||
|
532 | 610 | def register(func): |
|
533 | 611 | if name in COMMANDS: |
|
534 | 612 | raise error.ProgrammingError('%s command already registered ' |
@@ -550,16 +628,25 b' def branchmapv2(repo, proto):' | |||
|
550 | 628 | def capabilitiesv2(repo, proto): |
|
551 | 629 | yield _capabilitiesv2(repo, proto) |
|
552 | 630 | |
|
553 |
@wireprotocommand( |
|
|
554 | args={ | |
|
555 | 'noderange': [[b'0123456...'], [b'abcdef...']], | |
|
556 | 'nodes': [b'0123456...'], | |
|
557 | 'fields': {b'parents', b'revision'}, | |
|
558 | }, | |
|
559 | permission='pull') | |
|
560 | def changesetdata(repo, proto, noderange=None, nodes=None, fields=None): | |
|
561 | fields = fields or set() | |
|
562 | ||
|
631 | @wireprotocommand( | |
|
632 | 'changesetdata', | |
|
633 | args={ | |
|
634 | 'noderange': { | |
|
635 | 'type': 'list', | |
|
636 | 'example': [[b'0123456...'], [b'abcdef...']], | |
|
637 | }, | |
|
638 | 'nodes': { | |
|
639 | 'type': 'list', | |
|
640 | 'example': [b'0123456...'], | |
|
641 | }, | |
|
642 | 'fields': { | |
|
643 | 'type': 'set', | |
|
644 | 'default': set, | |
|
645 | 'example': {b'parents', b'revision'}, | |
|
646 | }, | |
|
647 | }, | |
|
648 | permission='pull') | |
|
649 | def changesetdata(repo, proto, noderange, nodes, fields): | |
|
563 | 650 | # TODO look for unknown fields and abort when they can't be serviced. |
|
564 | 651 | |
|
565 | 652 | if noderange is None and nodes is None: |
@@ -691,24 +778,32 b' def getfilestore(repo, proto, path):' | |||
|
691 | 778 | |
|
692 | 779 | return fl |
|
693 | 780 | |
|
694 |
@wireprotocommand( |
|
|
695 | args={ | |
|
696 | 'haveparents': True, | |
|
697 | 'nodes': [b'0123456...'], | |
|
698 | 'fields': [b'parents', b'revision'], | |
|
699 | 'path': b'foo.txt', | |
|
700 | }, | |
|
701 | permission='pull') | |
|
702 | def filedata(repo, proto, haveparents=False, nodes=None, fields=None, | |
|
703 | path=None): | |
|
704 | fields = fields or set() | |
|
705 | ||
|
706 | if nodes is None: | |
|
707 | raise error.WireprotoCommandError('nodes argument must be defined') | |
|
708 | ||
|
709 | if path is None: | |
|
710 | raise error.WireprotoCommandError('path argument must be defined') | |
|
711 | ||
|
781 | @wireprotocommand( | |
|
782 | 'filedata', | |
|
783 | args={ | |
|
784 | 'haveparents': { | |
|
785 | 'type': 'bool', | |
|
786 | 'default': lambda: False, | |
|
787 | 'example': True, | |
|
788 | }, | |
|
789 | 'nodes': { | |
|
790 | 'type': 'list', | |
|
791 | 'required': True, | |
|
792 | 'example': [b'0123456...'], | |
|
793 | }, | |
|
794 | 'fields': { | |
|
795 | 'type': 'set', | |
|
796 | 'default': set, | |
|
797 | 'example': {b'parents', b'revision'}, | |
|
798 | }, | |
|
799 | 'path': { | |
|
800 | 'type': 'bytes', | |
|
801 | 'required': True, | |
|
802 | 'example': b'foo.txt', | |
|
803 | } | |
|
804 | }, | |
|
805 | permission='pull') | |
|
806 | def filedata(repo, proto, haveparents, nodes, fields, path): | |
|
712 | 807 | try: |
|
713 | 808 | # Extensions may wish to access the protocol handler. |
|
714 | 809 | store = getfilestore(repo, proto, path) |
@@ -776,44 +871,63 b' def filedata(repo, proto, haveparents=Fa' | |||
|
776 | 871 | except GeneratorExit: |
|
777 | 872 | pass |
|
778 | 873 | |
|
779 |
@wireprotocommand( |
|
|
780 | args={ | |
|
781 | 'publiconly': False, | |
|
782 | }, | |
|
783 | permission='pull') | |
|
784 | def headsv2(repo, proto, publiconly=False): | |
|
874 | @wireprotocommand( | |
|
875 | 'heads', | |
|
876 | args={ | |
|
877 | 'publiconly': { | |
|
878 | 'type': 'bool', | |
|
879 | 'default': lambda: False, | |
|
880 | 'example': False, | |
|
881 | }, | |
|
882 | }, | |
|
883 | permission='pull') | |
|
884 | def headsv2(repo, proto, publiconly): | |
|
785 | 885 | if publiconly: |
|
786 | 886 | repo = repo.filtered('immutable') |
|
787 | 887 | |
|
788 | 888 | yield repo.heads() |
|
789 | 889 | |
|
790 |
@wireprotocommand( |
|
|
791 | args={ | |
|
792 | 'nodes': [b'deadbeef'], | |
|
793 | }, | |
|
794 | permission='pull') | |
|
795 | def knownv2(repo, proto, nodes=None): | |
|
796 | nodes = nodes or [] | |
|
890 | @wireprotocommand( | |
|
891 | 'known', | |
|
892 | args={ | |
|
893 | 'nodes': { | |
|
894 | 'type': 'list', | |
|
895 | 'default': list, | |
|
896 | 'example': [b'deadbeef'], | |
|
897 | }, | |
|
898 | }, | |
|
899 | permission='pull') | |
|
900 | def knownv2(repo, proto, nodes): | |
|
797 | 901 | result = b''.join(b'1' if n else b'0' for n in repo.known(nodes)) |
|
798 | 902 | yield result |
|
799 | 903 | |
|
800 |
@wireprotocommand( |
|
|
801 | args={ | |
|
802 | 'namespace': b'ns', | |
|
803 | }, | |
|
804 | permission='pull') | |
|
805 | def listkeysv2(repo, proto, namespace=None): | |
|
904 | @wireprotocommand( | |
|
905 | 'listkeys', | |
|
906 | args={ | |
|
907 | 'namespace': { | |
|
908 | 'type': 'bytes', | |
|
909 | 'required': True, | |
|
910 | 'example': b'ns', | |
|
911 | }, | |
|
912 | }, | |
|
913 | permission='pull') | |
|
914 | def listkeysv2(repo, proto, namespace): | |
|
806 | 915 | keys = repo.listkeys(encoding.tolocal(namespace)) |
|
807 | 916 | keys = {encoding.fromlocal(k): encoding.fromlocal(v) |
|
808 | 917 | for k, v in keys.iteritems()} |
|
809 | 918 | |
|
810 | 919 | yield keys |
|
811 | 920 | |
|
812 |
@wireprotocommand( |
|
|
813 | args={ | |
|
814 | 'key': b'foo', | |
|
815 | }, | |
|
816 | permission='pull') | |
|
921 | @wireprotocommand( | |
|
922 | 'lookup', | |
|
923 | args={ | |
|
924 | 'key': { | |
|
925 | 'type': 'bytes', | |
|
926 | 'required': True, | |
|
927 | 'example': b'foo', | |
|
928 | }, | |
|
929 | }, | |
|
930 | permission='pull') | |
|
817 | 931 | def lookupv2(repo, proto, key): |
|
818 | 932 | key = encoding.tolocal(key) |
|
819 | 933 | |
@@ -822,26 +936,32 b' def lookupv2(repo, proto, key):' | |||
|
822 | 936 | |
|
823 | 937 | yield node |
|
824 | 938 | |
|
825 |
@wireprotocommand( |
|
|
826 | args={ | |
|
827 | 'nodes': [b'0123456...'], | |
|
828 | 'haveparents': True, | |
|
829 | 'fields': [b'parents', b'revision'], | |
|
830 |
|
|
|
831 | }, | |
|
832 | permission='pull') | |
|
833 | def manifestdata(repo, proto, haveparents=False, nodes=None, fields=None, | |
|
834 | tree=None): | |
|
835 | fields = fields or set() | |
|
836 | ||
|
837 | if nodes is None: | |
|
838 | raise error.WireprotoCommandError( | |
|
839 | 'nodes argument must be defined') | |
|
840 | ||
|
841 | if tree is None: | |
|
842 | raise error.WireprotoCommandError( | |
|
843 | 'tree argument must be defined') | |
|
844 | ||
|
939 | @wireprotocommand( | |
|
940 | 'manifestdata', | |
|
941 | args={ | |
|
942 | 'nodes': { | |
|
943 | 'type': 'list', | |
|
944 | 'required': True, | |
|
945 | 'example': [b'0123456...'], | |
|
946 | }, | |
|
947 | 'haveparents': { | |
|
948 | 'type': 'bool', | |
|
949 | 'default': lambda: False, | |
|
950 | 'example': True, | |
|
951 | }, | |
|
952 | 'fields': { | |
|
953 | 'type': 'set', | |
|
954 | 'default': set, | |
|
955 | 'example': {b'parents', b'revision'}, | |
|
956 | }, | |
|
957 | 'tree': { | |
|
958 | 'type': 'bytes', | |
|
959 | 'required': True, | |
|
960 | 'example': b'', | |
|
961 | }, | |
|
962 | }, | |
|
963 | permission='pull') | |
|
964 | def manifestdata(repo, proto, haveparents, nodes, fields, tree): | |
|
845 | 965 | store = repo.manifestlog.getstorage(tree) |
|
846 | 966 | |
|
847 | 967 | # Validate the node is known and abort on unknown revisions. |
@@ -905,14 +1025,31 b' def manifestdata(repo, proto, haveparent' | |||
|
905 | 1025 | except GeneratorExit: |
|
906 | 1026 | pass |
|
907 | 1027 | |
|
908 |
@wireprotocommand( |
|
|
909 | args={ | |
|
910 | 'namespace': b'ns', | |
|
911 | 'key': b'key', | |
|
912 | 'old': b'old', | |
|
913 | 'new': b'new', | |
|
914 | }, | |
|
915 | permission='push') | |
|
1028 | @wireprotocommand( | |
|
1029 | 'pushkey', | |
|
1030 | args={ | |
|
1031 | 'namespace': { | |
|
1032 | 'type': 'bytes', | |
|
1033 | 'required': True, | |
|
1034 | 'example': b'ns', | |
|
1035 | }, | |
|
1036 | 'key': { | |
|
1037 | 'type': 'bytes', | |
|
1038 | 'required': True, | |
|
1039 | 'example': b'key', | |
|
1040 | }, | |
|
1041 | 'old': { | |
|
1042 | 'type': 'bytes', | |
|
1043 | 'required': True, | |
|
1044 | 'example': b'old', | |
|
1045 | }, | |
|
1046 | 'new': { | |
|
1047 | 'type': 'bytes', | |
|
1048 | 'required': True, | |
|
1049 | 'example': 'new', | |
|
1050 | }, | |
|
1051 | }, | |
|
1052 | permission='push') | |
|
916 | 1053 | def pushkeyv2(repo, proto, namespace, key, old, new): |
|
917 | 1054 | # TODO handle ui output redirection |
|
918 | 1055 | yield repo.pushkey(encoding.tolocal(namespace), |
@@ -313,7 +313,7 b' Client with HTTPv2 enabled automatically' | |||
|
313 | 313 | s> Content-Type: application/mercurial-cbor\r\n |
|
314 | 314 | s> Content-Length: *\r\n (glob) |
|
315 | 315 | s> \r\n |
|
316 | s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...Dtree@Kpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyInamespaceBnsCnewCnewColdColdKpermissions\x81DpushKcompression\x81\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0005Nrawrepoformats\x82LgeneraldeltaHrevlogv1Nv1capabilitiesY\x01\xd3batch branchmap $USUAL_BUNDLE2_CAPS$ 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 | |
|
316 | s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa4Ffields\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...Dtree@Kpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyInamespaceBnsCnewCnewColdColdKpermissions\x81DpushKcompression\x81\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0005Nrawrepoformats\x82LgeneraldeltaHrevlogv1Nv1capabilitiesY\x01\xd3batch branchmap $USUAL_BUNDLE2_CAPS$ 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 | |
|
317 | 317 | sending heads command |
|
318 | 318 | s> POST /api/exp-http-v2-0001/ro/heads HTTP/1.1\r\n |
|
319 | 319 | s> Accept-Encoding: identity\r\n |
@@ -212,7 +212,7 b' Request for HTTPv2 service returns infor' | |||
|
212 | 212 | s> Content-Type: application/mercurial-cbor\r\n |
|
213 | 213 | s> Content-Length: *\r\n (glob) |
|
214 | 214 | s> \r\n |
|
215 | s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...Dtree@Kpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyInamespaceBnsCnewCnewColdColdKpermissions\x81DpushKcompression\x81\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0005Nrawrepoformats\x82LgeneraldeltaHrevlogv1Nv1capabilitiesY\x01\xd3batch branchmap $USUAL_BUNDLE2_CAPS$ 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 | |
|
215 | s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa4Ffields\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...Dtree@Kpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyInamespaceBnsCnewCnewColdColdKpermissions\x81DpushKcompression\x81\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0005Nrawrepoformats\x82LgeneraldeltaHrevlogv1Nv1capabilitiesY\x01\xd3batch branchmap $USUAL_BUNDLE2_CAPS$ 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 | |
|
216 | 216 | cbor> { |
|
217 | 217 | b'apibase': b'api/', |
|
218 | 218 | b'apis': { |
@@ -254,10 +254,10 b' Request for HTTPv2 service returns infor' | |||
|
254 | 254 | }, |
|
255 | 255 | b'filedata': { |
|
256 | 256 | b'args': { |
|
257 | b'fields': [ | |
|
257 | b'fields': set([ | |
|
258 | 258 | b'parents', |
|
259 | 259 | b'revision' |
|
260 | ], | |
|
260 | ]), | |
|
261 | 261 | b'haveparents': True, |
|
262 | 262 | b'nodes': [ |
|
263 | 263 | b'0123456...' |
@@ -304,10 +304,10 b' Request for HTTPv2 service returns infor' | |||
|
304 | 304 | }, |
|
305 | 305 | b'manifestdata': { |
|
306 | 306 | b'args': { |
|
307 | b'fields': [ | |
|
307 | b'fields': set([ | |
|
308 | 308 | b'parents', |
|
309 | 309 | b'revision' |
|
310 | ], | |
|
310 | ]), | |
|
311 | 311 | b'haveparents': True, |
|
312 | 312 | b'nodes': [ |
|
313 | 313 | b'0123456...' |
@@ -369,7 +369,7 b' capabilities command returns expected in' | |||
|
369 | 369 | s> Content-Type: application/mercurial-cbor\r\n |
|
370 | 370 | s> Content-Length: *\r\n (glob) |
|
371 | 371 | s> \r\n |
|
372 | s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...Dtree@Kpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyInamespaceBnsCnewCnewColdColdKpermissions\x81DpushKcompression\x81\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0005Nrawrepoformats\x82LgeneraldeltaHrevlogv1Nv1capabilitiesY\x01\xd3batch branchmap $USUAL_BUNDLE2_CAPS$ 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 | |
|
372 | s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa4Ffields\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...Dtree@Kpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyInamespaceBnsCnewCnewColdColdKpermissions\x81DpushKcompression\x81\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0005Nrawrepoformats\x82LgeneraldeltaHrevlogv1Nv1capabilitiesY\x01\xd3batch branchmap $USUAL_BUNDLE2_CAPS$ 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 | |
|
373 | 373 | sending capabilities command |
|
374 | 374 | s> POST /api/exp-http-v2-0001/ro/capabilities HTTP/1.1\r\n |
|
375 | 375 | s> Accept-Encoding: identity\r\n |
@@ -392,11 +392,11 b' capabilities command returns expected in' | |||
|
392 | 392 | s> \xa1FstatusBok |
|
393 | 393 | s> \r\n |
|
394 | 394 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) |
|
395 |
s> 3 |
|
|
396 |
s> \x0 |
|
|
397 | s> \xa4Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...Dtree@Kpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyInamespaceBnsCnewCnewColdColdKpermissions\x81DpushKcompression\x81\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0005Nrawrepoformats\x82LgeneraldeltaHrevlogv1 | |
|
395 | s> 314\r\n | |
|
396 | s> \x0c\x03\x00\x01\x00\x02\x001 | |
|
397 | s> \xa4Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa4Ffields\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...Dtree@Kpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyInamespaceBnsCnewCnewColdColdKpermissions\x81DpushKcompression\x81\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0005Nrawrepoformats\x82LgeneraldeltaHrevlogv1 | |
|
398 | 398 | s> \r\n |
|
399 |
received frame(size=7 |
|
|
399 | received frame(size=780; request=1; stream=2; streamflags=; type=command-response; flags=continuation) | |
|
400 | 400 | s> 8\r\n |
|
401 | 401 | s> \x00\x00\x00\x01\x00\x02\x002 |
|
402 | 402 | s> \r\n |
@@ -442,10 +442,10 b' capabilities command returns expected in' | |||
|
442 | 442 | }, |
|
443 | 443 | b'filedata': { |
|
444 | 444 | b'args': { |
|
445 | b'fields': [ | |
|
445 | b'fields': set([ | |
|
446 | 446 | b'parents', |
|
447 | 447 | b'revision' |
|
448 | ], | |
|
448 | ]), | |
|
449 | 449 | b'haveparents': True, |
|
450 | 450 | b'nodes': [ |
|
451 | 451 | b'0123456...' |
@@ -492,10 +492,10 b' capabilities command returns expected in' | |||
|
492 | 492 | }, |
|
493 | 493 | b'manifestdata': { |
|
494 | 494 | b'args': { |
|
495 | b'fields': [ | |
|
495 | b'fields': set([ | |
|
496 | 496 | b'parents', |
|
497 | 497 | b'revision' |
|
498 | ], | |
|
498 | ]), | |
|
499 | 499 | b'haveparents': True, |
|
500 | 500 | b'nodes': [ |
|
501 | 501 | b'0123456...' |
@@ -69,14 +69,14 b' Missing arguments is an error' | |||
|
69 | 69 | s> Content-Type: application/mercurial-exp-framing-0005\r\n |
|
70 | 70 | s> Transfer-Encoding: chunked\r\n |
|
71 | 71 | s> \r\n |
|
72 |
s> 4 |
|
|
73 |
s> |
|
|
74 |
s> \xa2Eerror\xa1GmessageX\ |
|
|
72 | s> 4e\r\n | |
|
73 | s> F\x00\x00\x01\x00\x02\x012 | |
|
74 | s> \xa2Eerror\xa1GmessageX\'missing required arguments: nodes, pathFstatusEerror | |
|
75 | 75 |
|
|
76 |
received frame(size= |
|
|
76 | received frame(size=70; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) | |
|
77 | 77 |
|
|
78 | 78 |
|
|
79 | abort: nodes argument must be defined! | |
|
79 | abort: missing required arguments: nodes, path! | |
|
80 | 80 | [255] |
|
81 | 81 | |
|
82 | 82 | $ sendhttpv2peer << EOF |
@@ -101,14 +101,14 b' Missing arguments is an error' | |||
|
101 | 101 | s> Content-Type: application/mercurial-exp-framing-0005\r\n |
|
102 | 102 | s> Transfer-Encoding: chunked\r\n |
|
103 | 103 | s> \r\n |
|
104 |
s> 4 |
|
|
105 |
s> |
|
|
106 |
s> \xa2Eerror\xa1GmessageX |
|
|
104 | s> 47\r\n | |
|
105 | s> ?\x00\x00\x01\x00\x02\x012 | |
|
106 | s> \xa2Eerror\xa1GmessageX missing required arguments: pathFstatusEerror | |
|
107 | 107 | s> \r\n |
|
108 |
received frame(size=6 |
|
|
108 | received frame(size=63; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) | |
|
109 | 109 | s> 0\r\n |
|
110 | 110 | s> \r\n |
|
111 | abort: path argument must be defined! | |
|
111 | abort: missing required arguments: path! | |
|
112 | 112 | [255] |
|
113 | 113 | |
|
114 | 114 | Unknown node is an error |
@@ -65,14 +65,14 b' Missing arguments is an error' | |||
|
65 | 65 | s> Content-Type: application/mercurial-exp-framing-0005\r\n |
|
66 | 66 | s> Transfer-Encoding: chunked\r\n |
|
67 | 67 | s> \r\n |
|
68 |
s> 4 |
|
|
69 |
s> |
|
|
70 |
s> \xa2Eerror\xa1GmessageX\ |
|
|
68 | s> 4e\r\n | |
|
69 | s> F\x00\x00\x01\x00\x02\x012 | |
|
70 | s> \xa2Eerror\xa1GmessageX\'missing required arguments: nodes, treeFstatusEerror | |
|
71 | 71 |
|
|
72 |
received frame(size= |
|
|
72 | received frame(size=70; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) | |
|
73 | 73 |
|
|
74 | 74 |
|
|
75 | abort: nodes argument must be defined! | |
|
75 | abort: missing required arguments: nodes, tree! | |
|
76 | 76 | [255] |
|
77 | 77 | |
|
78 | 78 | $ sendhttpv2peer << EOF |
@@ -97,14 +97,14 b' Missing arguments is an error' | |||
|
97 | 97 | s> Content-Type: application/mercurial-exp-framing-0005\r\n |
|
98 | 98 | s> Transfer-Encoding: chunked\r\n |
|
99 | 99 | s> \r\n |
|
100 |
s> 4 |
|
|
101 |
s> |
|
|
102 |
s> \xa2Eerror\xa1GmessageX |
|
|
100 | s> 47\r\n | |
|
101 | s> ?\x00\x00\x01\x00\x02\x012 | |
|
102 | s> \xa2Eerror\xa1GmessageX missing required arguments: treeFstatusEerror | |
|
103 | 103 | s> \r\n |
|
104 |
received frame(size=6 |
|
|
104 | received frame(size=63; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) | |
|
105 | 105 | s> 0\r\n |
|
106 | 106 | s> \r\n |
|
107 |
abort: tree |
|
|
107 | abort: missing required arguments: tree! | |
|
108 | 108 | [255] |
|
109 | 109 | |
|
110 | 110 | Unknown node is an error |
General Comments 0
You need to be logged in to leave comments.
Login now