Show More
@@ -477,9 +477,6 def wireprotocommand(name, args=None, pe | |||
|
477 | 477 | A callable returning the default value for this argument. If not |
|
478 | 478 | specified, ``None`` will be the default value. |
|
479 | 479 | |
|
480 | ``required`` | |
|
481 | Bool indicating whether the argument is required. | |
|
482 | ||
|
483 | 480 | ``example`` |
|
484 | 481 | An example value for this argument. |
|
485 | 482 | |
@@ -535,13 +532,9 def wireprotocommand(name, args=None, pe | |||
|
535 | 532 | raise error.ProgrammingError('%s argument for command %s does not ' |
|
536 | 533 | 'declare example field' % (arg, name)) |
|
537 | 534 | |
|
538 | if 'default' in meta and meta.get('required'): | |
|
539 | raise error.ProgrammingError('%s argument for command %s is marked ' | |
|
540 | 'as required but has a default value' % | |
|
541 | (arg, name)) | |
|
535 | meta['required'] = 'default' not in meta | |
|
542 | 536 | |
|
543 | 537 | meta.setdefault('default', lambda: None) |
|
544 | meta.setdefault('required', False) | |
|
545 | 538 | meta.setdefault('validvalues', None) |
|
546 | 539 | |
|
547 | 540 | def register(func): |
@@ -570,14 +563,17 def capabilitiesv2(repo, proto): | |||
|
570 | 563 | args={ |
|
571 | 564 | 'noderange': { |
|
572 | 565 | 'type': 'list', |
|
566 | 'default': lambda: None, | |
|
573 | 567 | 'example': [[b'0123456...'], [b'abcdef...']], |
|
574 | 568 | }, |
|
575 | 569 | 'nodes': { |
|
576 | 570 | 'type': 'list', |
|
571 | 'default': lambda: None, | |
|
577 | 572 | 'example': [b'0123456...'], |
|
578 | 573 | }, |
|
579 | 574 | 'nodesdepth': { |
|
580 | 575 | 'type': 'int', |
|
576 | 'default': lambda: None, | |
|
581 | 577 | 'example': 10, |
|
582 | 578 | }, |
|
583 | 579 | 'fields': { |
@@ -746,7 +742,6 def getfilestore(repo, proto, path): | |||
|
746 | 742 | }, |
|
747 | 743 | 'nodes': { |
|
748 | 744 | 'type': 'list', |
|
749 | 'required': True, | |
|
750 | 745 | 'example': [b'0123456...'], |
|
751 | 746 | }, |
|
752 | 747 | 'fields': { |
@@ -757,7 +752,6 def getfilestore(repo, proto, path): | |||
|
757 | 752 | }, |
|
758 | 753 | 'path': { |
|
759 | 754 | 'type': 'bytes', |
|
760 | 'required': True, | |
|
761 | 755 | 'example': b'foo.txt', |
|
762 | 756 | } |
|
763 | 757 | }, |
@@ -848,7 +842,6 def knownv2(repo, proto, nodes): | |||
|
848 | 842 | args={ |
|
849 | 843 | 'namespace': { |
|
850 | 844 | 'type': 'bytes', |
|
851 | 'required': True, | |
|
852 | 845 | 'example': b'ns', |
|
853 | 846 | }, |
|
854 | 847 | }, |
@@ -865,7 +858,6 def listkeysv2(repo, proto, namespace): | |||
|
865 | 858 | args={ |
|
866 | 859 | 'key': { |
|
867 | 860 | 'type': 'bytes', |
|
868 | 'required': True, | |
|
869 | 861 | 'example': b'foo', |
|
870 | 862 | }, |
|
871 | 863 | }, |
@@ -883,7 +875,6 def lookupv2(repo, proto, key): | |||
|
883 | 875 | args={ |
|
884 | 876 | 'nodes': { |
|
885 | 877 | 'type': 'list', |
|
886 | 'required': True, | |
|
887 | 878 | 'example': [b'0123456...'], |
|
888 | 879 | }, |
|
889 | 880 | 'haveparents': { |
@@ -899,7 +890,6 def lookupv2(repo, proto, key): | |||
|
899 | 890 | }, |
|
900 | 891 | 'tree': { |
|
901 | 892 | 'type': 'bytes', |
|
902 | 'required': True, | |
|
903 | 893 | 'example': b'', |
|
904 | 894 | }, |
|
905 | 895 | }, |
@@ -956,22 +946,18 def manifestdata(repo, proto, haveparent | |||
|
956 | 946 | args={ |
|
957 | 947 | 'namespace': { |
|
958 | 948 | 'type': 'bytes', |
|
959 | 'required': True, | |
|
960 | 949 | 'example': b'ns', |
|
961 | 950 | }, |
|
962 | 951 | 'key': { |
|
963 | 952 | 'type': 'bytes', |
|
964 | 'required': True, | |
|
965 | 953 | 'example': b'key', |
|
966 | 954 | }, |
|
967 | 955 | 'old': { |
|
968 | 956 | 'type': 'bytes', |
|
969 | 'required': True, | |
|
970 | 957 | 'example': b'old', |
|
971 | 958 | }, |
|
972 | 959 | 'new': { |
|
973 | 960 | 'type': 'bytes', |
|
974 | 'required': True, | |
|
975 | 961 | 'example': 'new', |
|
976 | 962 | }, |
|
977 | 963 | }, |
General Comments 0
You need to be logged in to leave comments.
Login now