Show More
@@ -1,2199 +1,2205 b'' | |||
|
1 | TRANSITIONAL CONFIG | |
|
2 | $ cat << EOF >> $HGRCPATH | |
|
3 | > [format] | |
|
4 | > sparse-revlog = yes | |
|
5 | > EOF | |
|
6 | ||
|
1 | 7 | #require no-chg |
|
2 | 8 | |
|
3 | 9 |
$ |
|
4 | 10 | > %include $HGRCPATH |
|
5 | 11 | > [experimental] |
|
6 | 12 | > sshpeer.advertise-v2 = true |
|
7 | 13 | > sshserver.support-v2 = true |
|
8 | 14 | > EOF |
|
9 | 15 | |
|
10 | 16 | Helper function to run protocol tests against multiple protocol versions. |
|
11 | 17 | This is easier than using #testcases because managing differences between |
|
12 | 18 | protocols with inline conditional output is hard to read. |
|
13 | 19 | |
|
14 | 20 | $ debugwireproto() { |
|
15 | 21 | > commands=`cat -` |
|
16 | 22 | > echo 'testing ssh1' |
|
17 | 23 | > echo "${commands}" | hg --verbose debugwireproto --localssh |
|
18 | 24 | > echo "" |
|
19 | 25 | > echo 'testing ssh2' |
|
20 | 26 | > echo "${commands}" | HGRCPATH=$TESTTMP/hgrc-sshv2 hg --verbose debugwireproto --localssh |
|
21 | 27 | > } |
|
22 | 28 | |
|
23 | 29 | $ cat >> $HGRCPATH << EOF |
|
24 | 30 | > [ui] |
|
25 | 31 | > ssh = "$PYTHON" "$TESTDIR/dummyssh" |
|
26 | 32 | > [devel] |
|
27 | 33 | > debug.peer-request = true |
|
28 | 34 | > [extensions] |
|
29 | 35 | > sshprotoext = $TESTDIR/sshprotoext.py |
|
30 | 36 | > EOF |
|
31 | 37 | |
|
32 | 38 | $ hg init server |
|
33 | 39 | $ cd server |
|
34 | 40 | $ echo 0 > foo |
|
35 | 41 | $ hg -q add foo |
|
36 | 42 | $ hg commit -m initial |
|
37 | 43 | |
|
38 | 44 | A no-op connection performs a handshake |
|
39 | 45 | |
|
40 | 46 | $ hg debugwireproto --localssh << EOF |
|
41 | 47 | > EOF |
|
42 | 48 | creating ssh peer from handshake results |
|
43 | 49 | |
|
44 | 50 | Raw peers don't perform any activity |
|
45 | 51 | |
|
46 | 52 | $ hg debugwireproto --localssh --peer raw << EOF |
|
47 | 53 | > EOF |
|
48 | 54 | using raw connection to peer |
|
49 | 55 | $ hg debugwireproto --localssh --peer ssh1 << EOF |
|
50 | 56 | > EOF |
|
51 | 57 | creating ssh peer for wire protocol version 1 |
|
52 | 58 | $ hg debugwireproto --localssh --peer ssh2 << EOF |
|
53 | 59 | > EOF |
|
54 | 60 | creating ssh peer for wire protocol version 2 |
|
55 | 61 | |
|
56 | 62 | Test a normal behaving server, for sanity |
|
57 | 63 | |
|
58 | 64 | $ cd .. |
|
59 | 65 | |
|
60 | 66 | $ hg --debug debugpeer ssh://user@dummy/server |
|
61 | 67 | running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !) |
|
62 | 68 | running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !) |
|
63 | 69 | devel-peer-request: hello+between |
|
64 | 70 | devel-peer-request: pairs: 81 bytes |
|
65 | 71 | sending hello command |
|
66 | 72 | sending between command |
|
67 |
remote: 4 |
|
|
68 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
73 | remote: 440 | |
|
74 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
69 | 75 | remote: 1 |
|
70 | 76 | devel-peer-request: protocaps |
|
71 | 77 | devel-peer-request: caps: * bytes (glob) |
|
72 | 78 | sending protocaps command |
|
73 | 79 | url: ssh://user@dummy/server |
|
74 | 80 | local: no |
|
75 | 81 | pushable: yes |
|
76 | 82 | |
|
77 | 83 | Server should answer the "hello" command in isolation |
|
78 | 84 | |
|
79 | 85 | $ hg -R server debugwireproto --localssh --peer raw << EOF |
|
80 | 86 | > raw |
|
81 | 87 | > hello\n |
|
82 | 88 | > readline |
|
83 | 89 | > readline |
|
84 | 90 | > EOF |
|
85 | 91 | using raw connection to peer |
|
86 | 92 | i> write(6) -> 6: |
|
87 | 93 | i> hello\n |
|
88 | 94 | o> readline() -> 4: |
|
89 |
o> 4 |
|
|
90 |
o> readline() -> 4 |
|
|
91 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
95 | o> 440\n | |
|
96 | o> readline() -> 440: | |
|
97 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
92 | 98 | |
|
93 | 99 | `hg debugserve --sshstdio` works |
|
94 | 100 | |
|
95 | 101 | $ cd server |
|
96 | 102 | $ hg debugserve --sshstdio << EOF |
|
97 | 103 | > hello |
|
98 | 104 | > EOF |
|
99 |
4 |
|
|
100 | capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
105 | 440 | |
|
106 | capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
101 | 107 | |
|
102 | 108 | I/O logging works |
|
103 | 109 | |
|
104 | 110 | $ hg debugserve --sshstdio --logiofd 1 << EOF |
|
105 | 111 | > hello |
|
106 | 112 | > EOF |
|
107 | 113 | o> write(4) -> 4: |
|
108 |
o> 4 |
|
|
109 |
o> write(4 |
|
|
110 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
111 |
4 |
|
|
112 | capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
114 | o> 440\n | |
|
115 | o> write(440) -> 440: | |
|
116 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
117 | 440 | |
|
118 | capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
113 | 119 | o> flush() -> None |
|
114 | 120 | |
|
115 | 121 | $ hg debugserve --sshstdio --logiofile $TESTTMP/io << EOF |
|
116 | 122 | > hello |
|
117 | 123 | > EOF |
|
118 |
4 |
|
|
119 | capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
124 | 440 | |
|
125 | capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
120 | 126 | |
|
121 | 127 | $ cat $TESTTMP/io |
|
122 | 128 | o> write(4) -> 4: |
|
123 |
o> 4 |
|
|
124 |
o> write(4 |
|
|
125 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
129 | o> 440\n | |
|
130 | o> write(440) -> 440: | |
|
131 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
126 | 132 | o> flush() -> None |
|
127 | 133 | |
|
128 | 134 | $ cd .. |
|
129 | 135 | |
|
130 | 136 | >=0.9.1 clients send a "hello" + "between" for the null range as part of handshake. |
|
131 | 137 | Server should reply with capabilities and should send "1\n\n" as a successful |
|
132 | 138 | reply with empty response to the "between". |
|
133 | 139 | |
|
134 | 140 | $ hg -R server debugwireproto --localssh --peer raw << EOF |
|
135 | 141 | > raw |
|
136 | 142 | > hello\n |
|
137 | 143 | > readline |
|
138 | 144 | > readline |
|
139 | 145 | > raw |
|
140 | 146 | > between\n |
|
141 | 147 | > pairs 81\n |
|
142 | 148 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
143 | 149 | > readline |
|
144 | 150 | > readline |
|
145 | 151 | > EOF |
|
146 | 152 | using raw connection to peer |
|
147 | 153 | i> write(6) -> 6: |
|
148 | 154 | i> hello\n |
|
149 | 155 | o> readline() -> 4: |
|
150 |
o> 4 |
|
|
151 |
o> readline() -> 4 |
|
|
152 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
156 | o> 440\n | |
|
157 | o> readline() -> 440: | |
|
158 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
153 | 159 | i> write(98) -> 98: |
|
154 | 160 | i> between\n |
|
155 | 161 | i> pairs 81\n |
|
156 | 162 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
157 | 163 | o> readline() -> 2: |
|
158 | 164 | o> 1\n |
|
159 | 165 | o> readline() -> 1: |
|
160 | 166 | o> \n |
|
161 | 167 | |
|
162 | 168 | SSH banner is not printed by default, ignored by clients |
|
163 | 169 | |
|
164 | 170 | $ SSHSERVERMODE=banner hg debugpeer ssh://user@dummy/server |
|
165 | 171 | url: ssh://user@dummy/server |
|
166 | 172 | local: no |
|
167 | 173 | pushable: yes |
|
168 | 174 | |
|
169 | 175 | --debug will print the banner |
|
170 | 176 | |
|
171 | 177 | $ SSHSERVERMODE=banner hg --debug debugpeer ssh://user@dummy/server |
|
172 | 178 | running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !) |
|
173 | 179 | running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !) |
|
174 | 180 | devel-peer-request: hello+between |
|
175 | 181 | devel-peer-request: pairs: 81 bytes |
|
176 | 182 | sending hello command |
|
177 | 183 | sending between command |
|
178 | 184 | remote: banner: line 0 |
|
179 | 185 | remote: banner: line 1 |
|
180 | 186 | remote: banner: line 2 |
|
181 | 187 | remote: banner: line 3 |
|
182 | 188 | remote: banner: line 4 |
|
183 | 189 | remote: banner: line 5 |
|
184 | 190 | remote: banner: line 6 |
|
185 | 191 | remote: banner: line 7 |
|
186 | 192 | remote: banner: line 8 |
|
187 | 193 | remote: banner: line 9 |
|
188 |
remote: 4 |
|
|
189 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
194 | remote: 440 | |
|
195 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
190 | 196 | remote: 1 |
|
191 | 197 | devel-peer-request: protocaps |
|
192 | 198 | devel-peer-request: caps: * bytes (glob) |
|
193 | 199 | sending protocaps command |
|
194 | 200 | url: ssh://user@dummy/server |
|
195 | 201 | local: no |
|
196 | 202 | pushable: yes |
|
197 | 203 | |
|
198 | 204 | And test the banner with the raw protocol |
|
199 | 205 | |
|
200 | 206 | $ SSHSERVERMODE=banner hg -R server debugwireproto --localssh --peer raw << EOF |
|
201 | 207 | > raw |
|
202 | 208 | > hello\n |
|
203 | 209 | > readline |
|
204 | 210 | > readline |
|
205 | 211 | > readline |
|
206 | 212 | > readline |
|
207 | 213 | > readline |
|
208 | 214 | > readline |
|
209 | 215 | > readline |
|
210 | 216 | > readline |
|
211 | 217 | > readline |
|
212 | 218 | > readline |
|
213 | 219 | > readline |
|
214 | 220 | > readline |
|
215 | 221 | > raw |
|
216 | 222 | > between\n |
|
217 | 223 | > pairs 81\n |
|
218 | 224 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
219 | 225 | > readline |
|
220 | 226 | > readline |
|
221 | 227 | > EOF |
|
222 | 228 | using raw connection to peer |
|
223 | 229 | i> write(6) -> 6: |
|
224 | 230 | i> hello\n |
|
225 | 231 | o> readline() -> 15: |
|
226 | 232 | o> banner: line 0\n |
|
227 | 233 | o> readline() -> 15: |
|
228 | 234 | o> banner: line 1\n |
|
229 | 235 | o> readline() -> 15: |
|
230 | 236 | o> banner: line 2\n |
|
231 | 237 | o> readline() -> 15: |
|
232 | 238 | o> banner: line 3\n |
|
233 | 239 | o> readline() -> 15: |
|
234 | 240 | o> banner: line 4\n |
|
235 | 241 | o> readline() -> 15: |
|
236 | 242 | o> banner: line 5\n |
|
237 | 243 | o> readline() -> 15: |
|
238 | 244 | o> banner: line 6\n |
|
239 | 245 | o> readline() -> 15: |
|
240 | 246 | o> banner: line 7\n |
|
241 | 247 | o> readline() -> 15: |
|
242 | 248 | o> banner: line 8\n |
|
243 | 249 | o> readline() -> 15: |
|
244 | 250 | o> banner: line 9\n |
|
245 | 251 | o> readline() -> 4: |
|
246 |
o> 4 |
|
|
247 |
o> readline() -> 4 |
|
|
248 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
252 | o> 440\n | |
|
253 | o> readline() -> 440: | |
|
254 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
249 | 255 | i> write(98) -> 98: |
|
250 | 256 | i> between\n |
|
251 | 257 | i> pairs 81\n |
|
252 | 258 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
253 | 259 | o> readline() -> 2: |
|
254 | 260 | o> 1\n |
|
255 | 261 | o> readline() -> 1: |
|
256 | 262 | o> \n |
|
257 | 263 | |
|
258 | 264 | Connecting to a <0.9.1 server that doesn't support the hello command. |
|
259 | 265 | The client should refuse, as we dropped support for connecting to such |
|
260 | 266 | servers. |
|
261 | 267 | |
|
262 | 268 | $ SSHSERVERMODE=no-hello hg --debug debugpeer ssh://user@dummy/server |
|
263 | 269 | running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !) |
|
264 | 270 | running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !) |
|
265 | 271 | devel-peer-request: hello+between |
|
266 | 272 | devel-peer-request: pairs: 81 bytes |
|
267 | 273 | sending hello command |
|
268 | 274 | sending between command |
|
269 | 275 | remote: 0 |
|
270 | 276 | remote: 1 |
|
271 | 277 | abort: no suitable response from remote hg! |
|
272 | 278 | [255] |
|
273 | 279 | |
|
274 | 280 | Sending an unknown command to the server results in an empty response to that command |
|
275 | 281 | |
|
276 | 282 | $ hg -R server debugwireproto --localssh --peer raw << EOF |
|
277 | 283 | > raw |
|
278 | 284 | > pre-hello\n |
|
279 | 285 | > readline |
|
280 | 286 | > raw |
|
281 | 287 | > hello\n |
|
282 | 288 | > readline |
|
283 | 289 | > raw |
|
284 | 290 | > between\n |
|
285 | 291 | > pairs 81\n |
|
286 | 292 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
287 | 293 | > readline |
|
288 | 294 | > readline |
|
289 | 295 | > EOF |
|
290 | 296 | using raw connection to peer |
|
291 | 297 | i> write(10) -> 10: |
|
292 | 298 | i> pre-hello\n |
|
293 | 299 | o> readline() -> 2: |
|
294 | 300 | o> 0\n |
|
295 | 301 | i> write(6) -> 6: |
|
296 | 302 | i> hello\n |
|
297 | 303 | o> readline() -> 4: |
|
298 |
o> 4 |
|
|
304 | o> 440\n | |
|
299 | 305 | i> write(98) -> 98: |
|
300 | 306 | i> between\n |
|
301 | 307 | i> pairs 81\n |
|
302 | 308 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
303 |
o> readline() -> 4 |
|
|
304 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
309 | o> readline() -> 440: | |
|
310 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
305 | 311 | o> readline() -> 2: |
|
306 | 312 | o> 1\n |
|
307 | 313 | |
|
308 | 314 | $ hg --config sshpeer.mode=extra-handshake-commands --config sshpeer.handshake-mode=pre-no-args --debug debugpeer ssh://user@dummy/server |
|
309 | 315 | running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !) |
|
310 | 316 | running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !) |
|
311 | 317 | sending no-args command |
|
312 | 318 | devel-peer-request: hello+between |
|
313 | 319 | devel-peer-request: pairs: 81 bytes |
|
314 | 320 | sending hello command |
|
315 | 321 | sending between command |
|
316 | 322 | remote: 0 |
|
317 |
remote: 4 |
|
|
318 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
323 | remote: 440 | |
|
324 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
319 | 325 | remote: 1 |
|
320 | 326 | devel-peer-request: protocaps |
|
321 | 327 | devel-peer-request: caps: * bytes (glob) |
|
322 | 328 | sending protocaps command |
|
323 | 329 | url: ssh://user@dummy/server |
|
324 | 330 | local: no |
|
325 | 331 | pushable: yes |
|
326 | 332 | |
|
327 | 333 | Send multiple unknown commands before hello |
|
328 | 334 | |
|
329 | 335 | $ hg -R server debugwireproto --localssh --peer raw << EOF |
|
330 | 336 | > raw |
|
331 | 337 | > unknown1\n |
|
332 | 338 | > readline |
|
333 | 339 | > raw |
|
334 | 340 | > unknown2\n |
|
335 | 341 | > readline |
|
336 | 342 | > raw |
|
337 | 343 | > unknown3\n |
|
338 | 344 | > readline |
|
339 | 345 | > raw |
|
340 | 346 | > hello\n |
|
341 | 347 | > readline |
|
342 | 348 | > readline |
|
343 | 349 | > raw |
|
344 | 350 | > between\n |
|
345 | 351 | > pairs 81\n |
|
346 | 352 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
347 | 353 | > readline |
|
348 | 354 | > readline |
|
349 | 355 | > EOF |
|
350 | 356 | using raw connection to peer |
|
351 | 357 | i> write(9) -> 9: |
|
352 | 358 | i> unknown1\n |
|
353 | 359 | o> readline() -> 2: |
|
354 | 360 | o> 0\n |
|
355 | 361 | i> write(9) -> 9: |
|
356 | 362 | i> unknown2\n |
|
357 | 363 | o> readline() -> 2: |
|
358 | 364 | o> 0\n |
|
359 | 365 | i> write(9) -> 9: |
|
360 | 366 | i> unknown3\n |
|
361 | 367 | o> readline() -> 2: |
|
362 | 368 | o> 0\n |
|
363 | 369 | i> write(6) -> 6: |
|
364 | 370 | i> hello\n |
|
365 | 371 | o> readline() -> 4: |
|
366 |
o> 4 |
|
|
367 |
o> readline() -> 4 |
|
|
368 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
372 | o> 440\n | |
|
373 | o> readline() -> 440: | |
|
374 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
369 | 375 | i> write(98) -> 98: |
|
370 | 376 | i> between\n |
|
371 | 377 | i> pairs 81\n |
|
372 | 378 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
373 | 379 | o> readline() -> 2: |
|
374 | 380 | o> 1\n |
|
375 | 381 | o> readline() -> 1: |
|
376 | 382 | o> \n |
|
377 | 383 | |
|
378 | 384 | $ hg --config sshpeer.mode=extra-handshake-commands --config sshpeer.handshake-mode=pre-multiple-no-args --debug debugpeer ssh://user@dummy/server |
|
379 | 385 | running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !) |
|
380 | 386 | running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !) |
|
381 | 387 | sending unknown1 command |
|
382 | 388 | sending unknown2 command |
|
383 | 389 | sending unknown3 command |
|
384 | 390 | devel-peer-request: hello+between |
|
385 | 391 | devel-peer-request: pairs: 81 bytes |
|
386 | 392 | sending hello command |
|
387 | 393 | sending between command |
|
388 | 394 | remote: 0 |
|
389 | 395 | remote: 0 |
|
390 | 396 | remote: 0 |
|
391 |
remote: 4 |
|
|
392 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
397 | remote: 440 | |
|
398 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
393 | 399 | remote: 1 |
|
394 | 400 | devel-peer-request: protocaps |
|
395 | 401 | devel-peer-request: caps: * bytes (glob) |
|
396 | 402 | sending protocaps command |
|
397 | 403 | url: ssh://user@dummy/server |
|
398 | 404 | local: no |
|
399 | 405 | pushable: yes |
|
400 | 406 | |
|
401 | 407 | Send an unknown command before hello that has arguments |
|
402 | 408 | |
|
403 | 409 | $ cd server |
|
404 | 410 | |
|
405 | 411 | $ hg debugwireproto --localssh --peer raw << EOF |
|
406 | 412 | > raw |
|
407 | 413 | > with-args\n |
|
408 | 414 | > foo 13\n |
|
409 | 415 | > value for foo\n |
|
410 | 416 | > bar 13\n |
|
411 | 417 | > value for bar\n |
|
412 | 418 | > readline |
|
413 | 419 | > readline |
|
414 | 420 | > readline |
|
415 | 421 | > readline |
|
416 | 422 | > readline |
|
417 | 423 | > raw |
|
418 | 424 | > hello\n |
|
419 | 425 | > readline |
|
420 | 426 | > readline |
|
421 | 427 | > raw |
|
422 | 428 | > between\n |
|
423 | 429 | > pairs 81\n |
|
424 | 430 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
425 | 431 | > readline |
|
426 | 432 | > readline |
|
427 | 433 | > EOF |
|
428 | 434 | using raw connection to peer |
|
429 | 435 | i> write(52) -> 52: |
|
430 | 436 | i> with-args\n |
|
431 | 437 | i> foo 13\n |
|
432 | 438 | i> value for foo\n |
|
433 | 439 | i> bar 13\n |
|
434 | 440 | i> value for bar\n |
|
435 | 441 | o> readline() -> 2: |
|
436 | 442 | o> 0\n |
|
437 | 443 | o> readline() -> 2: |
|
438 | 444 | o> 0\n |
|
439 | 445 | o> readline() -> 2: |
|
440 | 446 | o> 0\n |
|
441 | 447 | o> readline() -> 2: |
|
442 | 448 | o> 0\n |
|
443 | 449 | o> readline() -> 2: |
|
444 | 450 | o> 0\n |
|
445 | 451 | i> write(6) -> 6: |
|
446 | 452 | i> hello\n |
|
447 | 453 | o> readline() -> 4: |
|
448 |
o> 4 |
|
|
449 |
o> readline() -> 4 |
|
|
450 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
454 | o> 440\n | |
|
455 | o> readline() -> 440: | |
|
456 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
451 | 457 | i> write(98) -> 98: |
|
452 | 458 | i> between\n |
|
453 | 459 | i> pairs 81\n |
|
454 | 460 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
455 | 461 | o> readline() -> 2: |
|
456 | 462 | o> 1\n |
|
457 | 463 | o> readline() -> 1: |
|
458 | 464 | o> \n |
|
459 | 465 | |
|
460 | 466 | Send an unknown command having an argument that looks numeric |
|
461 | 467 | |
|
462 | 468 | $ hg debugwireproto --localssh --peer raw << EOF |
|
463 | 469 | > raw |
|
464 | 470 | > unknown\n |
|
465 | 471 | > foo 1\n |
|
466 | 472 | > 0\n |
|
467 | 473 | > readline |
|
468 | 474 | > readline |
|
469 | 475 | > readline |
|
470 | 476 | > raw |
|
471 | 477 | > hello\n |
|
472 | 478 | > readline |
|
473 | 479 | > readline |
|
474 | 480 | > raw |
|
475 | 481 | > between\n |
|
476 | 482 | > pairs 81\n |
|
477 | 483 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
478 | 484 | > readline |
|
479 | 485 | > readline |
|
480 | 486 | > EOF |
|
481 | 487 | using raw connection to peer |
|
482 | 488 | i> write(16) -> 16: |
|
483 | 489 | i> unknown\n |
|
484 | 490 | i> foo 1\n |
|
485 | 491 | i> 0\n |
|
486 | 492 | o> readline() -> 2: |
|
487 | 493 | o> 0\n |
|
488 | 494 | o> readline() -> 2: |
|
489 | 495 | o> 0\n |
|
490 | 496 | o> readline() -> 2: |
|
491 | 497 | o> 0\n |
|
492 | 498 | i> write(6) -> 6: |
|
493 | 499 | i> hello\n |
|
494 | 500 | o> readline() -> 4: |
|
495 |
o> 4 |
|
|
496 |
o> readline() -> 4 |
|
|
497 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
501 | o> 440\n | |
|
502 | o> readline() -> 440: | |
|
503 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
498 | 504 | i> write(98) -> 98: |
|
499 | 505 | i> between\n |
|
500 | 506 | i> pairs 81\n |
|
501 | 507 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
502 | 508 | o> readline() -> 2: |
|
503 | 509 | o> 1\n |
|
504 | 510 | o> readline() -> 1: |
|
505 | 511 | o> \n |
|
506 | 512 | |
|
507 | 513 | $ hg debugwireproto --localssh --peer raw << EOF |
|
508 | 514 | > raw |
|
509 | 515 | > unknown\n |
|
510 | 516 | > foo 1\n |
|
511 | 517 | > 1\n |
|
512 | 518 | > readline |
|
513 | 519 | > readline |
|
514 | 520 | > readline |
|
515 | 521 | > raw |
|
516 | 522 | > hello\n |
|
517 | 523 | > readline |
|
518 | 524 | > readline |
|
519 | 525 | > raw |
|
520 | 526 | > between\n |
|
521 | 527 | > pairs 81\n |
|
522 | 528 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
523 | 529 | > readline |
|
524 | 530 | > readline |
|
525 | 531 | > EOF |
|
526 | 532 | using raw connection to peer |
|
527 | 533 | i> write(16) -> 16: |
|
528 | 534 | i> unknown\n |
|
529 | 535 | i> foo 1\n |
|
530 | 536 | i> 1\n |
|
531 | 537 | o> readline() -> 2: |
|
532 | 538 | o> 0\n |
|
533 | 539 | o> readline() -> 2: |
|
534 | 540 | o> 0\n |
|
535 | 541 | o> readline() -> 2: |
|
536 | 542 | o> 0\n |
|
537 | 543 | i> write(6) -> 6: |
|
538 | 544 | i> hello\n |
|
539 | 545 | o> readline() -> 4: |
|
540 |
o> 4 |
|
|
541 |
o> readline() -> 4 |
|
|
542 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
546 | o> 440\n | |
|
547 | o> readline() -> 440: | |
|
548 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
543 | 549 | i> write(98) -> 98: |
|
544 | 550 | i> between\n |
|
545 | 551 | i> pairs 81\n |
|
546 | 552 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
547 | 553 | o> readline() -> 2: |
|
548 | 554 | o> 1\n |
|
549 | 555 | o> readline() -> 1: |
|
550 | 556 | o> \n |
|
551 | 557 | |
|
552 | 558 | When sending a dict argument value, it is serialized to |
|
553 | 559 | "<arg> <item count>" followed by "<key> <len>\n<value>" for each item |
|
554 | 560 | in the dict. |
|
555 | 561 | |
|
556 | 562 | Dictionary value for unknown command |
|
557 | 563 | |
|
558 | 564 | $ hg debugwireproto --localssh --peer raw << EOF |
|
559 | 565 | > raw |
|
560 | 566 | > unknown\n |
|
561 | 567 | > dict 3\n |
|
562 | 568 | > key1 3\n |
|
563 | 569 | > foo\n |
|
564 | 570 | > key2 3\n |
|
565 | 571 | > bar\n |
|
566 | 572 | > key3 3\n |
|
567 | 573 | > baz\n |
|
568 | 574 | > readline |
|
569 | 575 | > readline |
|
570 | 576 | > readline |
|
571 | 577 | > readline |
|
572 | 578 | > readline |
|
573 | 579 | > readline |
|
574 | 580 | > readline |
|
575 | 581 | > readline |
|
576 | 582 | > raw |
|
577 | 583 | > hello\n |
|
578 | 584 | > readline |
|
579 | 585 | > readline |
|
580 | 586 | > EOF |
|
581 | 587 | using raw connection to peer |
|
582 | 588 | i> write(48) -> 48: |
|
583 | 589 | i> unknown\n |
|
584 | 590 | i> dict 3\n |
|
585 | 591 | i> key1 3\n |
|
586 | 592 | i> foo\n |
|
587 | 593 | i> key2 3\n |
|
588 | 594 | i> bar\n |
|
589 | 595 | i> key3 3\n |
|
590 | 596 | i> baz\n |
|
591 | 597 | o> readline() -> 2: |
|
592 | 598 | o> 0\n |
|
593 | 599 | o> readline() -> 2: |
|
594 | 600 | o> 0\n |
|
595 | 601 | o> readline() -> 2: |
|
596 | 602 | o> 0\n |
|
597 | 603 | o> readline() -> 2: |
|
598 | 604 | o> 0\n |
|
599 | 605 | o> readline() -> 2: |
|
600 | 606 | o> 0\n |
|
601 | 607 | o> readline() -> 2: |
|
602 | 608 | o> 0\n |
|
603 | 609 | o> readline() -> 2: |
|
604 | 610 | o> 0\n |
|
605 | 611 | o> readline() -> 2: |
|
606 | 612 | o> 0\n |
|
607 | 613 | i> write(6) -> 6: |
|
608 | 614 | i> hello\n |
|
609 | 615 | o> readline() -> 4: |
|
610 |
o> 4 |
|
|
611 |
o> readline() -> 4 |
|
|
612 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
616 | o> 440\n | |
|
617 | o> readline() -> 440: | |
|
618 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
613 | 619 | |
|
614 | 620 | Incomplete dictionary send |
|
615 | 621 | |
|
616 | 622 | $ hg debugwireproto --localssh --peer raw << EOF |
|
617 | 623 | > raw |
|
618 | 624 | > unknown\n |
|
619 | 625 | > dict 3\n |
|
620 | 626 | > key1 3\n |
|
621 | 627 | > foo\n |
|
622 | 628 | > readline |
|
623 | 629 | > readline |
|
624 | 630 | > readline |
|
625 | 631 | > readline |
|
626 | 632 | > EOF |
|
627 | 633 | using raw connection to peer |
|
628 | 634 | i> write(26) -> 26: |
|
629 | 635 | i> unknown\n |
|
630 | 636 | i> dict 3\n |
|
631 | 637 | i> key1 3\n |
|
632 | 638 | i> foo\n |
|
633 | 639 | o> readline() -> 2: |
|
634 | 640 | o> 0\n |
|
635 | 641 | o> readline() -> 2: |
|
636 | 642 | o> 0\n |
|
637 | 643 | o> readline() -> 2: |
|
638 | 644 | o> 0\n |
|
639 | 645 | o> readline() -> 2: |
|
640 | 646 | o> 0\n |
|
641 | 647 | |
|
642 | 648 | Incomplete value send |
|
643 | 649 | |
|
644 | 650 | $ hg debugwireproto --localssh --peer raw << EOF |
|
645 | 651 | > raw |
|
646 | 652 | > unknown\n |
|
647 | 653 | > dict 3\n |
|
648 | 654 | > key1 3\n |
|
649 | 655 | > fo |
|
650 | 656 | > readline |
|
651 | 657 | > readline |
|
652 | 658 | > readline |
|
653 | 659 | > EOF |
|
654 | 660 | using raw connection to peer |
|
655 | 661 | i> write(24) -> 24: |
|
656 | 662 | i> unknown\n |
|
657 | 663 | i> dict 3\n |
|
658 | 664 | i> key1 3\n |
|
659 | 665 | i> fo |
|
660 | 666 | o> readline() -> 2: |
|
661 | 667 | o> 0\n |
|
662 | 668 | o> readline() -> 2: |
|
663 | 669 | o> 0\n |
|
664 | 670 | o> readline() -> 2: |
|
665 | 671 | o> 0\n |
|
666 | 672 | |
|
667 | 673 | Send a command line with spaces |
|
668 | 674 | |
|
669 | 675 | $ hg debugwireproto --localssh --peer raw << EOF |
|
670 | 676 | > raw |
|
671 | 677 | > unknown withspace\n |
|
672 | 678 | > readline |
|
673 | 679 | > raw |
|
674 | 680 | > hello\n |
|
675 | 681 | > readline |
|
676 | 682 | > readline |
|
677 | 683 | > raw |
|
678 | 684 | > between\n |
|
679 | 685 | > pairs 81\n |
|
680 | 686 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
681 | 687 | > readline |
|
682 | 688 | > readline |
|
683 | 689 | > EOF |
|
684 | 690 | using raw connection to peer |
|
685 | 691 | i> write(18) -> 18: |
|
686 | 692 | i> unknown withspace\n |
|
687 | 693 | o> readline() -> 2: |
|
688 | 694 | o> 0\n |
|
689 | 695 | i> write(6) -> 6: |
|
690 | 696 | i> hello\n |
|
691 | 697 | o> readline() -> 4: |
|
692 |
o> 4 |
|
|
693 |
o> readline() -> 4 |
|
|
694 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
698 | o> 440\n | |
|
699 | o> readline() -> 440: | |
|
700 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
695 | 701 | i> write(98) -> 98: |
|
696 | 702 | i> between\n |
|
697 | 703 | i> pairs 81\n |
|
698 | 704 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
699 | 705 | o> readline() -> 2: |
|
700 | 706 | o> 1\n |
|
701 | 707 | o> readline() -> 1: |
|
702 | 708 | o> \n |
|
703 | 709 | |
|
704 | 710 | $ hg debugwireproto --localssh --peer raw << EOF |
|
705 | 711 | > raw |
|
706 | 712 | > unknown with multiple spaces\n |
|
707 | 713 | > readline |
|
708 | 714 | > raw |
|
709 | 715 | > hello\n |
|
710 | 716 | > readline |
|
711 | 717 | > readline |
|
712 | 718 | > raw |
|
713 | 719 | > between\n |
|
714 | 720 | > pairs 81\n |
|
715 | 721 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
716 | 722 | > readline |
|
717 | 723 | > EOF |
|
718 | 724 | using raw connection to peer |
|
719 | 725 | i> write(29) -> 29: |
|
720 | 726 | i> unknown with multiple spaces\n |
|
721 | 727 | o> readline() -> 2: |
|
722 | 728 | o> 0\n |
|
723 | 729 | i> write(6) -> 6: |
|
724 | 730 | i> hello\n |
|
725 | 731 | o> readline() -> 4: |
|
726 |
o> 4 |
|
|
727 |
o> readline() -> 4 |
|
|
728 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
732 | o> 440\n | |
|
733 | o> readline() -> 440: | |
|
734 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
729 | 735 | i> write(98) -> 98: |
|
730 | 736 | i> between\n |
|
731 | 737 | i> pairs 81\n |
|
732 | 738 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
733 | 739 | o> readline() -> 2: |
|
734 | 740 | o> 1\n |
|
735 | 741 | |
|
736 | 742 | $ hg debugwireproto --localssh --peer raw << EOF |
|
737 | 743 | > raw |
|
738 | 744 | > unknown with spaces\n |
|
739 | 745 | > key 10\n |
|
740 | 746 | > some value\n |
|
741 | 747 | > readline |
|
742 | 748 | > readline |
|
743 | 749 | > readline |
|
744 | 750 | > raw |
|
745 | 751 | > hello\n |
|
746 | 752 | > readline |
|
747 | 753 | > readline |
|
748 | 754 | > raw |
|
749 | 755 | > between\n |
|
750 | 756 | > pairs 81\n |
|
751 | 757 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
752 | 758 | > readline |
|
753 | 759 | > readline |
|
754 | 760 | > EOF |
|
755 | 761 | using raw connection to peer |
|
756 | 762 | i> write(38) -> 38: |
|
757 | 763 | i> unknown with spaces\n |
|
758 | 764 | i> key 10\n |
|
759 | 765 | i> some value\n |
|
760 | 766 | o> readline() -> 2: |
|
761 | 767 | o> 0\n |
|
762 | 768 | o> readline() -> 2: |
|
763 | 769 | o> 0\n |
|
764 | 770 | o> readline() -> 2: |
|
765 | 771 | o> 0\n |
|
766 | 772 | i> write(6) -> 6: |
|
767 | 773 | i> hello\n |
|
768 | 774 | o> readline() -> 4: |
|
769 |
o> 4 |
|
|
770 |
o> readline() -> 4 |
|
|
771 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
775 | o> 440\n | |
|
776 | o> readline() -> 440: | |
|
777 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
772 | 778 | i> write(98) -> 98: |
|
773 | 779 | i> between\n |
|
774 | 780 | i> pairs 81\n |
|
775 | 781 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
776 | 782 | o> readline() -> 2: |
|
777 | 783 | o> 1\n |
|
778 | 784 | o> readline() -> 1: |
|
779 | 785 | o> \n |
|
780 | 786 | Send an unknown command after the "between" |
|
781 | 787 | |
|
782 | 788 | $ hg debugwireproto --localssh --peer raw << EOF |
|
783 | 789 | > raw |
|
784 | 790 | > hello\n |
|
785 | 791 | > readline |
|
786 | 792 | > readline |
|
787 | 793 | > raw |
|
788 | 794 | > between\n |
|
789 | 795 | > pairs 81\n |
|
790 | 796 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000unknown |
|
791 | 797 | > readline |
|
792 | 798 | > readline |
|
793 | 799 | > EOF |
|
794 | 800 | using raw connection to peer |
|
795 | 801 | i> write(6) -> 6: |
|
796 | 802 | i> hello\n |
|
797 | 803 | o> readline() -> 4: |
|
798 |
o> 4 |
|
|
799 |
o> readline() -> 4 |
|
|
800 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
804 | o> 440\n | |
|
805 | o> readline() -> 440: | |
|
806 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
801 | 807 | i> write(105) -> 105: |
|
802 | 808 | i> between\n |
|
803 | 809 | i> pairs 81\n |
|
804 | 810 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000unknown |
|
805 | 811 | o> readline() -> 2: |
|
806 | 812 | o> 1\n |
|
807 | 813 | o> readline() -> 1: |
|
808 | 814 | o> \n |
|
809 | 815 | |
|
810 | 816 | And one with arguments |
|
811 | 817 | |
|
812 | 818 | $ hg debugwireproto --localssh --peer raw << EOF |
|
813 | 819 | > raw |
|
814 | 820 | > hello\n |
|
815 | 821 | > between\n |
|
816 | 822 | > pairs 81\n |
|
817 | 823 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
818 | 824 | > readline |
|
819 | 825 | > readline |
|
820 | 826 | > readline |
|
821 | 827 | > readline |
|
822 | 828 | > raw |
|
823 | 829 | > unknown\n |
|
824 | 830 | > foo 5\n |
|
825 | 831 | > \nvalue\n |
|
826 | 832 | > bar 3\n |
|
827 | 833 | > baz\n |
|
828 | 834 | > readline |
|
829 | 835 | > readline |
|
830 | 836 | > readline |
|
831 | 837 | > EOF |
|
832 | 838 | using raw connection to peer |
|
833 | 839 | i> write(104) -> 104: |
|
834 | 840 | i> hello\n |
|
835 | 841 | i> between\n |
|
836 | 842 | i> pairs 81\n |
|
837 | 843 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
838 | 844 | o> readline() -> 4: |
|
839 |
o> 4 |
|
|
840 |
o> readline() -> 4 |
|
|
841 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
845 | o> 440\n | |
|
846 | o> readline() -> 440: | |
|
847 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
842 | 848 | o> readline() -> 2: |
|
843 | 849 | o> 1\n |
|
844 | 850 | o> readline() -> 1: |
|
845 | 851 | o> \n |
|
846 | 852 | i> write(31) -> 31: |
|
847 | 853 | i> unknown\n |
|
848 | 854 | i> foo 5\n |
|
849 | 855 | i> \n |
|
850 | 856 | i> value\n |
|
851 | 857 | i> bar 3\n |
|
852 | 858 | i> baz\n |
|
853 | 859 | o> readline() -> 2: |
|
854 | 860 | o> 0\n |
|
855 | 861 | o> readline() -> 2: |
|
856 | 862 | o> 0\n |
|
857 | 863 | o> readline() -> 0: |
|
858 | 864 | |
|
859 | 865 | Send a valid command before the handshake |
|
860 | 866 | |
|
861 | 867 | $ hg debugwireproto --localssh --peer raw << EOF |
|
862 | 868 | > raw |
|
863 | 869 | > heads\n |
|
864 | 870 | > readline |
|
865 | 871 | > raw |
|
866 | 872 | > hello\n |
|
867 | 873 | > between\n |
|
868 | 874 | > pairs 81\n |
|
869 | 875 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
870 | 876 | > readline |
|
871 | 877 | > readline |
|
872 | 878 | > readline |
|
873 | 879 | > readline |
|
874 | 880 | > EOF |
|
875 | 881 | using raw connection to peer |
|
876 | 882 | i> write(6) -> 6: |
|
877 | 883 | i> heads\n |
|
878 | 884 | o> readline() -> 3: |
|
879 | 885 | o> 41\n |
|
880 | 886 | i> write(104) -> 104: |
|
881 | 887 | i> hello\n |
|
882 | 888 | i> between\n |
|
883 | 889 | i> pairs 81\n |
|
884 | 890 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
885 | 891 | o> readline() -> 41: |
|
886 | 892 | o> 68986213bd4485ea51533535e3fc9e78007a711f\n |
|
887 | 893 | o> readline() -> 4: |
|
888 |
o> 4 |
|
|
889 |
o> readline() -> 4 |
|
|
890 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
894 | o> 440\n | |
|
895 | o> readline() -> 440: | |
|
896 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
891 | 897 | o> readline() -> 2: |
|
892 | 898 | o> 1\n |
|
893 | 899 | |
|
894 | 900 | And a variation that doesn't send the between command |
|
895 | 901 | |
|
896 | 902 | $ hg debugwireproto --localssh --peer raw << EOF |
|
897 | 903 | > raw |
|
898 | 904 | > heads\n |
|
899 | 905 | > readline |
|
900 | 906 | > raw |
|
901 | 907 | > hello\n |
|
902 | 908 | > readline |
|
903 | 909 | > readline |
|
904 | 910 | > EOF |
|
905 | 911 | using raw connection to peer |
|
906 | 912 | i> write(6) -> 6: |
|
907 | 913 | i> heads\n |
|
908 | 914 | o> readline() -> 3: |
|
909 | 915 | o> 41\n |
|
910 | 916 | i> write(6) -> 6: |
|
911 | 917 | i> hello\n |
|
912 | 918 | o> readline() -> 41: |
|
913 | 919 | o> 68986213bd4485ea51533535e3fc9e78007a711f\n |
|
914 | 920 | o> readline() -> 4: |
|
915 |
o> 4 |
|
|
921 | o> 440\n | |
|
916 | 922 | |
|
917 | 923 | Send an upgrade request to a server that doesn't support that command |
|
918 | 924 | |
|
919 | 925 | $ hg debugwireproto --localssh --peer raw << EOF |
|
920 | 926 | > raw |
|
921 | 927 | > upgrade 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a proto=irrelevant1%2Cirrelevant2\n |
|
922 | 928 | > readline |
|
923 | 929 | > raw |
|
924 | 930 | > hello\n |
|
925 | 931 | > between\n |
|
926 | 932 | > pairs 81\n |
|
927 | 933 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
928 | 934 | > readline |
|
929 | 935 | > readline |
|
930 | 936 | > readline |
|
931 | 937 | > readline |
|
932 | 938 | > EOF |
|
933 | 939 | using raw connection to peer |
|
934 | 940 | i> write(77) -> 77: |
|
935 | 941 | i> upgrade 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a proto=irrelevant1%2Cirrelevant2\n |
|
936 | 942 | o> readline() -> 2: |
|
937 | 943 | o> 0\n |
|
938 | 944 | i> write(104) -> 104: |
|
939 | 945 | i> hello\n |
|
940 | 946 | i> between\n |
|
941 | 947 | i> pairs 81\n |
|
942 | 948 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
943 | 949 | o> readline() -> 4: |
|
944 |
o> 4 |
|
|
945 |
o> readline() -> 4 |
|
|
946 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
950 | o> 440\n | |
|
951 | o> readline() -> 440: | |
|
952 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
947 | 953 | o> readline() -> 2: |
|
948 | 954 | o> 1\n |
|
949 | 955 | o> readline() -> 1: |
|
950 | 956 | o> \n |
|
951 | 957 | |
|
952 | 958 | $ cd .. |
|
953 | 959 | |
|
954 | 960 | $ hg --config experimental.sshpeer.advertise-v2=true --debug debugpeer ssh://user@dummy/server |
|
955 | 961 | running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !) |
|
956 | 962 | running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !) |
|
957 | 963 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) |
|
958 | 964 | devel-peer-request: hello+between |
|
959 | 965 | devel-peer-request: pairs: 81 bytes |
|
960 | 966 | sending hello command |
|
961 | 967 | sending between command |
|
962 | 968 | remote: 0 |
|
963 |
remote: 4 |
|
|
964 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
969 | remote: 440 | |
|
970 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
965 | 971 | remote: 1 |
|
966 | 972 | devel-peer-request: protocaps |
|
967 | 973 | devel-peer-request: caps: * bytes (glob) |
|
968 | 974 | sending protocaps command |
|
969 | 975 | url: ssh://user@dummy/server |
|
970 | 976 | local: no |
|
971 | 977 | pushable: yes |
|
972 | 978 | |
|
973 | 979 | Enable version 2 support on server. We need to do this in hgrc because we can't |
|
974 | 980 | use --config with `hg serve --stdio`. |
|
975 | 981 | |
|
976 | 982 | $ cat >> server/.hg/hgrc << EOF |
|
977 | 983 | > [experimental] |
|
978 | 984 | > sshserver.support-v2 = true |
|
979 | 985 | > EOF |
|
980 | 986 | |
|
981 | 987 | Send an upgrade request to a server that supports upgrade |
|
982 | 988 | |
|
983 | 989 | $ cd server |
|
984 | 990 | |
|
985 | 991 | $ hg debugwireproto --localssh --peer raw << EOF |
|
986 | 992 | > raw |
|
987 | 993 | > upgrade this-is-some-token proto=exp-ssh-v2-0003\n |
|
988 | 994 | > hello\n |
|
989 | 995 | > between\n |
|
990 | 996 | > pairs 81\n |
|
991 | 997 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
992 | 998 | > readline |
|
993 | 999 | > readline |
|
994 | 1000 | > readline |
|
995 | 1001 | > EOF |
|
996 | 1002 | using raw connection to peer |
|
997 | 1003 | i> write(153) -> 153: |
|
998 | 1004 | i> upgrade this-is-some-token proto=exp-ssh-v2-0003\n |
|
999 | 1005 | i> hello\n |
|
1000 | 1006 | i> between\n |
|
1001 | 1007 | i> pairs 81\n |
|
1002 | 1008 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1003 | 1009 | o> readline() -> 44: |
|
1004 | 1010 | o> upgraded this-is-some-token exp-ssh-v2-0003\n |
|
1005 | 1011 | o> readline() -> 4: |
|
1006 |
o> 4 |
|
|
1007 |
o> readline() -> 4 |
|
|
1008 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1012 | o> 439\n | |
|
1013 | o> readline() -> 440: | |
|
1014 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1009 | 1015 | |
|
1010 | 1016 | $ cd .. |
|
1011 | 1017 | |
|
1012 | 1018 | $ hg --config experimental.sshpeer.advertise-v2=true --debug debugpeer ssh://user@dummy/server |
|
1013 | 1019 | running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !) |
|
1014 | 1020 | running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !) |
|
1015 | 1021 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) |
|
1016 | 1022 | devel-peer-request: hello+between |
|
1017 | 1023 | devel-peer-request: pairs: 81 bytes |
|
1018 | 1024 | sending hello command |
|
1019 | 1025 | sending between command |
|
1020 | 1026 | protocol upgraded to exp-ssh-v2-0003 |
|
1021 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
1027 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
1022 | 1028 | devel-peer-request: protocaps |
|
1023 | 1029 | devel-peer-request: caps: * bytes (glob) |
|
1024 | 1030 | sending protocaps command |
|
1025 | 1031 | url: ssh://user@dummy/server |
|
1026 | 1032 | local: no |
|
1027 | 1033 | pushable: yes |
|
1028 | 1034 | |
|
1029 | 1035 | Verify the peer has capabilities |
|
1030 | 1036 | |
|
1031 | 1037 | $ hg --config experimental.sshpeer.advertise-v2=true --debug debugcapabilities ssh://user@dummy/server |
|
1032 | 1038 | running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !) |
|
1033 | 1039 | running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !) |
|
1034 | 1040 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) |
|
1035 | 1041 | devel-peer-request: hello+between |
|
1036 | 1042 | devel-peer-request: pairs: 81 bytes |
|
1037 | 1043 | sending hello command |
|
1038 | 1044 | sending between command |
|
1039 | 1045 | protocol upgraded to exp-ssh-v2-0003 |
|
1040 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
1046 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
1041 | 1047 | devel-peer-request: protocaps |
|
1042 | 1048 | devel-peer-request: caps: * bytes (glob) |
|
1043 | 1049 | sending protocaps command |
|
1044 | 1050 | Main capabilities: |
|
1045 | 1051 | batch |
|
1046 | 1052 | branchmap |
|
1047 | 1053 | $USUAL_BUNDLE2_CAPS$ |
|
1048 | 1054 | changegroupsubset |
|
1049 | 1055 | getbundle |
|
1050 | 1056 | known |
|
1051 | 1057 | lookup |
|
1052 | 1058 | protocaps |
|
1053 | 1059 | pushkey |
|
1054 | streamreqs=generaldelta,revlogv1 | |
|
1060 | streamreqs=generaldelta,revlogv1,sparserevlog | |
|
1055 | 1061 | unbundle=HG10GZ,HG10BZ,HG10UN |
|
1056 | 1062 | unbundlehash |
|
1057 | 1063 | Bundle2 capabilities: |
|
1058 | 1064 | HG20 |
|
1059 | 1065 | bookmarks |
|
1060 | 1066 | changegroup |
|
1061 | 1067 | 01 |
|
1062 | 1068 | 02 |
|
1063 | 1069 | digests |
|
1064 | 1070 | md5 |
|
1065 | 1071 | sha1 |
|
1066 | 1072 | sha512 |
|
1067 | 1073 | error |
|
1068 | 1074 | abort |
|
1069 | 1075 | unsupportedcontent |
|
1070 | 1076 | pushraced |
|
1071 | 1077 | pushkey |
|
1072 | 1078 | hgtagsfnodes |
|
1073 | 1079 | listkeys |
|
1074 | 1080 | phases |
|
1075 | 1081 | heads |
|
1076 | 1082 | pushkey |
|
1077 | 1083 | remote-changegroup |
|
1078 | 1084 | http |
|
1079 | 1085 | https |
|
1080 | 1086 | rev-branch-cache |
|
1081 | 1087 | stream |
|
1082 | 1088 | v2 |
|
1083 | 1089 | |
|
1084 | 1090 | Command after upgrade to version 2 is processed |
|
1085 | 1091 | |
|
1086 | 1092 | $ cd server |
|
1087 | 1093 | |
|
1088 | 1094 | $ hg debugwireproto --localssh --peer raw << EOF |
|
1089 | 1095 | > raw |
|
1090 | 1096 | > upgrade this-is-some-token proto=exp-ssh-v2-0003\n |
|
1091 | 1097 | > hello\n |
|
1092 | 1098 | > between\n |
|
1093 | 1099 | > pairs 81\n |
|
1094 | 1100 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1095 | 1101 | > readline |
|
1096 | 1102 | > readline |
|
1097 | 1103 | > readline |
|
1098 | 1104 | > raw |
|
1099 | 1105 | > hello\n |
|
1100 | 1106 | > readline |
|
1101 | 1107 | > readline |
|
1102 | 1108 | > EOF |
|
1103 | 1109 | using raw connection to peer |
|
1104 | 1110 | i> write(153) -> 153: |
|
1105 | 1111 | i> upgrade this-is-some-token proto=exp-ssh-v2-0003\n |
|
1106 | 1112 | i> hello\n |
|
1107 | 1113 | i> between\n |
|
1108 | 1114 | i> pairs 81\n |
|
1109 | 1115 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1110 | 1116 | o> readline() -> 44: |
|
1111 | 1117 | o> upgraded this-is-some-token exp-ssh-v2-0003\n |
|
1112 | 1118 | o> readline() -> 4: |
|
1113 |
o> 4 |
|
|
1114 |
o> readline() -> 4 |
|
|
1115 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1119 | o> 439\n | |
|
1120 | o> readline() -> 440: | |
|
1121 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1116 | 1122 | i> write(6) -> 6: |
|
1117 | 1123 | i> hello\n |
|
1118 | 1124 | o> readline() -> 4: |
|
1119 |
o> 4 |
|
|
1120 |
o> readline() -> 4 |
|
|
1121 | o> capabilities: branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1125 | o> 424\n | |
|
1126 | o> readline() -> 424: | |
|
1127 | o> capabilities: branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1122 | 1128 | |
|
1123 | 1129 | Multiple upgrades is not allowed |
|
1124 | 1130 | |
|
1125 | 1131 | $ hg debugwireproto --localssh --peer raw << EOF |
|
1126 | 1132 | > raw |
|
1127 | 1133 | > upgrade this-is-some-token proto=exp-ssh-v2-0003\n |
|
1128 | 1134 | > hello\n |
|
1129 | 1135 | > between\n |
|
1130 | 1136 | > pairs 81\n |
|
1131 | 1137 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1132 | 1138 | > readline |
|
1133 | 1139 | > readline |
|
1134 | 1140 | > readline |
|
1135 | 1141 | > raw |
|
1136 | 1142 | > upgrade another-token proto=irrelevant\n |
|
1137 | 1143 | > hello\n |
|
1138 | 1144 | > readline |
|
1139 | 1145 | > readavailable |
|
1140 | 1146 | > EOF |
|
1141 | 1147 | using raw connection to peer |
|
1142 | 1148 | i> write(153) -> 153: |
|
1143 | 1149 | i> upgrade this-is-some-token proto=exp-ssh-v2-0003\n |
|
1144 | 1150 | i> hello\n |
|
1145 | 1151 | i> between\n |
|
1146 | 1152 | i> pairs 81\n |
|
1147 | 1153 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1148 | 1154 | o> readline() -> 44: |
|
1149 | 1155 | o> upgraded this-is-some-token exp-ssh-v2-0003\n |
|
1150 | 1156 | o> readline() -> 4: |
|
1151 |
o> 4 |
|
|
1152 |
o> readline() -> 4 |
|
|
1153 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1157 | o> 439\n | |
|
1158 | o> readline() -> 440: | |
|
1159 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1154 | 1160 | i> write(45) -> 45: |
|
1155 | 1161 | i> upgrade another-token proto=irrelevant\n |
|
1156 | 1162 | i> hello\n |
|
1157 | 1163 | o> readline() -> 1: |
|
1158 | 1164 | o> \n |
|
1159 | 1165 | e> read(-1) -> 42: |
|
1160 | 1166 | e> cannot upgrade protocols multiple times\n |
|
1161 | 1167 | e> -\n |
|
1162 | 1168 | |
|
1163 | 1169 | Malformed upgrade request line (not exactly 3 space delimited tokens) |
|
1164 | 1170 | |
|
1165 | 1171 | $ hg debugwireproto --localssh --peer raw << EOF |
|
1166 | 1172 | > raw |
|
1167 | 1173 | > upgrade\n |
|
1168 | 1174 | > readline |
|
1169 | 1175 | > EOF |
|
1170 | 1176 | using raw connection to peer |
|
1171 | 1177 | i> write(8) -> 8: |
|
1172 | 1178 | i> upgrade\n |
|
1173 | 1179 | o> readline() -> 2: |
|
1174 | 1180 | o> 0\n |
|
1175 | 1181 | |
|
1176 | 1182 | $ hg debugwireproto --localssh --peer raw << EOF |
|
1177 | 1183 | > raw |
|
1178 | 1184 | > upgrade token\n |
|
1179 | 1185 | > readline |
|
1180 | 1186 | > EOF |
|
1181 | 1187 | using raw connection to peer |
|
1182 | 1188 | i> write(14) -> 14: |
|
1183 | 1189 | i> upgrade token\n |
|
1184 | 1190 | o> readline() -> 2: |
|
1185 | 1191 | o> 0\n |
|
1186 | 1192 | |
|
1187 | 1193 | $ hg debugwireproto --localssh --peer raw << EOF |
|
1188 | 1194 | > raw |
|
1189 | 1195 | > upgrade token foo=bar extra-token\n |
|
1190 | 1196 | > readline |
|
1191 | 1197 | > EOF |
|
1192 | 1198 | using raw connection to peer |
|
1193 | 1199 | i> write(34) -> 34: |
|
1194 | 1200 | i> upgrade token foo=bar extra-token\n |
|
1195 | 1201 | o> readline() -> 2: |
|
1196 | 1202 | o> 0\n |
|
1197 | 1203 | |
|
1198 | 1204 | Upgrade request to unsupported protocol is ignored |
|
1199 | 1205 | |
|
1200 | 1206 | $ hg debugwireproto --localssh --peer raw << EOF |
|
1201 | 1207 | > raw |
|
1202 | 1208 | > upgrade this-is-some-token proto=unknown1,unknown2\n |
|
1203 | 1209 | > readline |
|
1204 | 1210 | > raw |
|
1205 | 1211 | > hello\n |
|
1206 | 1212 | > readline |
|
1207 | 1213 | > readline |
|
1208 | 1214 | > raw |
|
1209 | 1215 | > between\n |
|
1210 | 1216 | > pairs 81\n |
|
1211 | 1217 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1212 | 1218 | > readline |
|
1213 | 1219 | > readline |
|
1214 | 1220 | > EOF |
|
1215 | 1221 | using raw connection to peer |
|
1216 | 1222 | i> write(51) -> 51: |
|
1217 | 1223 | i> upgrade this-is-some-token proto=unknown1,unknown2\n |
|
1218 | 1224 | o> readline() -> 2: |
|
1219 | 1225 | o> 0\n |
|
1220 | 1226 | i> write(6) -> 6: |
|
1221 | 1227 | i> hello\n |
|
1222 | 1228 | o> readline() -> 4: |
|
1223 |
o> 4 |
|
|
1224 |
o> readline() -> 4 |
|
|
1225 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1229 | o> 440\n | |
|
1230 | o> readline() -> 440: | |
|
1231 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1226 | 1232 | i> write(98) -> 98: |
|
1227 | 1233 | i> between\n |
|
1228 | 1234 | i> pairs 81\n |
|
1229 | 1235 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1230 | 1236 | o> readline() -> 2: |
|
1231 | 1237 | o> 1\n |
|
1232 | 1238 | o> readline() -> 1: |
|
1233 | 1239 | o> \n |
|
1234 | 1240 | |
|
1235 | 1241 | Upgrade request must be followed by hello + between |
|
1236 | 1242 | |
|
1237 | 1243 | $ hg debugwireproto --localssh --peer raw << EOF |
|
1238 | 1244 | > raw |
|
1239 | 1245 | > upgrade token proto=exp-ssh-v2-0003\n |
|
1240 | 1246 | > invalid\n |
|
1241 | 1247 | > readline |
|
1242 | 1248 | > readavailable |
|
1243 | 1249 | > EOF |
|
1244 | 1250 | using raw connection to peer |
|
1245 | 1251 | i> write(44) -> 44: |
|
1246 | 1252 | i> upgrade token proto=exp-ssh-v2-0003\n |
|
1247 | 1253 | i> invalid\n |
|
1248 | 1254 | o> readline() -> 1: |
|
1249 | 1255 | o> \n |
|
1250 | 1256 | e> read(-1) -> 46: |
|
1251 | 1257 | e> malformed handshake protocol: missing hello\n |
|
1252 | 1258 | e> -\n |
|
1253 | 1259 | |
|
1254 | 1260 | $ hg debugwireproto --localssh --peer raw << EOF |
|
1255 | 1261 | > raw |
|
1256 | 1262 | > upgrade token proto=exp-ssh-v2-0003\n |
|
1257 | 1263 | > hello\n |
|
1258 | 1264 | > invalid\n |
|
1259 | 1265 | > readline |
|
1260 | 1266 | > readavailable |
|
1261 | 1267 | > EOF |
|
1262 | 1268 | using raw connection to peer |
|
1263 | 1269 | i> write(50) -> 50: |
|
1264 | 1270 | i> upgrade token proto=exp-ssh-v2-0003\n |
|
1265 | 1271 | i> hello\n |
|
1266 | 1272 | i> invalid\n |
|
1267 | 1273 | o> readline() -> 1: |
|
1268 | 1274 | o> \n |
|
1269 | 1275 | e> read(-1) -> 48: |
|
1270 | 1276 | e> malformed handshake protocol: missing between\n |
|
1271 | 1277 | e> -\n |
|
1272 | 1278 | |
|
1273 | 1279 | $ hg debugwireproto --localssh --peer raw << EOF |
|
1274 | 1280 | > raw |
|
1275 | 1281 | > upgrade token proto=exp-ssh-v2-0003\n |
|
1276 | 1282 | > hello\n |
|
1277 | 1283 | > between\n |
|
1278 | 1284 | > invalid\n |
|
1279 | 1285 | > readline |
|
1280 | 1286 | > readavailable |
|
1281 | 1287 | > EOF |
|
1282 | 1288 | using raw connection to peer |
|
1283 | 1289 | i> write(58) -> 58: |
|
1284 | 1290 | i> upgrade token proto=exp-ssh-v2-0003\n |
|
1285 | 1291 | i> hello\n |
|
1286 | 1292 | i> between\n |
|
1287 | 1293 | i> invalid\n |
|
1288 | 1294 | o> readline() -> 1: |
|
1289 | 1295 | o> \n |
|
1290 | 1296 | e> read(-1) -> 49: |
|
1291 | 1297 | e> malformed handshake protocol: missing pairs 81\n |
|
1292 | 1298 | e> -\n |
|
1293 | 1299 | |
|
1294 | 1300 | Legacy commands are not exposed to version 2 of protocol |
|
1295 | 1301 | |
|
1296 | 1302 | TODO re-enable these once we're back to actually using v2 commands |
|
1297 | 1303 | |
|
1298 | 1304 | $ hg --config experimental.sshpeer.advertise-v2=true debugwireproto --localssh << EOF |
|
1299 | 1305 | > command branches |
|
1300 | 1306 | > nodes 0000000000000000000000000000000000000000 |
|
1301 | 1307 | > EOF |
|
1302 | 1308 | creating ssh peer from handshake results |
|
1303 | 1309 | sending branches command |
|
1304 | 1310 | response: |
|
1305 | 1311 | |
|
1306 | 1312 | $ hg --config experimental.sshpeer.advertise-v2=true debugwireproto --localssh << EOF |
|
1307 | 1313 | > command changegroup |
|
1308 | 1314 | > roots 0000000000000000000000000000000000000000 |
|
1309 | 1315 | > EOF |
|
1310 | 1316 | creating ssh peer from handshake results |
|
1311 | 1317 | sending changegroup command |
|
1312 | 1318 | response: |
|
1313 | 1319 | |
|
1314 | 1320 | $ hg --config experimental.sshpeer.advertise-v2=true debugwireproto --localssh << EOF |
|
1315 | 1321 | > command changegroupsubset |
|
1316 | 1322 | > bases 0000000000000000000000000000000000000000 |
|
1317 | 1323 | > heads 0000000000000000000000000000000000000000 |
|
1318 | 1324 | > EOF |
|
1319 | 1325 | creating ssh peer from handshake results |
|
1320 | 1326 | sending changegroupsubset command |
|
1321 | 1327 | response: |
|
1322 | 1328 | |
|
1323 | 1329 | $ cd .. |
|
1324 | 1330 | |
|
1325 | 1331 | Test listkeys for listing namespaces |
|
1326 | 1332 | |
|
1327 | 1333 | $ hg init empty |
|
1328 | 1334 | $ cd empty |
|
1329 | 1335 | $ debugwireproto << EOF |
|
1330 | 1336 | > command listkeys |
|
1331 | 1337 | > namespace namespaces |
|
1332 | 1338 | > EOF |
|
1333 | 1339 | testing ssh1 |
|
1334 | 1340 | creating ssh peer from handshake results |
|
1335 | 1341 | i> write(104) -> 104: |
|
1336 | 1342 | i> hello\n |
|
1337 | 1343 | i> between\n |
|
1338 | 1344 | i> pairs 81\n |
|
1339 | 1345 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1340 | 1346 | i> flush() -> None |
|
1341 | 1347 | o> readline() -> 4: |
|
1342 |
o> 4 |
|
|
1343 |
o> readline() -> 4 |
|
|
1344 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1348 | o> 440\n | |
|
1349 | o> readline() -> 440: | |
|
1350 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1345 | 1351 | o> readline() -> 2: |
|
1346 | 1352 | o> 1\n |
|
1347 | 1353 | o> readline() -> 1: |
|
1348 | 1354 | o> \n |
|
1349 | 1355 | sending listkeys command |
|
1350 | 1356 | i> write(9) -> 9: |
|
1351 | 1357 | i> listkeys\n |
|
1352 | 1358 | i> write(13) -> 13: |
|
1353 | 1359 | i> namespace 10\n |
|
1354 | 1360 | i> write(10) -> 10: namespaces |
|
1355 | 1361 | i> flush() -> None |
|
1356 | 1362 | o> bufferedreadline() -> 3: |
|
1357 | 1363 | o> 30\n |
|
1358 | 1364 | o> bufferedread(30) -> 30: |
|
1359 | 1365 | o> bookmarks\t\n |
|
1360 | 1366 | o> namespaces\t\n |
|
1361 | 1367 | o> phases\t |
|
1362 | 1368 | response: { |
|
1363 | 1369 | b'bookmarks': b'', |
|
1364 | 1370 | b'namespaces': b'', |
|
1365 | 1371 | b'phases': b'' |
|
1366 | 1372 | } |
|
1367 | 1373 | |
|
1368 | 1374 | testing ssh2 |
|
1369 | 1375 | creating ssh peer from handshake results |
|
1370 | 1376 | i> write(171) -> 171: |
|
1371 | 1377 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
1372 | 1378 | i> hello\n |
|
1373 | 1379 | i> between\n |
|
1374 | 1380 | i> pairs 81\n |
|
1375 | 1381 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1376 | 1382 | i> flush() -> None |
|
1377 | 1383 | o> readline() -> 62: |
|
1378 | 1384 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
1379 | 1385 | o> readline() -> 4: |
|
1380 |
o> 4 |
|
|
1381 |
o> read(4 |
|
|
1386 | o> 439\n | |
|
1387 | o> read(439) -> 439: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
1382 | 1388 | o> read(1) -> 1: |
|
1383 | 1389 | o> \n |
|
1384 | 1390 | sending listkeys command |
|
1385 | 1391 | i> write(9) -> 9: |
|
1386 | 1392 | i> listkeys\n |
|
1387 | 1393 | i> write(13) -> 13: |
|
1388 | 1394 | i> namespace 10\n |
|
1389 | 1395 | i> write(10) -> 10: namespaces |
|
1390 | 1396 | i> flush() -> None |
|
1391 | 1397 | o> bufferedreadline() -> 3: |
|
1392 | 1398 | o> 30\n |
|
1393 | 1399 | o> bufferedread(30) -> 30: |
|
1394 | 1400 | o> bookmarks\t\n |
|
1395 | 1401 | o> namespaces\t\n |
|
1396 | 1402 | o> phases\t |
|
1397 | 1403 | response: { |
|
1398 | 1404 | b'bookmarks': b'', |
|
1399 | 1405 | b'namespaces': b'', |
|
1400 | 1406 | b'phases': b'' |
|
1401 | 1407 | } |
|
1402 | 1408 | |
|
1403 | 1409 | $ cd .. |
|
1404 | 1410 | |
|
1405 | 1411 | Test listkeys for bookmarks |
|
1406 | 1412 | |
|
1407 | 1413 | $ hg init bookmarkrepo |
|
1408 | 1414 | $ cd bookmarkrepo |
|
1409 | 1415 | $ echo 0 > foo |
|
1410 | 1416 | $ hg add foo |
|
1411 | 1417 | $ hg -q commit -m initial |
|
1412 | 1418 | $ echo 1 > foo |
|
1413 | 1419 | $ hg commit -m second |
|
1414 | 1420 | |
|
1415 | 1421 | With no bookmarks set |
|
1416 | 1422 | |
|
1417 | 1423 | $ debugwireproto << EOF |
|
1418 | 1424 | > command listkeys |
|
1419 | 1425 | > namespace bookmarks |
|
1420 | 1426 | > EOF |
|
1421 | 1427 | testing ssh1 |
|
1422 | 1428 | creating ssh peer from handshake results |
|
1423 | 1429 | i> write(104) -> 104: |
|
1424 | 1430 | i> hello\n |
|
1425 | 1431 | i> between\n |
|
1426 | 1432 | i> pairs 81\n |
|
1427 | 1433 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1428 | 1434 | i> flush() -> None |
|
1429 | 1435 | o> readline() -> 4: |
|
1430 |
o> 4 |
|
|
1431 |
o> readline() -> 4 |
|
|
1432 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1436 | o> 440\n | |
|
1437 | o> readline() -> 440: | |
|
1438 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1433 | 1439 | o> readline() -> 2: |
|
1434 | 1440 | o> 1\n |
|
1435 | 1441 | o> readline() -> 1: |
|
1436 | 1442 | o> \n |
|
1437 | 1443 | sending listkeys command |
|
1438 | 1444 | i> write(9) -> 9: |
|
1439 | 1445 | i> listkeys\n |
|
1440 | 1446 | i> write(12) -> 12: |
|
1441 | 1447 | i> namespace 9\n |
|
1442 | 1448 | i> write(9) -> 9: bookmarks |
|
1443 | 1449 | i> flush() -> None |
|
1444 | 1450 | o> bufferedreadline() -> 2: |
|
1445 | 1451 | o> 0\n |
|
1446 | 1452 | response: {} |
|
1447 | 1453 | |
|
1448 | 1454 | testing ssh2 |
|
1449 | 1455 | creating ssh peer from handshake results |
|
1450 | 1456 | i> write(171) -> 171: |
|
1451 | 1457 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
1452 | 1458 | i> hello\n |
|
1453 | 1459 | i> between\n |
|
1454 | 1460 | i> pairs 81\n |
|
1455 | 1461 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1456 | 1462 | i> flush() -> None |
|
1457 | 1463 | o> readline() -> 62: |
|
1458 | 1464 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
1459 | 1465 | o> readline() -> 4: |
|
1460 |
o> 4 |
|
|
1461 |
o> read(4 |
|
|
1466 | o> 439\n | |
|
1467 | o> read(439) -> 439: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
1462 | 1468 | o> read(1) -> 1: |
|
1463 | 1469 | o> \n |
|
1464 | 1470 | sending listkeys command |
|
1465 | 1471 | i> write(9) -> 9: |
|
1466 | 1472 | i> listkeys\n |
|
1467 | 1473 | i> write(12) -> 12: |
|
1468 | 1474 | i> namespace 9\n |
|
1469 | 1475 | i> write(9) -> 9: bookmarks |
|
1470 | 1476 | i> flush() -> None |
|
1471 | 1477 | o> bufferedreadline() -> 2: |
|
1472 | 1478 | o> 0\n |
|
1473 | 1479 | response: {} |
|
1474 | 1480 | |
|
1475 | 1481 | With a single bookmark set |
|
1476 | 1482 | |
|
1477 | 1483 | $ hg book -r 0 bookA |
|
1478 | 1484 | $ debugwireproto << EOF |
|
1479 | 1485 | > command listkeys |
|
1480 | 1486 | > namespace bookmarks |
|
1481 | 1487 | > EOF |
|
1482 | 1488 | testing ssh1 |
|
1483 | 1489 | creating ssh peer from handshake results |
|
1484 | 1490 | i> write(104) -> 104: |
|
1485 | 1491 | i> hello\n |
|
1486 | 1492 | i> between\n |
|
1487 | 1493 | i> pairs 81\n |
|
1488 | 1494 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1489 | 1495 | i> flush() -> None |
|
1490 | 1496 | o> readline() -> 4: |
|
1491 |
o> 4 |
|
|
1492 |
o> readline() -> 4 |
|
|
1493 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1497 | o> 440\n | |
|
1498 | o> readline() -> 440: | |
|
1499 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1494 | 1500 | o> readline() -> 2: |
|
1495 | 1501 | o> 1\n |
|
1496 | 1502 | o> readline() -> 1: |
|
1497 | 1503 | o> \n |
|
1498 | 1504 | sending listkeys command |
|
1499 | 1505 | i> write(9) -> 9: |
|
1500 | 1506 | i> listkeys\n |
|
1501 | 1507 | i> write(12) -> 12: |
|
1502 | 1508 | i> namespace 9\n |
|
1503 | 1509 | i> write(9) -> 9: bookmarks |
|
1504 | 1510 | i> flush() -> None |
|
1505 | 1511 | o> bufferedreadline() -> 3: |
|
1506 | 1512 | o> 46\n |
|
1507 | 1513 | o> bufferedread(46) -> 46: bookA\t68986213bd4485ea51533535e3fc9e78007a711f |
|
1508 | 1514 | response: { |
|
1509 | 1515 | b'bookA': b'68986213bd4485ea51533535e3fc9e78007a711f' |
|
1510 | 1516 | } |
|
1511 | 1517 | |
|
1512 | 1518 | testing ssh2 |
|
1513 | 1519 | creating ssh peer from handshake results |
|
1514 | 1520 | i> write(171) -> 171: |
|
1515 | 1521 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
1516 | 1522 | i> hello\n |
|
1517 | 1523 | i> between\n |
|
1518 | 1524 | i> pairs 81\n |
|
1519 | 1525 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1520 | 1526 | i> flush() -> None |
|
1521 | 1527 | o> readline() -> 62: |
|
1522 | 1528 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
1523 | 1529 | o> readline() -> 4: |
|
1524 |
o> 4 |
|
|
1525 |
o> read(4 |
|
|
1530 | o> 439\n | |
|
1531 | o> read(439) -> 439: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
1526 | 1532 | o> read(1) -> 1: |
|
1527 | 1533 | o> \n |
|
1528 | 1534 | sending listkeys command |
|
1529 | 1535 | i> write(9) -> 9: |
|
1530 | 1536 | i> listkeys\n |
|
1531 | 1537 | i> write(12) -> 12: |
|
1532 | 1538 | i> namespace 9\n |
|
1533 | 1539 | i> write(9) -> 9: bookmarks |
|
1534 | 1540 | i> flush() -> None |
|
1535 | 1541 | o> bufferedreadline() -> 3: |
|
1536 | 1542 | o> 46\n |
|
1537 | 1543 | o> bufferedread(46) -> 46: bookA\t68986213bd4485ea51533535e3fc9e78007a711f |
|
1538 | 1544 | response: { |
|
1539 | 1545 | b'bookA': b'68986213bd4485ea51533535e3fc9e78007a711f' |
|
1540 | 1546 | } |
|
1541 | 1547 | |
|
1542 | 1548 | With multiple bookmarks set |
|
1543 | 1549 | |
|
1544 | 1550 | $ hg book -r 1 bookB |
|
1545 | 1551 | $ debugwireproto << EOF |
|
1546 | 1552 | > command listkeys |
|
1547 | 1553 | > namespace bookmarks |
|
1548 | 1554 | > EOF |
|
1549 | 1555 | testing ssh1 |
|
1550 | 1556 | creating ssh peer from handshake results |
|
1551 | 1557 | i> write(104) -> 104: |
|
1552 | 1558 | i> hello\n |
|
1553 | 1559 | i> between\n |
|
1554 | 1560 | i> pairs 81\n |
|
1555 | 1561 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1556 | 1562 | i> flush() -> None |
|
1557 | 1563 | o> readline() -> 4: |
|
1558 |
o> 4 |
|
|
1559 |
o> readline() -> 4 |
|
|
1560 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1564 | o> 440\n | |
|
1565 | o> readline() -> 440: | |
|
1566 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1561 | 1567 | o> readline() -> 2: |
|
1562 | 1568 | o> 1\n |
|
1563 | 1569 | o> readline() -> 1: |
|
1564 | 1570 | o> \n |
|
1565 | 1571 | sending listkeys command |
|
1566 | 1572 | i> write(9) -> 9: |
|
1567 | 1573 | i> listkeys\n |
|
1568 | 1574 | i> write(12) -> 12: |
|
1569 | 1575 | i> namespace 9\n |
|
1570 | 1576 | i> write(9) -> 9: bookmarks |
|
1571 | 1577 | i> flush() -> None |
|
1572 | 1578 | o> bufferedreadline() -> 3: |
|
1573 | 1579 | o> 93\n |
|
1574 | 1580 | o> bufferedread(93) -> 93: |
|
1575 | 1581 | o> bookA\t68986213bd4485ea51533535e3fc9e78007a711f\n |
|
1576 | 1582 | o> bookB\t1880f3755e2e52e3199e0ee5638128b08642f34d |
|
1577 | 1583 | response: { |
|
1578 | 1584 | b'bookA': b'68986213bd4485ea51533535e3fc9e78007a711f', |
|
1579 | 1585 | b'bookB': b'1880f3755e2e52e3199e0ee5638128b08642f34d' |
|
1580 | 1586 | } |
|
1581 | 1587 | |
|
1582 | 1588 | testing ssh2 |
|
1583 | 1589 | creating ssh peer from handshake results |
|
1584 | 1590 | i> write(171) -> 171: |
|
1585 | 1591 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
1586 | 1592 | i> hello\n |
|
1587 | 1593 | i> between\n |
|
1588 | 1594 | i> pairs 81\n |
|
1589 | 1595 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1590 | 1596 | i> flush() -> None |
|
1591 | 1597 | o> readline() -> 62: |
|
1592 | 1598 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
1593 | 1599 | o> readline() -> 4: |
|
1594 |
o> 4 |
|
|
1595 |
o> read(4 |
|
|
1600 | o> 439\n | |
|
1601 | o> read(439) -> 439: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
1596 | 1602 | o> read(1) -> 1: |
|
1597 | 1603 | o> \n |
|
1598 | 1604 | sending listkeys command |
|
1599 | 1605 | i> write(9) -> 9: |
|
1600 | 1606 | i> listkeys\n |
|
1601 | 1607 | i> write(12) -> 12: |
|
1602 | 1608 | i> namespace 9\n |
|
1603 | 1609 | i> write(9) -> 9: bookmarks |
|
1604 | 1610 | i> flush() -> None |
|
1605 | 1611 | o> bufferedreadline() -> 3: |
|
1606 | 1612 | o> 93\n |
|
1607 | 1613 | o> bufferedread(93) -> 93: |
|
1608 | 1614 | o> bookA\t68986213bd4485ea51533535e3fc9e78007a711f\n |
|
1609 | 1615 | o> bookB\t1880f3755e2e52e3199e0ee5638128b08642f34d |
|
1610 | 1616 | response: { |
|
1611 | 1617 | b'bookA': b'68986213bd4485ea51533535e3fc9e78007a711f', |
|
1612 | 1618 | b'bookB': b'1880f3755e2e52e3199e0ee5638128b08642f34d' |
|
1613 | 1619 | } |
|
1614 | 1620 | |
|
1615 | 1621 | Test pushkey for bookmarks |
|
1616 | 1622 | |
|
1617 | 1623 | $ debugwireproto << EOF |
|
1618 | 1624 | > command pushkey |
|
1619 | 1625 | > namespace bookmarks |
|
1620 | 1626 | > key remote |
|
1621 | 1627 | > old |
|
1622 | 1628 | > new 68986213bd4485ea51533535e3fc9e78007a711f |
|
1623 | 1629 | > EOF |
|
1624 | 1630 | testing ssh1 |
|
1625 | 1631 | creating ssh peer from handshake results |
|
1626 | 1632 | i> write(104) -> 104: |
|
1627 | 1633 | i> hello\n |
|
1628 | 1634 | i> between\n |
|
1629 | 1635 | i> pairs 81\n |
|
1630 | 1636 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1631 | 1637 | i> flush() -> None |
|
1632 | 1638 | o> readline() -> 4: |
|
1633 |
o> 4 |
|
|
1634 |
o> readline() -> 4 |
|
|
1635 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1639 | o> 440\n | |
|
1640 | o> readline() -> 440: | |
|
1641 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1636 | 1642 | o> readline() -> 2: |
|
1637 | 1643 | o> 1\n |
|
1638 | 1644 | o> readline() -> 1: |
|
1639 | 1645 | o> \n |
|
1640 | 1646 | sending pushkey command |
|
1641 | 1647 | i> write(8) -> 8: |
|
1642 | 1648 | i> pushkey\n |
|
1643 | 1649 | i> write(6) -> 6: |
|
1644 | 1650 | i> key 6\n |
|
1645 | 1651 | i> write(6) -> 6: remote |
|
1646 | 1652 | i> write(12) -> 12: |
|
1647 | 1653 | i> namespace 9\n |
|
1648 | 1654 | i> write(9) -> 9: bookmarks |
|
1649 | 1655 | i> write(7) -> 7: |
|
1650 | 1656 | i> new 40\n |
|
1651 | 1657 | i> write(40) -> 40: 68986213bd4485ea51533535e3fc9e78007a711f |
|
1652 | 1658 | i> write(6) -> 6: |
|
1653 | 1659 | i> old 0\n |
|
1654 | 1660 | i> flush() -> None |
|
1655 | 1661 | o> bufferedreadline() -> 2: |
|
1656 | 1662 | o> 2\n |
|
1657 | 1663 | o> bufferedread(2) -> 2: |
|
1658 | 1664 | o> 1\n |
|
1659 | 1665 | response: True |
|
1660 | 1666 | |
|
1661 | 1667 | testing ssh2 |
|
1662 | 1668 | creating ssh peer from handshake results |
|
1663 | 1669 | i> write(171) -> 171: |
|
1664 | 1670 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
1665 | 1671 | i> hello\n |
|
1666 | 1672 | i> between\n |
|
1667 | 1673 | i> pairs 81\n |
|
1668 | 1674 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1669 | 1675 | i> flush() -> None |
|
1670 | 1676 | o> readline() -> 62: |
|
1671 | 1677 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
1672 | 1678 | o> readline() -> 4: |
|
1673 |
o> 4 |
|
|
1674 |
o> read(4 |
|
|
1679 | o> 439\n | |
|
1680 | o> read(439) -> 439: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
1675 | 1681 | o> read(1) -> 1: |
|
1676 | 1682 | o> \n |
|
1677 | 1683 | sending pushkey command |
|
1678 | 1684 | i> write(8) -> 8: |
|
1679 | 1685 | i> pushkey\n |
|
1680 | 1686 | i> write(6) -> 6: |
|
1681 | 1687 | i> key 6\n |
|
1682 | 1688 | i> write(6) -> 6: remote |
|
1683 | 1689 | i> write(12) -> 12: |
|
1684 | 1690 | i> namespace 9\n |
|
1685 | 1691 | i> write(9) -> 9: bookmarks |
|
1686 | 1692 | i> write(7) -> 7: |
|
1687 | 1693 | i> new 40\n |
|
1688 | 1694 | i> write(40) -> 40: 68986213bd4485ea51533535e3fc9e78007a711f |
|
1689 | 1695 | i> write(6) -> 6: |
|
1690 | 1696 | i> old 0\n |
|
1691 | 1697 | i> flush() -> None |
|
1692 | 1698 | o> bufferedreadline() -> 2: |
|
1693 | 1699 | o> 2\n |
|
1694 | 1700 | o> bufferedread(2) -> 2: |
|
1695 | 1701 | o> 1\n |
|
1696 | 1702 | response: True |
|
1697 | 1703 | |
|
1698 | 1704 | $ hg bookmarks |
|
1699 | 1705 | bookA 0:68986213bd44 |
|
1700 | 1706 | bookB 1:1880f3755e2e |
|
1701 | 1707 | remote 0:68986213bd44 |
|
1702 | 1708 | |
|
1703 | 1709 | $ cd .. |
|
1704 | 1710 | |
|
1705 | 1711 | Test listkeys for phases |
|
1706 | 1712 | |
|
1707 | 1713 | $ hg init phasesrepo |
|
1708 | 1714 | $ cd phasesrepo |
|
1709 | 1715 | |
|
1710 | 1716 | Phases on empty repo |
|
1711 | 1717 | |
|
1712 | 1718 | $ debugwireproto << EOF |
|
1713 | 1719 | > command listkeys |
|
1714 | 1720 | > namespace phases |
|
1715 | 1721 | > EOF |
|
1716 | 1722 | testing ssh1 |
|
1717 | 1723 | creating ssh peer from handshake results |
|
1718 | 1724 | i> write(104) -> 104: |
|
1719 | 1725 | i> hello\n |
|
1720 | 1726 | i> between\n |
|
1721 | 1727 | i> pairs 81\n |
|
1722 | 1728 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1723 | 1729 | i> flush() -> None |
|
1724 | 1730 | o> readline() -> 4: |
|
1725 |
o> 4 |
|
|
1726 |
o> readline() -> 4 |
|
|
1727 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1731 | o> 440\n | |
|
1732 | o> readline() -> 440: | |
|
1733 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1728 | 1734 | o> readline() -> 2: |
|
1729 | 1735 | o> 1\n |
|
1730 | 1736 | o> readline() -> 1: |
|
1731 | 1737 | o> \n |
|
1732 | 1738 | sending listkeys command |
|
1733 | 1739 | i> write(9) -> 9: |
|
1734 | 1740 | i> listkeys\n |
|
1735 | 1741 | i> write(12) -> 12: |
|
1736 | 1742 | i> namespace 6\n |
|
1737 | 1743 | i> write(6) -> 6: phases |
|
1738 | 1744 | i> flush() -> None |
|
1739 | 1745 | o> bufferedreadline() -> 3: |
|
1740 | 1746 | o> 15\n |
|
1741 | 1747 | o> bufferedread(15) -> 15: publishing\tTrue |
|
1742 | 1748 | response: { |
|
1743 | 1749 | b'publishing': b'True' |
|
1744 | 1750 | } |
|
1745 | 1751 | |
|
1746 | 1752 | testing ssh2 |
|
1747 | 1753 | creating ssh peer from handshake results |
|
1748 | 1754 | i> write(171) -> 171: |
|
1749 | 1755 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
1750 | 1756 | i> hello\n |
|
1751 | 1757 | i> between\n |
|
1752 | 1758 | i> pairs 81\n |
|
1753 | 1759 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1754 | 1760 | i> flush() -> None |
|
1755 | 1761 | o> readline() -> 62: |
|
1756 | 1762 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
1757 | 1763 | o> readline() -> 4: |
|
1758 |
o> 4 |
|
|
1759 |
o> read(4 |
|
|
1764 | o> 439\n | |
|
1765 | o> read(439) -> 439: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
1760 | 1766 | o> read(1) -> 1: |
|
1761 | 1767 | o> \n |
|
1762 | 1768 | sending listkeys command |
|
1763 | 1769 | i> write(9) -> 9: |
|
1764 | 1770 | i> listkeys\n |
|
1765 | 1771 | i> write(12) -> 12: |
|
1766 | 1772 | i> namespace 6\n |
|
1767 | 1773 | i> write(6) -> 6: phases |
|
1768 | 1774 | i> flush() -> None |
|
1769 | 1775 | o> bufferedreadline() -> 3: |
|
1770 | 1776 | o> 15\n |
|
1771 | 1777 | o> bufferedread(15) -> 15: publishing\tTrue |
|
1772 | 1778 | response: { |
|
1773 | 1779 | b'publishing': b'True' |
|
1774 | 1780 | } |
|
1775 | 1781 | |
|
1776 | 1782 | Create some commits |
|
1777 | 1783 | |
|
1778 | 1784 | $ echo 0 > foo |
|
1779 | 1785 | $ hg add foo |
|
1780 | 1786 | $ hg -q commit -m initial |
|
1781 | 1787 | $ hg phase --public |
|
1782 | 1788 | $ echo 1 > foo |
|
1783 | 1789 | $ hg commit -m 'head 1 commit 1' |
|
1784 | 1790 | $ echo 2 > foo |
|
1785 | 1791 | $ hg commit -m 'head 1 commit 2' |
|
1786 | 1792 | $ hg -q up 0 |
|
1787 | 1793 | $ echo 1a > foo |
|
1788 | 1794 | $ hg commit -m 'head 2 commit 1' |
|
1789 | 1795 | created new head |
|
1790 | 1796 | $ echo 2a > foo |
|
1791 | 1797 | $ hg commit -m 'head 2 commit 2' |
|
1792 | 1798 | |
|
1793 | 1799 | Two draft heads |
|
1794 | 1800 | |
|
1795 | 1801 | $ debugwireproto << EOF |
|
1796 | 1802 | > command listkeys |
|
1797 | 1803 | > namespace phases |
|
1798 | 1804 | > EOF |
|
1799 | 1805 | testing ssh1 |
|
1800 | 1806 | creating ssh peer from handshake results |
|
1801 | 1807 | i> write(104) -> 104: |
|
1802 | 1808 | i> hello\n |
|
1803 | 1809 | i> between\n |
|
1804 | 1810 | i> pairs 81\n |
|
1805 | 1811 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1806 | 1812 | i> flush() -> None |
|
1807 | 1813 | o> readline() -> 4: |
|
1808 |
o> 4 |
|
|
1809 |
o> readline() -> 4 |
|
|
1810 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1814 | o> 440\n | |
|
1815 | o> readline() -> 440: | |
|
1816 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1811 | 1817 | o> readline() -> 2: |
|
1812 | 1818 | o> 1\n |
|
1813 | 1819 | o> readline() -> 1: |
|
1814 | 1820 | o> \n |
|
1815 | 1821 | sending listkeys command |
|
1816 | 1822 | i> write(9) -> 9: |
|
1817 | 1823 | i> listkeys\n |
|
1818 | 1824 | i> write(12) -> 12: |
|
1819 | 1825 | i> namespace 6\n |
|
1820 | 1826 | i> write(6) -> 6: phases |
|
1821 | 1827 | i> flush() -> None |
|
1822 | 1828 | o> bufferedreadline() -> 4: |
|
1823 | 1829 | o> 101\n |
|
1824 | 1830 | o> bufferedread(101) -> 101: |
|
1825 | 1831 | o> 20b8a89289d80036e6c4e87c2083e3bea1586637\t1\n |
|
1826 | 1832 | o> c4750011d906c18ea2f0527419cbc1a544435150\t1\n |
|
1827 | 1833 | o> publishing\tTrue |
|
1828 | 1834 | response: { |
|
1829 | 1835 | b'20b8a89289d80036e6c4e87c2083e3bea1586637': b'1', |
|
1830 | 1836 | b'c4750011d906c18ea2f0527419cbc1a544435150': b'1', |
|
1831 | 1837 | b'publishing': b'True' |
|
1832 | 1838 | } |
|
1833 | 1839 | |
|
1834 | 1840 | testing ssh2 |
|
1835 | 1841 | creating ssh peer from handshake results |
|
1836 | 1842 | i> write(171) -> 171: |
|
1837 | 1843 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
1838 | 1844 | i> hello\n |
|
1839 | 1845 | i> between\n |
|
1840 | 1846 | i> pairs 81\n |
|
1841 | 1847 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1842 | 1848 | i> flush() -> None |
|
1843 | 1849 | o> readline() -> 62: |
|
1844 | 1850 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
1845 | 1851 | o> readline() -> 4: |
|
1846 |
o> 4 |
|
|
1847 |
o> read(4 |
|
|
1852 | o> 439\n | |
|
1853 | o> read(439) -> 439: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
1848 | 1854 | o> read(1) -> 1: |
|
1849 | 1855 | o> \n |
|
1850 | 1856 | sending listkeys command |
|
1851 | 1857 | i> write(9) -> 9: |
|
1852 | 1858 | i> listkeys\n |
|
1853 | 1859 | i> write(12) -> 12: |
|
1854 | 1860 | i> namespace 6\n |
|
1855 | 1861 | i> write(6) -> 6: phases |
|
1856 | 1862 | i> flush() -> None |
|
1857 | 1863 | o> bufferedreadline() -> 4: |
|
1858 | 1864 | o> 101\n |
|
1859 | 1865 | o> bufferedread(101) -> 101: |
|
1860 | 1866 | o> 20b8a89289d80036e6c4e87c2083e3bea1586637\t1\n |
|
1861 | 1867 | o> c4750011d906c18ea2f0527419cbc1a544435150\t1\n |
|
1862 | 1868 | o> publishing\tTrue |
|
1863 | 1869 | response: { |
|
1864 | 1870 | b'20b8a89289d80036e6c4e87c2083e3bea1586637': b'1', |
|
1865 | 1871 | b'c4750011d906c18ea2f0527419cbc1a544435150': b'1', |
|
1866 | 1872 | b'publishing': b'True' |
|
1867 | 1873 | } |
|
1868 | 1874 | |
|
1869 | 1875 | Single draft head |
|
1870 | 1876 | |
|
1871 | 1877 | $ hg phase --public -r 2 |
|
1872 | 1878 | $ debugwireproto << EOF |
|
1873 | 1879 | > command listkeys |
|
1874 | 1880 | > namespace phases |
|
1875 | 1881 | > EOF |
|
1876 | 1882 | testing ssh1 |
|
1877 | 1883 | creating ssh peer from handshake results |
|
1878 | 1884 | i> write(104) -> 104: |
|
1879 | 1885 | i> hello\n |
|
1880 | 1886 | i> between\n |
|
1881 | 1887 | i> pairs 81\n |
|
1882 | 1888 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1883 | 1889 | i> flush() -> None |
|
1884 | 1890 | o> readline() -> 4: |
|
1885 |
o> 4 |
|
|
1886 |
o> readline() -> 4 |
|
|
1887 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1891 | o> 440\n | |
|
1892 | o> readline() -> 440: | |
|
1893 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1888 | 1894 | o> readline() -> 2: |
|
1889 | 1895 | o> 1\n |
|
1890 | 1896 | o> readline() -> 1: |
|
1891 | 1897 | o> \n |
|
1892 | 1898 | sending listkeys command |
|
1893 | 1899 | i> write(9) -> 9: |
|
1894 | 1900 | i> listkeys\n |
|
1895 | 1901 | i> write(12) -> 12: |
|
1896 | 1902 | i> namespace 6\n |
|
1897 | 1903 | i> write(6) -> 6: phases |
|
1898 | 1904 | i> flush() -> None |
|
1899 | 1905 | o> bufferedreadline() -> 3: |
|
1900 | 1906 | o> 58\n |
|
1901 | 1907 | o> bufferedread(58) -> 58: |
|
1902 | 1908 | o> c4750011d906c18ea2f0527419cbc1a544435150\t1\n |
|
1903 | 1909 | o> publishing\tTrue |
|
1904 | 1910 | response: { |
|
1905 | 1911 | b'c4750011d906c18ea2f0527419cbc1a544435150': b'1', |
|
1906 | 1912 | b'publishing': b'True' |
|
1907 | 1913 | } |
|
1908 | 1914 | |
|
1909 | 1915 | testing ssh2 |
|
1910 | 1916 | creating ssh peer from handshake results |
|
1911 | 1917 | i> write(171) -> 171: |
|
1912 | 1918 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
1913 | 1919 | i> hello\n |
|
1914 | 1920 | i> between\n |
|
1915 | 1921 | i> pairs 81\n |
|
1916 | 1922 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1917 | 1923 | i> flush() -> None |
|
1918 | 1924 | o> readline() -> 62: |
|
1919 | 1925 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
1920 | 1926 | o> readline() -> 4: |
|
1921 |
o> 4 |
|
|
1922 |
o> read(4 |
|
|
1927 | o> 439\n | |
|
1928 | o> read(439) -> 439: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
1923 | 1929 | o> read(1) -> 1: |
|
1924 | 1930 | o> \n |
|
1925 | 1931 | sending listkeys command |
|
1926 | 1932 | i> write(9) -> 9: |
|
1927 | 1933 | i> listkeys\n |
|
1928 | 1934 | i> write(12) -> 12: |
|
1929 | 1935 | i> namespace 6\n |
|
1930 | 1936 | i> write(6) -> 6: phases |
|
1931 | 1937 | i> flush() -> None |
|
1932 | 1938 | o> bufferedreadline() -> 3: |
|
1933 | 1939 | o> 58\n |
|
1934 | 1940 | o> bufferedread(58) -> 58: |
|
1935 | 1941 | o> c4750011d906c18ea2f0527419cbc1a544435150\t1\n |
|
1936 | 1942 | o> publishing\tTrue |
|
1937 | 1943 | response: { |
|
1938 | 1944 | b'c4750011d906c18ea2f0527419cbc1a544435150': b'1', |
|
1939 | 1945 | b'publishing': b'True' |
|
1940 | 1946 | } |
|
1941 | 1947 | |
|
1942 | 1948 | All public heads |
|
1943 | 1949 | |
|
1944 | 1950 | $ hg phase --public -r 4 |
|
1945 | 1951 | $ debugwireproto << EOF |
|
1946 | 1952 | > command listkeys |
|
1947 | 1953 | > namespace phases |
|
1948 | 1954 | > EOF |
|
1949 | 1955 | testing ssh1 |
|
1950 | 1956 | creating ssh peer from handshake results |
|
1951 | 1957 | i> write(104) -> 104: |
|
1952 | 1958 | i> hello\n |
|
1953 | 1959 | i> between\n |
|
1954 | 1960 | i> pairs 81\n |
|
1955 | 1961 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1956 | 1962 | i> flush() -> None |
|
1957 | 1963 | o> readline() -> 4: |
|
1958 |
o> 4 |
|
|
1959 |
o> readline() -> 4 |
|
|
1960 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1964 | o> 440\n | |
|
1965 | o> readline() -> 440: | |
|
1966 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
1961 | 1967 | o> readline() -> 2: |
|
1962 | 1968 | o> 1\n |
|
1963 | 1969 | o> readline() -> 1: |
|
1964 | 1970 | o> \n |
|
1965 | 1971 | sending listkeys command |
|
1966 | 1972 | i> write(9) -> 9: |
|
1967 | 1973 | i> listkeys\n |
|
1968 | 1974 | i> write(12) -> 12: |
|
1969 | 1975 | i> namespace 6\n |
|
1970 | 1976 | i> write(6) -> 6: phases |
|
1971 | 1977 | i> flush() -> None |
|
1972 | 1978 | o> bufferedreadline() -> 3: |
|
1973 | 1979 | o> 15\n |
|
1974 | 1980 | o> bufferedread(15) -> 15: publishing\tTrue |
|
1975 | 1981 | response: { |
|
1976 | 1982 | b'publishing': b'True' |
|
1977 | 1983 | } |
|
1978 | 1984 | |
|
1979 | 1985 | testing ssh2 |
|
1980 | 1986 | creating ssh peer from handshake results |
|
1981 | 1987 | i> write(171) -> 171: |
|
1982 | 1988 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
1983 | 1989 | i> hello\n |
|
1984 | 1990 | i> between\n |
|
1985 | 1991 | i> pairs 81\n |
|
1986 | 1992 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
1987 | 1993 | i> flush() -> None |
|
1988 | 1994 | o> readline() -> 62: |
|
1989 | 1995 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
1990 | 1996 | o> readline() -> 4: |
|
1991 |
o> 4 |
|
|
1992 |
o> read(4 |
|
|
1997 | o> 439\n | |
|
1998 | o> read(439) -> 439: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
1993 | 1999 | o> read(1) -> 1: |
|
1994 | 2000 | o> \n |
|
1995 | 2001 | sending listkeys command |
|
1996 | 2002 | i> write(9) -> 9: |
|
1997 | 2003 | i> listkeys\n |
|
1998 | 2004 | i> write(12) -> 12: |
|
1999 | 2005 | i> namespace 6\n |
|
2000 | 2006 | i> write(6) -> 6: phases |
|
2001 | 2007 | i> flush() -> None |
|
2002 | 2008 | o> bufferedreadline() -> 3: |
|
2003 | 2009 | o> 15\n |
|
2004 | 2010 | o> bufferedread(15) -> 15: publishing\tTrue |
|
2005 | 2011 | response: { |
|
2006 | 2012 | b'publishing': b'True' |
|
2007 | 2013 | } |
|
2008 | 2014 | |
|
2009 | 2015 | Setting public phase via pushkey |
|
2010 | 2016 | |
|
2011 | 2017 | $ hg phase --draft --force -r . |
|
2012 | 2018 | |
|
2013 | 2019 | $ debugwireproto << EOF |
|
2014 | 2020 | > command pushkey |
|
2015 | 2021 | > namespace phases |
|
2016 | 2022 | > key 7127240a084fd9dc86fe8d1f98e26229161ec82b |
|
2017 | 2023 | > old 1 |
|
2018 | 2024 | > new 0 |
|
2019 | 2025 | > EOF |
|
2020 | 2026 | testing ssh1 |
|
2021 | 2027 | creating ssh peer from handshake results |
|
2022 | 2028 | i> write(104) -> 104: |
|
2023 | 2029 | i> hello\n |
|
2024 | 2030 | i> between\n |
|
2025 | 2031 | i> pairs 81\n |
|
2026 | 2032 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
2027 | 2033 | i> flush() -> None |
|
2028 | 2034 | o> readline() -> 4: |
|
2029 |
o> 4 |
|
|
2030 |
o> readline() -> 4 |
|
|
2031 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
2035 | o> 440\n | |
|
2036 | o> readline() -> 440: | |
|
2037 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
2032 | 2038 | o> readline() -> 2: |
|
2033 | 2039 | o> 1\n |
|
2034 | 2040 | o> readline() -> 1: |
|
2035 | 2041 | o> \n |
|
2036 | 2042 | sending pushkey command |
|
2037 | 2043 | i> write(8) -> 8: |
|
2038 | 2044 | i> pushkey\n |
|
2039 | 2045 | i> write(7) -> 7: |
|
2040 | 2046 | i> key 40\n |
|
2041 | 2047 | i> write(40) -> 40: 7127240a084fd9dc86fe8d1f98e26229161ec82b |
|
2042 | 2048 | i> write(12) -> 12: |
|
2043 | 2049 | i> namespace 6\n |
|
2044 | 2050 | i> write(6) -> 6: phases |
|
2045 | 2051 | i> write(6) -> 6: |
|
2046 | 2052 | i> new 1\n |
|
2047 | 2053 | i> write(1) -> 1: 0 |
|
2048 | 2054 | i> write(6) -> 6: |
|
2049 | 2055 | i> old 1\n |
|
2050 | 2056 | i> write(1) -> 1: 1 |
|
2051 | 2057 | i> flush() -> None |
|
2052 | 2058 | o> bufferedreadline() -> 2: |
|
2053 | 2059 | o> 2\n |
|
2054 | 2060 | o> bufferedread(2) -> 2: |
|
2055 | 2061 | o> 1\n |
|
2056 | 2062 | response: True |
|
2057 | 2063 | |
|
2058 | 2064 | testing ssh2 |
|
2059 | 2065 | creating ssh peer from handshake results |
|
2060 | 2066 | i> write(171) -> 171: |
|
2061 | 2067 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
2062 | 2068 | i> hello\n |
|
2063 | 2069 | i> between\n |
|
2064 | 2070 | i> pairs 81\n |
|
2065 | 2071 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
2066 | 2072 | i> flush() -> None |
|
2067 | 2073 | o> readline() -> 62: |
|
2068 | 2074 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
2069 | 2075 | o> readline() -> 4: |
|
2070 |
o> 4 |
|
|
2071 |
o> read(4 |
|
|
2076 | o> 439\n | |
|
2077 | o> read(439) -> 439: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
2072 | 2078 | o> read(1) -> 1: |
|
2073 | 2079 | o> \n |
|
2074 | 2080 | sending pushkey command |
|
2075 | 2081 | i> write(8) -> 8: |
|
2076 | 2082 | i> pushkey\n |
|
2077 | 2083 | i> write(7) -> 7: |
|
2078 | 2084 | i> key 40\n |
|
2079 | 2085 | i> write(40) -> 40: 7127240a084fd9dc86fe8d1f98e26229161ec82b |
|
2080 | 2086 | i> write(12) -> 12: |
|
2081 | 2087 | i> namespace 6\n |
|
2082 | 2088 | i> write(6) -> 6: phases |
|
2083 | 2089 | i> write(6) -> 6: |
|
2084 | 2090 | i> new 1\n |
|
2085 | 2091 | i> write(1) -> 1: 0 |
|
2086 | 2092 | i> write(6) -> 6: |
|
2087 | 2093 | i> old 1\n |
|
2088 | 2094 | i> write(1) -> 1: 1 |
|
2089 | 2095 | i> flush() -> None |
|
2090 | 2096 | o> bufferedreadline() -> 2: |
|
2091 | 2097 | o> 2\n |
|
2092 | 2098 | o> bufferedread(2) -> 2: |
|
2093 | 2099 | o> 1\n |
|
2094 | 2100 | response: True |
|
2095 | 2101 | |
|
2096 | 2102 | $ hg phase . |
|
2097 | 2103 | 4: public |
|
2098 | 2104 | |
|
2099 | 2105 | $ cd .. |
|
2100 | 2106 | |
|
2101 | 2107 | Test batching of requests |
|
2102 | 2108 | |
|
2103 | 2109 | $ hg init batching |
|
2104 | 2110 | $ cd batching |
|
2105 | 2111 | $ echo 0 > foo |
|
2106 | 2112 | $ hg add foo |
|
2107 | 2113 | $ hg -q commit -m initial |
|
2108 | 2114 | $ hg phase --public |
|
2109 | 2115 | $ echo 1 > foo |
|
2110 | 2116 | $ hg commit -m 'commit 1' |
|
2111 | 2117 | $ hg -q up 0 |
|
2112 | 2118 | $ echo 2 > foo |
|
2113 | 2119 | $ hg commit -m 'commit 2' |
|
2114 | 2120 | created new head |
|
2115 | 2121 | $ hg book -r 1 bookA |
|
2116 | 2122 | $ hg book -r 2 bookB |
|
2117 | 2123 | |
|
2118 | 2124 | $ debugwireproto << EOF |
|
2119 | 2125 | > batchbegin |
|
2120 | 2126 | > command heads |
|
2121 | 2127 | > command listkeys |
|
2122 | 2128 | > namespace bookmarks |
|
2123 | 2129 | > command listkeys |
|
2124 | 2130 | > namespace phases |
|
2125 | 2131 | > batchsubmit |
|
2126 | 2132 | > EOF |
|
2127 | 2133 | testing ssh1 |
|
2128 | 2134 | creating ssh peer from handshake results |
|
2129 | 2135 | i> write(104) -> 104: |
|
2130 | 2136 | i> hello\n |
|
2131 | 2137 | i> between\n |
|
2132 | 2138 | i> pairs 81\n |
|
2133 | 2139 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
2134 | 2140 | i> flush() -> None |
|
2135 | 2141 | o> readline() -> 4: |
|
2136 |
o> 4 |
|
|
2137 |
o> readline() -> 4 |
|
|
2138 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
2142 | o> 440\n | |
|
2143 | o> readline() -> 440: | |
|
2144 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n | |
|
2139 | 2145 | o> readline() -> 2: |
|
2140 | 2146 | o> 1\n |
|
2141 | 2147 | o> readline() -> 1: |
|
2142 | 2148 | o> \n |
|
2143 | 2149 | sending batch with 3 sub-commands |
|
2144 | 2150 | i> write(6) -> 6: |
|
2145 | 2151 | i> batch\n |
|
2146 | 2152 | i> write(4) -> 4: |
|
2147 | 2153 | i> * 0\n |
|
2148 | 2154 | i> write(8) -> 8: |
|
2149 | 2155 | i> cmds 61\n |
|
2150 | 2156 | i> write(61) -> 61: heads ;listkeys namespace=bookmarks;listkeys namespace=phases |
|
2151 | 2157 | i> flush() -> None |
|
2152 | 2158 | o> bufferedreadline() -> 4: |
|
2153 | 2159 | o> 278\n |
|
2154 | 2160 | o> bufferedread(278) -> 278: |
|
2155 | 2161 | o> bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n |
|
2156 | 2162 | o> ;bookA\t4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n |
|
2157 | 2163 | o> bookB\tbfebe6bd38eebc6f8202e419c1171268987ea6a6;4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\t1\n |
|
2158 | 2164 | o> bfebe6bd38eebc6f8202e419c1171268987ea6a6\t1\n |
|
2159 | 2165 | o> publishing\tTrue |
|
2160 | 2166 | response #0: bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n |
|
2161 | 2167 | response #1: bookA\t4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\nbookB\tbfebe6bd38eebc6f8202e419c1171268987ea6a6 |
|
2162 | 2168 | response #2: 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\t1\nbfebe6bd38eebc6f8202e419c1171268987ea6a6\t1\npublishing\tTrue |
|
2163 | 2169 | |
|
2164 | 2170 | testing ssh2 |
|
2165 | 2171 | creating ssh peer from handshake results |
|
2166 | 2172 | i> write(171) -> 171: |
|
2167 | 2173 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
2168 | 2174 | i> hello\n |
|
2169 | 2175 | i> between\n |
|
2170 | 2176 | i> pairs 81\n |
|
2171 | 2177 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
2172 | 2178 | i> flush() -> None |
|
2173 | 2179 | o> readline() -> 62: |
|
2174 | 2180 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
2175 | 2181 | o> readline() -> 4: |
|
2176 |
o> 4 |
|
|
2177 |
o> read(4 |
|
|
2182 | o> 439\n | |
|
2183 | o> read(439) -> 439: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
|
2178 | 2184 | o> read(1) -> 1: |
|
2179 | 2185 | o> \n |
|
2180 | 2186 | sending batch with 3 sub-commands |
|
2181 | 2187 | i> write(6) -> 6: |
|
2182 | 2188 | i> batch\n |
|
2183 | 2189 | i> write(4) -> 4: |
|
2184 | 2190 | i> * 0\n |
|
2185 | 2191 | i> write(8) -> 8: |
|
2186 | 2192 | i> cmds 61\n |
|
2187 | 2193 | i> write(61) -> 61: heads ;listkeys namespace=bookmarks;listkeys namespace=phases |
|
2188 | 2194 | i> flush() -> None |
|
2189 | 2195 | o> bufferedreadline() -> 4: |
|
2190 | 2196 | o> 278\n |
|
2191 | 2197 | o> bufferedread(278) -> 278: |
|
2192 | 2198 | o> bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n |
|
2193 | 2199 | o> ;bookA\t4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n |
|
2194 | 2200 | o> bookB\tbfebe6bd38eebc6f8202e419c1171268987ea6a6;4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\t1\n |
|
2195 | 2201 | o> bfebe6bd38eebc6f8202e419c1171268987ea6a6\t1\n |
|
2196 | 2202 | o> publishing\tTrue |
|
2197 | 2203 | response #0: bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n |
|
2198 | 2204 | response #1: bookA\t4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\nbookB\tbfebe6bd38eebc6f8202e419c1171268987ea6a6 |
|
2199 | 2205 | response #2: 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\t1\nbfebe6bd38eebc6f8202e419c1171268987ea6a6\t1\npublishing\tTrue |
General Comments 0
You need to be logged in to leave comments.
Login now