##// END OF EJS Templates
wireproto: make @wireprotocommand version 1 only by default...
Gregory Szorc -
r37558:693cb376 default
parent child Browse files
Show More
@@ -707,7 +707,7 b' commands = commanddict()'
707 # For version 2 transports.
707 # For version 2 transports.
708 commandsv2 = commanddict()
708 commandsv2 = commanddict()
709
709
710 def wireprotocommand(name, args='', transportpolicy=POLICY_ALL,
710 def wireprotocommand(name, args='', transportpolicy=POLICY_V1_ONLY,
711 permission='push'):
711 permission='push'):
712 """Decorator to declare a wire protocol command.
712 """Decorator to declare a wire protocol command.
713
713
@@ -16,12 +16,22 b' from mercurial import ('
16 )
16 )
17
17
18 @wireproto.wireprotocommand('customreadonly', permission='pull')
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 return wireprototypes.bytesresponse(b'customreadonly bytes response')
25 return wireprototypes.bytesresponse(b'customreadonly bytes response')
21
26
22 @wireproto.wireprotocommand('customreadwrite', permission='push')
27 @wireproto.wireprotocommand('customreadwrite', permission='push')
23 def customreadwrite(repo, proto):
28 def customreadwrite(repo, proto):
24 return wireprototypes.bytesresponse(b'customreadwrite bytes response')
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 EOF
35 EOF
26
36
27 cat >> $HGRCPATH << EOF
37 cat >> $HGRCPATH << EOF
General Comments 0
You need to be logged in to leave comments. Login now