Mercurial > public > mercurial-scm > hg-stable
comparison tests/wireprotohelpers.sh @ 48561:04688c51f81f
exchangev2: remove it
As discussed on the mailing list, this is incomplete and unused with little
hope of revival.
Differential Revision: https://phab.mercurial-scm.org/D11954
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Tue, 07 Dec 2021 16:44:22 +0100 |
parents | 41263df08109 |
children |
comparison
equal
deleted
inserted
replaced
48560:d6c53b40b078 | 48561:04688c51f81f |
---|---|
1 HTTPV2=exp-http-v2-0003 | |
2 MEDIATYPE=application/mercurial-exp-framing-0006 | 1 MEDIATYPE=application/mercurial-exp-framing-0006 |
3 | 2 |
4 sendhttpraw() { | 3 sendhttpraw() { |
5 hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT/ | 4 hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT/ |
6 } | 5 } |
7 | 6 |
8 sendhttpv2peer() { | |
9 hg --config experimental.httppeer.v2-encoder-order=identity debugwireproto --nologhandshake --peer http2 http://$LOCALIP:$HGPORT/ | |
10 } | |
11 | |
12 sendhttpv2peerverbose() { | |
13 hg --config experimental.httppeer.v2-encoder-order=identity --verbose debugwireproto --nologhandshake --peer http2 http://$LOCALIP:$HGPORT/ | |
14 } | |
15 | |
16 sendhttpv2peerhandshake() { | |
17 hg --config experimental.httppeer.v2-encoder-order=identity --verbose debugwireproto --peer http2 http://$LOCALIP:$HGPORT/ | |
18 } | |
19 | |
20 cat > dummycommands.py << EOF | 7 cat > dummycommands.py << EOF |
21 from mercurial import ( | 8 from mercurial import ( |
22 wireprototypes, | 9 wireprototypes, |
23 wireprotov1server, | 10 wireprotov1server, |
24 wireprotov2server, | |
25 ) | 11 ) |
26 | 12 |
27 @wireprotov1server.wireprotocommand(b'customreadonly', permission=b'pull') | 13 @wireprotov1server.wireprotocommand(b'customreadonly', permission=b'pull') |
28 def customreadonlyv1(repo, proto): | 14 def customreadonlyv1(repo, proto): |
29 return wireprototypes.bytesresponse(b'customreadonly bytes response') | 15 return wireprototypes.bytesresponse(b'customreadonly bytes response') |
30 | 16 |
31 @wireprotov2server.wireprotocommand(b'customreadonly', permission=b'pull') | |
32 def customreadonlyv2(repo, proto): | |
33 yield b'customreadonly bytes response' | |
34 | |
35 @wireprotov1server.wireprotocommand(b'customreadwrite', permission=b'push') | 17 @wireprotov1server.wireprotocommand(b'customreadwrite', permission=b'push') |
36 def customreadwrite(repo, proto): | 18 def customreadwrite(repo, proto): |
37 return wireprototypes.bytesresponse(b'customreadwrite bytes response') | 19 return wireprototypes.bytesresponse(b'customreadwrite bytes response') |
38 | 20 |
39 @wireprotov2server.wireprotocommand(b'customreadwrite', permission=b'push') | |
40 def customreadwritev2(repo, proto): | |
41 yield b'customreadwrite bytes response' | |
42 EOF | 21 EOF |
43 | 22 |
44 cat >> $HGRCPATH << EOF | 23 cat >> $HGRCPATH << EOF |
45 [extensions] | 24 [extensions] |
46 drawdag = $TESTDIR/drawdag.py | 25 drawdag = $TESTDIR/drawdag.py |
51 [extensions] | 30 [extensions] |
52 dummycommands = $TESTTMP/dummycommands.py | 31 dummycommands = $TESTTMP/dummycommands.py |
53 EOF | 32 EOF |
54 } | 33 } |
55 | 34 |
56 enablehttpv2() { | |
57 cat >> $1/.hg/hgrc << EOF | |
58 [experimental] | |
59 web.apiserver = true | |
60 web.api.http-v2 = true | |
61 EOF | |
62 } | |
63 | |
64 enablehttpv2client() { | |
65 cat >> $HGRCPATH << EOF | |
66 [experimental] | |
67 httppeer.advertise-v2 = true | |
68 # So tests are in plain text. Also, zstd isn't available in all installs, | |
69 # which would make tests non-deterministic. | |
70 httppeer.v2-encoder-order = identity | |
71 EOF | |
72 } |