Show More
@@ -707,7 +707,7 b' commands = commanddict()' | |||
|
707 | 707 | # For version 2 transports. |
|
708 | 708 | commandsv2 = commanddict() |
|
709 | 709 | |
|
710 |
def wireprotocommand(name, args='', transportpolicy=POLICY_ |
|
|
710 | def wireprotocommand(name, args='', transportpolicy=POLICY_V1_ONLY, | |
|
711 | 711 | permission='push'): |
|
712 | 712 | """Decorator to declare a wire protocol command. |
|
713 | 713 |
@@ -16,12 +16,22 b' from mercurial import (' | |||
|
16 | 16 | ) |
|
17 | 17 | |
|
18 | 18 | @wireproto.wireprotocommand('customreadonly', permission='pull') |
|
19 | def customreadonly(repo, proto): | |
|
19 | def customreadonlyv1(repo, proto): | |
|
20 | return wireprototypes.bytesresponse(b'customreadonly bytes response') | |
|
21 | ||
|
22 | @wireproto.wireprotocommand('customreadonly', permission='pull', | |
|
23 | transportpolicy=wireproto.POLICY_V2_ONLY) | |
|
24 | def customreadonlyv2(repo, proto): | |
|
20 | 25 | return wireprototypes.bytesresponse(b'customreadonly bytes response') |
|
21 | 26 | |
|
22 | 27 | @wireproto.wireprotocommand('customreadwrite', permission='push') |
|
23 | 28 | def customreadwrite(repo, proto): |
|
24 | 29 | return wireprototypes.bytesresponse(b'customreadwrite bytes response') |
|
30 | ||
|
31 | @wireproto.wireprotocommand('customreadwrite', permission='push', | |
|
32 | transportpolicy=wireproto.POLICY_V2_ONLY) | |
|
33 | def customreadwritev2(repo, proto): | |
|
34 | return wireprototypes.bytesresponse(b'customreadwrite bytes response') | |
|
25 | 35 | EOF |
|
26 | 36 | |
|
27 | 37 | cat >> $HGRCPATH << EOF |
General Comments 0
You need to be logged in to leave comments.
Login now