14 } |
14 } |
15 |
15 |
16 cat > dummycommands.py << EOF |
16 cat > dummycommands.py << EOF |
17 from mercurial import ( |
17 from mercurial import ( |
18 wireprototypes, |
18 wireprototypes, |
|
19 wireprotov1server, |
19 wireprotov2server, |
20 wireprotov2server, |
20 wireproto, |
|
21 ) |
21 ) |
22 |
22 |
23 @wireproto.wireprotocommand('customreadonly', permission='pull') |
23 @wireprotov1server.wireprotocommand('customreadonly', permission='pull') |
24 def customreadonlyv1(repo, proto): |
24 def customreadonlyv1(repo, proto): |
25 return wireprototypes.bytesresponse(b'customreadonly bytes response') |
25 return wireprototypes.bytesresponse(b'customreadonly bytes response') |
26 |
26 |
27 @wireprotov2server.wireprotocommand('customreadonly', permission='pull') |
27 @wireprotov2server.wireprotocommand('customreadonly', permission='pull') |
28 def customreadonlyv2(repo, proto): |
28 def customreadonlyv2(repo, proto): |
29 return wireprototypes.cborresponse(b'customreadonly bytes response') |
29 return wireprototypes.cborresponse(b'customreadonly bytes response') |
30 |
30 |
31 @wireproto.wireprotocommand('customreadwrite', permission='push') |
31 @wireprotov1server.wireprotocommand('customreadwrite', permission='push') |
32 def customreadwrite(repo, proto): |
32 def customreadwrite(repo, proto): |
33 return wireprototypes.bytesresponse(b'customreadwrite bytes response') |
33 return wireprototypes.bytesresponse(b'customreadwrite bytes response') |
34 |
34 |
35 @wireprotov2server.wireprotocommand('customreadwrite', permission='push') |
35 @wireprotov2server.wireprotocommand('customreadwrite', permission='push') |
36 def customreadwritev2(repo, proto): |
36 def customreadwritev2(repo, proto): |