##// END OF EJS Templates
wireprotohelpers: add missing b prefixes...
Augie Fackler -
r39096:b3c6c194 default
parent child Browse files
Show More
@@ -1,58 +1,58
1 HTTPV2=exp-http-v2-0001
1 HTTPV2=exp-http-v2-0001
2 MEDIATYPE=application/mercurial-exp-framing-0005
2 MEDIATYPE=application/mercurial-exp-framing-0005
3
3
4 sendhttpraw() {
4 sendhttpraw() {
5 hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT/
5 hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT/
6 }
6 }
7
7
8 sendhttpv2peer() {
8 sendhttpv2peer() {
9 hg --verbose debugwireproto --nologhandshake --peer http2 http://$LOCALIP:$HGPORT/
9 hg --verbose debugwireproto --nologhandshake --peer http2 http://$LOCALIP:$HGPORT/
10 }
10 }
11
11
12 sendhttpv2peerhandshake() {
12 sendhttpv2peerhandshake() {
13 hg --verbose debugwireproto --peer http2 http://$LOCALIP:$HGPORT/
13 hg --verbose debugwireproto --peer http2 http://$LOCALIP:$HGPORT/
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 wireprotov1server,
20 wireprotov2server,
20 wireprotov2server,
21 )
21 )
22
22
23 @wireprotov1server.wireprotocommand('customreadonly', permission='pull')
23 @wireprotov1server.wireprotocommand(b'customreadonly', permission=b'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(b'customreadonly', permission=b'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 @wireprotov1server.wireprotocommand('customreadwrite', permission='push')
31 @wireprotov1server.wireprotocommand(b'customreadwrite', permission=b'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(b'customreadwrite', permission=b'push')
36 def customreadwritev2(repo, proto):
36 def customreadwritev2(repo, proto):
37 return wireprototypes.cborresponse(b'customreadwrite bytes response')
37 return wireprototypes.cborresponse(b'customreadwrite bytes response')
38 EOF
38 EOF
39
39
40 cat >> $HGRCPATH << EOF
40 cat >> $HGRCPATH << EOF
41 [extensions]
41 [extensions]
42 drawdag = $TESTDIR/drawdag.py
42 drawdag = $TESTDIR/drawdag.py
43 EOF
43 EOF
44
44
45 enabledummycommands() {
45 enabledummycommands() {
46 cat >> $HGRCPATH << EOF
46 cat >> $HGRCPATH << EOF
47 [extensions]
47 [extensions]
48 dummycommands = $TESTTMP/dummycommands.py
48 dummycommands = $TESTTMP/dummycommands.py
49 EOF
49 EOF
50 }
50 }
51
51
52 enablehttpv2() {
52 enablehttpv2() {
53 cat >> $1/.hg/hgrc << EOF
53 cat >> $1/.hg/hgrc << EOF
54 [experimental]
54 [experimental]
55 web.apiserver = true
55 web.apiserver = true
56 web.api.http-v2 = true
56 web.api.http-v2 = true
57 EOF
57 EOF
58 }
58 }
General Comments 0
You need to be logged in to leave comments. Login now