##// END OF EJS Templates
tests: stabilize ssh tests on Windows...
Matt Harbison -
r36007:c64b9adf default
parent child Browse files
Show More
@@ -1,404 +1,405 b''
1 $ cat << EOF >> $HGRCPATH
1 $ cat << EOF >> $HGRCPATH
2 > [ui]
2 > [ui]
3 > interactive=yes
3 > interactive=yes
4 > [format]
4 > [format]
5 > usegeneraldelta=yes
5 > usegeneraldelta=yes
6 > EOF
6 > EOF
7
7
8 $ hg init debugrevlog
8 $ hg init debugrevlog
9 $ cd debugrevlog
9 $ cd debugrevlog
10 $ echo a > a
10 $ echo a > a
11 $ hg ci -Am adda
11 $ hg ci -Am adda
12 adding a
12 adding a
13 $ hg debugrevlog -m
13 $ hg debugrevlog -m
14 format : 1
14 format : 1
15 flags : inline, generaldelta
15 flags : inline, generaldelta
16
16
17 revisions : 1
17 revisions : 1
18 merges : 0 ( 0.00%)
18 merges : 0 ( 0.00%)
19 normal : 1 (100.00%)
19 normal : 1 (100.00%)
20 revisions : 1
20 revisions : 1
21 full : 1 (100.00%)
21 full : 1 (100.00%)
22 deltas : 0 ( 0.00%)
22 deltas : 0 ( 0.00%)
23 revision size : 44
23 revision size : 44
24 full : 44 (100.00%)
24 full : 44 (100.00%)
25 deltas : 0 ( 0.00%)
25 deltas : 0 ( 0.00%)
26
26
27 chunks : 1
27 chunks : 1
28 0x75 (u) : 1 (100.00%)
28 0x75 (u) : 1 (100.00%)
29 chunks size : 44
29 chunks size : 44
30 0x75 (u) : 44 (100.00%)
30 0x75 (u) : 44 (100.00%)
31
31
32 avg chain length : 0
32 avg chain length : 0
33 max chain length : 0
33 max chain length : 0
34 max chain reach : 44
34 max chain reach : 44
35 compression ratio : 0
35 compression ratio : 0
36
36
37 uncompressed data size (min/max/avg) : 43 / 43 / 43
37 uncompressed data size (min/max/avg) : 43 / 43 / 43
38 full revision size (min/max/avg) : 44 / 44 / 44
38 full revision size (min/max/avg) : 44 / 44 / 44
39 delta size (min/max/avg) : 0 / 0 / 0
39 delta size (min/max/avg) : 0 / 0 / 0
40
40
41 Test debugindex, with and without the --debug flag
41 Test debugindex, with and without the --debug flag
42 $ hg debugindex a
42 $ hg debugindex a
43 rev offset length ..... linkrev nodeid p1 p2 (re)
43 rev offset length ..... linkrev nodeid p1 p2 (re)
44 0 0 3 .... 0 b789fdd96dc2 000000000000 000000000000 (re)
44 0 0 3 .... 0 b789fdd96dc2 000000000000 000000000000 (re)
45 $ hg --debug debugindex a
45 $ hg --debug debugindex a
46 rev offset length ..... linkrev nodeid p1 p2 (re)
46 rev offset length ..... linkrev nodeid p1 p2 (re)
47 0 0 3 .... 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 (re)
47 0 0 3 .... 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 (re)
48 $ hg debugindex -f 1 a
48 $ hg debugindex -f 1 a
49 rev flag offset length size ..... link p1 p2 nodeid (re)
49 rev flag offset length size ..... link p1 p2 nodeid (re)
50 0 0000 0 3 2 .... 0 -1 -1 b789fdd96dc2 (re)
50 0 0000 0 3 2 .... 0 -1 -1 b789fdd96dc2 (re)
51 $ hg --debug debugindex -f 1 a
51 $ hg --debug debugindex -f 1 a
52 rev flag offset length size ..... link p1 p2 nodeid (re)
52 rev flag offset length size ..... link p1 p2 nodeid (re)
53 0 0000 0 3 2 .... 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 (re)
53 0 0000 0 3 2 .... 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 (re)
54
54
55 debugdelta chain basic output
55 debugdelta chain basic output
56
56
57 $ hg debugdeltachain -m
57 $ hg debugdeltachain -m
58 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
58 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
59 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000
59 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000
60
60
61 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
61 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
62 0 1 1
62 0 1 1
63
63
64 $ hg debugdeltachain -m -Tjson
64 $ hg debugdeltachain -m -Tjson
65 [
65 [
66 {
66 {
67 "chainid": 1,
67 "chainid": 1,
68 "chainlen": 1,
68 "chainlen": 1,
69 "chainratio": 1.02325581395,
69 "chainratio": 1.02325581395,
70 "chainsize": 44,
70 "chainsize": 44,
71 "compsize": 44,
71 "compsize": 44,
72 "deltatype": "base",
72 "deltatype": "base",
73 "extradist": 0,
73 "extradist": 0,
74 "extraratio": 0.0,
74 "extraratio": 0.0,
75 "lindist": 44,
75 "lindist": 44,
76 "prevrev": -1,
76 "prevrev": -1,
77 "rev": 0,
77 "rev": 0,
78 "uncompsize": 43
78 "uncompsize": 43
79 }
79 }
80 ]
80 ]
81
81
82 debugdelta chain with sparse read enabled
82 debugdelta chain with sparse read enabled
83
83
84 $ cat >> $HGRCPATH <<EOF
84 $ cat >> $HGRCPATH <<EOF
85 > [experimental]
85 > [experimental]
86 > sparse-read = True
86 > sparse-read = True
87 > EOF
87 > EOF
88 $ hg debugdeltachain -m
88 $ hg debugdeltachain -m
89 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
89 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
90 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
90 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
91
91
92 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
92 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
93 0 1 1 44 44 1.0
93 0 1 1 44 44 1.0
94
94
95 $ hg debugdeltachain -m -Tjson
95 $ hg debugdeltachain -m -Tjson
96 [
96 [
97 {
97 {
98 "chainid": 1,
98 "chainid": 1,
99 "chainlen": 1,
99 "chainlen": 1,
100 "chainratio": 1.02325581395,
100 "chainratio": 1.02325581395,
101 "chainsize": 44,
101 "chainsize": 44,
102 "compsize": 44,
102 "compsize": 44,
103 "deltatype": "base",
103 "deltatype": "base",
104 "extradist": 0,
104 "extradist": 0,
105 "extraratio": 0.0,
105 "extraratio": 0.0,
106 "largestblock": 44,
106 "largestblock": 44,
107 "lindist": 44,
107 "lindist": 44,
108 "prevrev": -1,
108 "prevrev": -1,
109 "readdensity": 1.0,
109 "readdensity": 1.0,
110 "readsize": 44,
110 "readsize": 44,
111 "rev": 0,
111 "rev": 0,
112 "srchunks": 1,
112 "srchunks": 1,
113 "uncompsize": 43
113 "uncompsize": 43
114 }
114 }
115 ]
115 ]
116
116
117 $ printf "This test checks things.\n" >> a
117 $ printf "This test checks things.\n" >> a
118 $ hg ci -m a
118 $ hg ci -m a
119 $ hg branch other
119 $ hg branch other
120 marked working directory as branch other
120 marked working directory as branch other
121 (branches are permanent and global, did you want a bookmark?)
121 (branches are permanent and global, did you want a bookmark?)
122 $ for i in `$TESTDIR/seq.py 5`; do
122 $ for i in `$TESTDIR/seq.py 5`; do
123 > printf "shorter ${i}" >> a
123 > printf "shorter ${i}" >> a
124 > hg ci -m "a other:$i"
124 > hg ci -m "a other:$i"
125 > hg up -q default
125 > hg up -q default
126 > printf "for the branch default we want longer chains: ${i}" >> a
126 > printf "for the branch default we want longer chains: ${i}" >> a
127 > hg ci -m "a default:$i"
127 > hg ci -m "a default:$i"
128 > hg up -q other
128 > hg up -q other
129 > done
129 > done
130 $ hg debugdeltachain a -T '{rev} {srchunks}\n' \
130 $ hg debugdeltachain a -T '{rev} {srchunks}\n' \
131 > --config experimental.sparse-read.density-threshold=0.50 \
131 > --config experimental.sparse-read.density-threshold=0.50 \
132 > --config experimental.sparse-read.min-gap-size=0
132 > --config experimental.sparse-read.min-gap-size=0
133 0 1
133 0 1
134 1 1
134 1 1
135 2 1
135 2 1
136 3 1
136 3 1
137 4 1
137 4 1
138 5 1
138 5 1
139 6 1
139 6 1
140 7 1
140 7 1
141 8 1
141 8 1
142 9 1
142 9 1
143 10 2
143 10 2
144 11 1
144 11 1
145 $ hg --config extensions.strip= strip --no-backup -r 1
145 $ hg --config extensions.strip= strip --no-backup -r 1
146 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
147
147
148 Test max chain len
148 Test max chain len
149 $ cat >> $HGRCPATH << EOF
149 $ cat >> $HGRCPATH << EOF
150 > [format]
150 > [format]
151 > maxchainlen=4
151 > maxchainlen=4
152 > EOF
152 > EOF
153
153
154 $ printf "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
154 $ printf "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
155 $ hg ci -m a
155 $ hg ci -m a
156 $ printf "b\n" >> a
156 $ printf "b\n" >> a
157 $ hg ci -m a
157 $ hg ci -m a
158 $ printf "c\n" >> a
158 $ printf "c\n" >> a
159 $ hg ci -m a
159 $ hg ci -m a
160 $ printf "d\n" >> a
160 $ printf "d\n" >> a
161 $ hg ci -m a
161 $ hg ci -m a
162 $ printf "e\n" >> a
162 $ printf "e\n" >> a
163 $ hg ci -m a
163 $ hg ci -m a
164 $ printf "f\n" >> a
164 $ printf "f\n" >> a
165 $ hg ci -m a
165 $ hg ci -m a
166 $ printf 'g\n' >> a
166 $ printf 'g\n' >> a
167 $ hg ci -m a
167 $ hg ci -m a
168 $ printf 'h\n' >> a
168 $ printf 'h\n' >> a
169 $ hg ci -m a
169 $ hg ci -m a
170 $ hg debugrevlog -d a
170 $ hg debugrevlog -d a
171 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
171 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
172 0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob)
172 0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob)
173 1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob)
173 1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob)
174 2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
174 2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
175 3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
175 3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
176 4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob)
176 4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob)
177 5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob)
177 5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob)
178 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob)
178 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob)
179 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
179 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
180 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
180 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
181
181
182 Test debuglocks command:
182 Test debuglocks command:
183
183
184 $ hg debuglocks
184 $ hg debuglocks
185 lock: free
185 lock: free
186 wlock: free
186 wlock: free
187
187
188 * Test setting the lock
188 * Test setting the lock
189
189
190 waitlock <file> will wait for file to be created. If it isn't in a reasonable
190 waitlock <file> will wait for file to be created. If it isn't in a reasonable
191 amount of time, displays error message and returns 1
191 amount of time, displays error message and returns 1
192 $ waitlock() {
192 $ waitlock() {
193 > start=`date +%s`
193 > start=`date +%s`
194 > timeout=5
194 > timeout=5
195 > while [ \( ! -f $1 \) -a \( ! -L $1 \) ]; do
195 > while [ \( ! -f $1 \) -a \( ! -L $1 \) ]; do
196 > now=`date +%s`
196 > now=`date +%s`
197 > if [ "`expr $now - $start`" -gt $timeout ]; then
197 > if [ "`expr $now - $start`" -gt $timeout ]; then
198 > echo "timeout: $1 was not created in $timeout seconds"
198 > echo "timeout: $1 was not created in $timeout seconds"
199 > return 1
199 > return 1
200 > fi
200 > fi
201 > sleep 0.1
201 > sleep 0.1
202 > done
202 > done
203 > }
203 > }
204 $ dolock() {
204 $ dolock() {
205 > {
205 > {
206 > waitlock .hg/unlock
206 > waitlock .hg/unlock
207 > rm -f .hg/unlock
207 > rm -f .hg/unlock
208 > echo y
208 > echo y
209 > } | hg debuglocks "$@" > /dev/null
209 > } | hg debuglocks "$@" > /dev/null
210 > }
210 > }
211 $ dolock -s &
211 $ dolock -s &
212 $ waitlock .hg/store/lock
212 $ waitlock .hg/store/lock
213
213
214 $ hg debuglocks
214 $ hg debuglocks
215 lock: user *, process * (*s) (glob)
215 lock: user *, process * (*s) (glob)
216 wlock: free
216 wlock: free
217 [1]
217 [1]
218 $ touch .hg/unlock
218 $ touch .hg/unlock
219 $ wait
219 $ wait
220 $ [ -f .hg/store/lock ] || echo "There is no lock"
220 $ [ -f .hg/store/lock ] || echo "There is no lock"
221 There is no lock
221 There is no lock
222
222
223 * Test setting the wlock
223 * Test setting the wlock
224
224
225 $ dolock -S &
225 $ dolock -S &
226 $ waitlock .hg/wlock
226 $ waitlock .hg/wlock
227
227
228 $ hg debuglocks
228 $ hg debuglocks
229 lock: free
229 lock: free
230 wlock: user *, process * (*s) (glob)
230 wlock: user *, process * (*s) (glob)
231 [1]
231 [1]
232 $ touch .hg/unlock
232 $ touch .hg/unlock
233 $ wait
233 $ wait
234 $ [ -f .hg/wlock ] || echo "There is no wlock"
234 $ [ -f .hg/wlock ] || echo "There is no wlock"
235 There is no wlock
235 There is no wlock
236
236
237 * Test setting both locks
237 * Test setting both locks
238
238
239 $ dolock -Ss &
239 $ dolock -Ss &
240 $ waitlock .hg/wlock && waitlock .hg/store/lock
240 $ waitlock .hg/wlock && waitlock .hg/store/lock
241
241
242 $ hg debuglocks
242 $ hg debuglocks
243 lock: user *, process * (*s) (glob)
243 lock: user *, process * (*s) (glob)
244 wlock: user *, process * (*s) (glob)
244 wlock: user *, process * (*s) (glob)
245 [2]
245 [2]
246
246
247 * Test failing to set a lock
247 * Test failing to set a lock
248
248
249 $ hg debuglocks -s
249 $ hg debuglocks -s
250 abort: lock is already held
250 abort: lock is already held
251 [255]
251 [255]
252
252
253 $ hg debuglocks -S
253 $ hg debuglocks -S
254 abort: wlock is already held
254 abort: wlock is already held
255 [255]
255 [255]
256
256
257 $ touch .hg/unlock
257 $ touch .hg/unlock
258 $ wait
258 $ wait
259
259
260 $ hg debuglocks
260 $ hg debuglocks
261 lock: free
261 lock: free
262 wlock: free
262 wlock: free
263
263
264 * Test forcing the lock
264 * Test forcing the lock
265
265
266 $ dolock -s &
266 $ dolock -s &
267 $ waitlock .hg/store/lock
267 $ waitlock .hg/store/lock
268
268
269 $ hg debuglocks
269 $ hg debuglocks
270 lock: user *, process * (*s) (glob)
270 lock: user *, process * (*s) (glob)
271 wlock: free
271 wlock: free
272 [1]
272 [1]
273
273
274 $ hg debuglocks -L
274 $ hg debuglocks -L
275
275
276 $ hg debuglocks
276 $ hg debuglocks
277 lock: free
277 lock: free
278 wlock: free
278 wlock: free
279
279
280 $ touch .hg/unlock
280 $ touch .hg/unlock
281 $ wait
281 $ wait
282
282
283 * Test forcing the wlock
283 * Test forcing the wlock
284
284
285 $ dolock -S &
285 $ dolock -S &
286 $ waitlock .hg/wlock
286 $ waitlock .hg/wlock
287
287
288 $ hg debuglocks
288 $ hg debuglocks
289 lock: free
289 lock: free
290 wlock: user *, process * (*s) (glob)
290 wlock: user *, process * (*s) (glob)
291 [1]
291 [1]
292
292
293 $ hg debuglocks -W
293 $ hg debuglocks -W
294
294
295 $ hg debuglocks
295 $ hg debuglocks
296 lock: free
296 lock: free
297 wlock: free
297 wlock: free
298
298
299 $ touch .hg/unlock
299 $ touch .hg/unlock
300 $ wait
300 $ wait
301
301
302 Test WdirUnsupported exception
302 Test WdirUnsupported exception
303
303
304 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
304 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
305 abort: working directory revision cannot be specified
305 abort: working directory revision cannot be specified
306 [255]
306 [255]
307
307
308 Test cache warming command
308 Test cache warming command
309
309
310 $ rm -rf .hg/cache/
310 $ rm -rf .hg/cache/
311 $ hg debugupdatecaches --debug
311 $ hg debugupdatecaches --debug
312 updating the branch cache
312 updating the branch cache
313 $ ls -r .hg/cache/*
313 $ ls -r .hg/cache/*
314 .hg/cache/rbc-revs-v1
314 .hg/cache/rbc-revs-v1
315 .hg/cache/rbc-names-v1
315 .hg/cache/rbc-names-v1
316 .hg/cache/branch2-served
316 .hg/cache/branch2-served
317
317
318 $ cd ..
318 $ cd ..
319
319
320 Test internal debugstacktrace command
320 Test internal debugstacktrace command
321
321
322 $ cat > debugstacktrace.py << EOF
322 $ cat > debugstacktrace.py << EOF
323 > from __future__ import absolute_import
323 > from __future__ import absolute_import
324 > import sys
324 > import sys
325 > from mercurial import util
325 > from mercurial import util
326 > def f():
326 > def f():
327 > util.debugstacktrace(f=sys.stdout)
327 > util.debugstacktrace(f=sys.stdout)
328 > g()
328 > g()
329 > def g():
329 > def g():
330 > util.dst('hello from g\\n', skip=1)
330 > util.dst('hello from g\\n', skip=1)
331 > h()
331 > h()
332 > def h():
332 > def h():
333 > util.dst('hi ...\\nfrom h hidden in g', 1, depth=2)
333 > util.dst('hi ...\\nfrom h hidden in g', 1, depth=2)
334 > f()
334 > f()
335 > EOF
335 > EOF
336 $ $PYTHON debugstacktrace.py
336 $ $PYTHON debugstacktrace.py
337 stacktrace at:
337 stacktrace at:
338 debugstacktrace.py:12 in * (glob)
338 debugstacktrace.py:12 in * (glob)
339 debugstacktrace.py:5 in f
339 debugstacktrace.py:5 in f
340 hello from g at:
340 hello from g at:
341 debugstacktrace.py:12 in * (glob)
341 debugstacktrace.py:12 in * (glob)
342 debugstacktrace.py:6 in f
342 debugstacktrace.py:6 in f
343 hi ...
343 hi ...
344 from h hidden in g at:
344 from h hidden in g at:
345 debugstacktrace.py:6 in f
345 debugstacktrace.py:6 in f
346 debugstacktrace.py:9 in g
346 debugstacktrace.py:9 in g
347
347
348 Test debugcapabilities command:
348 Test debugcapabilities command:
349
349
350 $ hg debugcapabilities ./debugrevlog/
350 $ hg debugcapabilities ./debugrevlog/
351 Main capabilities:
351 Main capabilities:
352 branchmap
352 branchmap
353 $USUAL_BUNDLE2_CAPS$
353 $USUAL_BUNDLE2_CAPS$
354 getbundle
354 getbundle
355 known
355 known
356 lookup
356 lookup
357 pushkey
357 pushkey
358 unbundle
358 unbundle
359 Bundle2 capabilities:
359 Bundle2 capabilities:
360 HG20
360 HG20
361 bookmarks
361 bookmarks
362 changegroup
362 changegroup
363 01
363 01
364 02
364 02
365 digests
365 digests
366 md5
366 md5
367 sha1
367 sha1
368 sha512
368 sha512
369 error
369 error
370 abort
370 abort
371 unsupportedcontent
371 unsupportedcontent
372 pushraced
372 pushraced
373 pushkey
373 pushkey
374 hgtagsfnodes
374 hgtagsfnodes
375 listkeys
375 listkeys
376 phases
376 phases
377 heads
377 heads
378 pushkey
378 pushkey
379 remote-changegroup
379 remote-changegroup
380 http
380 http
381 https
381 https
382 stream
382 stream
383 v2
383 v2
384
384
385 Test debugpeer
385 Test debugpeer
386
386
387 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" debugpeer ssh://user@dummy/debugrevlog
387 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" debugpeer ssh://user@dummy/debugrevlog
388 url: ssh://user@dummy/debugrevlog
388 url: ssh://user@dummy/debugrevlog
389 local: no
389 local: no
390 pushable: yes
390 pushable: yes
391
391
392 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" --debug debugpeer ssh://user@dummy/debugrevlog
392 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" --debug debugpeer ssh://user@dummy/debugrevlog
393 running "*" "*/tests/dummyssh" 'user@dummy' 'hg -R debugrevlog serve --stdio' (glob)
393 running "*" "*/tests/dummyssh" 'user@dummy' 'hg -R debugrevlog serve --stdio' (glob) (no-windows !)
394 running "*" "*\tests/dummyssh" "user@dummy" "hg -R debugrevlog serve --stdio" (glob) (windows !)
394 devel-peer-request: hello
395 devel-peer-request: hello
395 sending hello command
396 sending hello command
396 devel-peer-request: between
397 devel-peer-request: between
397 devel-peer-request: pairs: 81 bytes
398 devel-peer-request: pairs: 81 bytes
398 sending between command
399 sending between command
399 remote: 384
400 remote: 384
400 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
401 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
401 remote: 1
402 remote: 1
402 url: ssh://user@dummy/debugrevlog
403 url: ssh://user@dummy/debugrevlog
403 local: no
404 local: no
404 pushable: yes
405 pushable: yes
@@ -1,494 +1,502 b''
1 $ cat >> $HGRCPATH << EOF
1 $ cat >> $HGRCPATH << EOF
2 > [ui]
2 > [ui]
3 > ssh = $PYTHON "$TESTDIR/dummyssh"
3 > ssh = $PYTHON "$TESTDIR/dummyssh"
4 > [devel]
4 > [devel]
5 > debug.peer-request = true
5 > debug.peer-request = true
6 > [extensions]
6 > [extensions]
7 > sshprotoext = $TESTDIR/sshprotoext.py
7 > sshprotoext = $TESTDIR/sshprotoext.py
8 > EOF
8 > EOF
9
9
10 $ hg init server
10 $ hg init server
11 $ cd server
11 $ cd server
12 $ echo 0 > foo
12 $ echo 0 > foo
13 $ hg -q add foo
13 $ hg -q add foo
14 $ hg commit -m initial
14 $ hg commit -m initial
15 $ cd ..
15 $ cd ..
16
16
17 Test a normal behaving server, for sanity
17 Test a normal behaving server, for sanity
18
18
19 $ hg --debug debugpeer ssh://user@dummy/server
19 $ hg --debug debugpeer ssh://user@dummy/server
20 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob)
20 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
21 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
21 devel-peer-request: hello
22 devel-peer-request: hello
22 sending hello command
23 sending hello command
23 devel-peer-request: between
24 devel-peer-request: between
24 devel-peer-request: pairs: 81 bytes
25 devel-peer-request: pairs: 81 bytes
25 sending between command
26 sending between command
26 remote: 384
27 remote: 384
27 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
28 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
28 remote: 1
29 remote: 1
29 url: ssh://user@dummy/server
30 url: ssh://user@dummy/server
30 local: no
31 local: no
31 pushable: yes
32 pushable: yes
32
33
33 Server should answer the "hello" command in isolation
34 Server should answer the "hello" command in isolation
34
35
35 $ hg -R server serve --stdio << EOF
36 $ hg -R server serve --stdio << EOF
36 > hello
37 > hello
37 > EOF
38 > EOF
38 384
39 384
39 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
40 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
40
41
41 >=0.9.1 clients send a "hello" + "between" for the null range as part of handshake.
42 >=0.9.1 clients send a "hello" + "between" for the null range as part of handshake.
42 Server should reply with capabilities and should send "1\n\n" as a successful
43 Server should reply with capabilities and should send "1\n\n" as a successful
43 reply with empty response to the "between".
44 reply with empty response to the "between".
44
45
45 $ hg -R server serve --stdio << EOF
46 $ hg -R server serve --stdio << EOF
46 > hello
47 > hello
47 > between
48 > between
48 > pairs 81
49 > pairs 81
49 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
50 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
50 > EOF
51 > EOF
51 384
52 384
52 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
53 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
53 1
54 1
54
55
55
56
56 SSH banner is not printed by default, ignored by clients
57 SSH banner is not printed by default, ignored by clients
57
58
58 $ SSHSERVERMODE=banner hg debugpeer ssh://user@dummy/server
59 $ SSHSERVERMODE=banner hg debugpeer ssh://user@dummy/server
59 url: ssh://user@dummy/server
60 url: ssh://user@dummy/server
60 local: no
61 local: no
61 pushable: yes
62 pushable: yes
62
63
63 --debug will print the banner
64 --debug will print the banner
64
65
65 $ SSHSERVERMODE=banner hg --debug debugpeer ssh://user@dummy/server
66 $ SSHSERVERMODE=banner hg --debug debugpeer ssh://user@dummy/server
66 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob)
67 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
68 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
67 devel-peer-request: hello
69 devel-peer-request: hello
68 sending hello command
70 sending hello command
69 devel-peer-request: between
71 devel-peer-request: between
70 devel-peer-request: pairs: 81 bytes
72 devel-peer-request: pairs: 81 bytes
71 sending between command
73 sending between command
72 remote: banner: line 0
74 remote: banner: line 0
73 remote: banner: line 1
75 remote: banner: line 1
74 remote: banner: line 2
76 remote: banner: line 2
75 remote: banner: line 3
77 remote: banner: line 3
76 remote: banner: line 4
78 remote: banner: line 4
77 remote: banner: line 5
79 remote: banner: line 5
78 remote: banner: line 6
80 remote: banner: line 6
79 remote: banner: line 7
81 remote: banner: line 7
80 remote: banner: line 8
82 remote: banner: line 8
81 remote: banner: line 9
83 remote: banner: line 9
82 remote: 384
84 remote: 384
83 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
85 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
84 remote: 1
86 remote: 1
85 url: ssh://user@dummy/server
87 url: ssh://user@dummy/server
86 local: no
88 local: no
87 pushable: yes
89 pushable: yes
88
90
89 And test the banner with the raw protocol
91 And test the banner with the raw protocol
90
92
91 $ SSHSERVERMODE=banner hg -R server serve --stdio << EOF
93 $ SSHSERVERMODE=banner hg -R server serve --stdio << EOF
92 > hello
94 > hello
93 > between
95 > between
94 > pairs 81
96 > pairs 81
95 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
97 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
96 > EOF
98 > EOF
97 banner: line 0
99 banner: line 0
98 banner: line 1
100 banner: line 1
99 banner: line 2
101 banner: line 2
100 banner: line 3
102 banner: line 3
101 banner: line 4
103 banner: line 4
102 banner: line 5
104 banner: line 5
103 banner: line 6
105 banner: line 6
104 banner: line 7
106 banner: line 7
105 banner: line 8
107 banner: line 8
106 banner: line 9
108 banner: line 9
107 384
109 384
108 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
110 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
109 1
111 1
110
112
111
113
112 Connecting to a <0.9.1 server that doesn't support the hello command.
114 Connecting to a <0.9.1 server that doesn't support the hello command.
113 The client should refuse, as we dropped support for connecting to such
115 The client should refuse, as we dropped support for connecting to such
114 servers.
116 servers.
115
117
116 $ SSHSERVERMODE=no-hello hg --debug debugpeer ssh://user@dummy/server
118 $ SSHSERVERMODE=no-hello hg --debug debugpeer ssh://user@dummy/server
117 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob)
119 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
120 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
118 devel-peer-request: hello
121 devel-peer-request: hello
119 sending hello command
122 sending hello command
120 devel-peer-request: between
123 devel-peer-request: between
121 devel-peer-request: pairs: 81 bytes
124 devel-peer-request: pairs: 81 bytes
122 sending between command
125 sending between command
123 remote: 0
126 remote: 0
124 remote: 1
127 remote: 1
125 abort: no suitable response from remote hg!
128 abort: no suitable response from remote hg!
126 [255]
129 [255]
127
130
128 Sending an unknown command to the server results in an empty response to that command
131 Sending an unknown command to the server results in an empty response to that command
129
132
130 $ hg -R server serve --stdio << EOF
133 $ hg -R server serve --stdio << EOF
131 > pre-hello
134 > pre-hello
132 > hello
135 > hello
133 > between
136 > between
134 > pairs 81
137 > pairs 81
135 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
138 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
136 > EOF
139 > EOF
137 0
140 0
138 384
141 384
139 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
142 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
140 1
143 1
141
144
142
145
143 $ hg --config sshpeer.mode=extra-handshake-commands --config sshpeer.handshake-mode=pre-no-args --debug debugpeer ssh://user@dummy/server
146 $ hg --config sshpeer.mode=extra-handshake-commands --config sshpeer.handshake-mode=pre-no-args --debug debugpeer ssh://user@dummy/server
144 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob)
147 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
148 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
145 sending no-args command
149 sending no-args command
146 devel-peer-request: hello
150 devel-peer-request: hello
147 sending hello command
151 sending hello command
148 devel-peer-request: between
152 devel-peer-request: between
149 devel-peer-request: pairs: 81 bytes
153 devel-peer-request: pairs: 81 bytes
150 sending between command
154 sending between command
151 remote: 0
155 remote: 0
152 remote: 384
156 remote: 384
153 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
157 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
154 remote: 1
158 remote: 1
155 url: ssh://user@dummy/server
159 url: ssh://user@dummy/server
156 local: no
160 local: no
157 pushable: yes
161 pushable: yes
158
162
159 Send multiple unknown commands before hello
163 Send multiple unknown commands before hello
160
164
161 $ hg -R server serve --stdio << EOF
165 $ hg -R server serve --stdio << EOF
162 > unknown1
166 > unknown1
163 > unknown2
167 > unknown2
164 > unknown3
168 > unknown3
165 > hello
169 > hello
166 > between
170 > between
167 > pairs 81
171 > pairs 81
168 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
172 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
169 > EOF
173 > EOF
170 0
174 0
171 0
175 0
172 0
176 0
173 384
177 384
174 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
178 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
175 1
179 1
176
180
177
181
178 $ hg --config sshpeer.mode=extra-handshake-commands --config sshpeer.handshake-mode=pre-multiple-no-args --debug debugpeer ssh://user@dummy/server
182 $ hg --config sshpeer.mode=extra-handshake-commands --config sshpeer.handshake-mode=pre-multiple-no-args --debug debugpeer ssh://user@dummy/server
179 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob)
183 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
184 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
180 sending unknown1 command
185 sending unknown1 command
181 sending unknown2 command
186 sending unknown2 command
182 sending unknown3 command
187 sending unknown3 command
183 devel-peer-request: hello
188 devel-peer-request: hello
184 sending hello command
189 sending hello command
185 devel-peer-request: between
190 devel-peer-request: between
186 devel-peer-request: pairs: 81 bytes
191 devel-peer-request: pairs: 81 bytes
187 sending between command
192 sending between command
188 remote: 0
193 remote: 0
189 remote: 0
194 remote: 0
190 remote: 0
195 remote: 0
191 remote: 384
196 remote: 384
192 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
197 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
193 remote: 1
198 remote: 1
194 url: ssh://user@dummy/server
199 url: ssh://user@dummy/server
195 local: no
200 local: no
196 pushable: yes
201 pushable: yes
197
202
198 Send an unknown command before hello that has arguments
203 Send an unknown command before hello that has arguments
199
204
200 $ hg -R server serve --stdio << EOF
205 $ hg -R server serve --stdio << EOF
201 > with-args
206 > with-args
202 > foo 13
207 > foo 13
203 > value for foo
208 > value for foo
204 > bar 13
209 > bar 13
205 > value for bar
210 > value for bar
206 > hello
211 > hello
207 > between
212 > between
208 > pairs 81
213 > pairs 81
209 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
214 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
210 > EOF
215 > EOF
211 0
216 0
212 0
217 0
213 0
218 0
214 0
219 0
215 0
220 0
216 384
221 384
217 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
222 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
218 1
223 1
219
224
220
225
221 Send an unknown command having an argument that looks numeric
226 Send an unknown command having an argument that looks numeric
222
227
223 $ hg -R server serve --stdio << EOF
228 $ hg -R server serve --stdio << EOF
224 > unknown
229 > unknown
225 > foo 1
230 > foo 1
226 > 0
231 > 0
227 > hello
232 > hello
228 > between
233 > between
229 > pairs 81
234 > pairs 81
230 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
235 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
231 > EOF
236 > EOF
232 0
237 0
233 0
238 0
234 0
239 0
235 384
240 384
236 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
241 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
237 1
242 1
238
243
239
244
240 $ hg -R server serve --stdio << EOF
245 $ hg -R server serve --stdio << EOF
241 > unknown
246 > unknown
242 > foo 1
247 > foo 1
243 > 1
248 > 1
244 > hello
249 > hello
245 > between
250 > between
246 > pairs 81
251 > pairs 81
247 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
252 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
248 > EOF
253 > EOF
249 0
254 0
250 0
255 0
251 0
256 0
252 384
257 384
253 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
258 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
254 1
259 1
255
260
256
261
257 When sending a dict argument value, it is serialized to
262 When sending a dict argument value, it is serialized to
258 "<arg> <item count>" followed by "<key> <len>\n<value>" for each item
263 "<arg> <item count>" followed by "<key> <len>\n<value>" for each item
259 in the dict.
264 in the dict.
260
265
261 Dictionary value for unknown command
266 Dictionary value for unknown command
262
267
263 $ hg -R server serve --stdio << EOF
268 $ hg -R server serve --stdio << EOF
264 > unknown
269 > unknown
265 > dict 3
270 > dict 3
266 > key1 3
271 > key1 3
267 > foo
272 > foo
268 > key2 3
273 > key2 3
269 > bar
274 > bar
270 > key3 3
275 > key3 3
271 > baz
276 > baz
272 > hello
277 > hello
273 > EOF
278 > EOF
274 0
279 0
275 0
280 0
276 0
281 0
277 0
282 0
278 0
283 0
279 0
284 0
280 0
285 0
281 0
286 0
282 384
287 384
283 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
288 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
284
289
285 Incomplete dictionary send
290 Incomplete dictionary send
286
291
287 $ hg -R server serve --stdio << EOF
292 $ hg -R server serve --stdio << EOF
288 > unknown
293 > unknown
289 > dict 3
294 > dict 3
290 > key1 3
295 > key1 3
291 > foo
296 > foo
292 > EOF
297 > EOF
293 0
298 0
294 0
299 0
295 0
300 0
296 0
301 0
297
302
298 Incomplete value send
303 Incomplete value send
299
304
300 $ hg -R server serve --stdio << EOF
305 $ hg -R server serve --stdio << EOF
301 > unknown
306 > unknown
302 > dict 3
307 > dict 3
303 > key1 3
308 > key1 3
304 > fo
309 > fo
305 > EOF
310 > EOF
306 0
311 0
307 0
312 0
308 0
313 0
309 0
314 0
310
315
311 Send a command line with spaces
316 Send a command line with spaces
312
317
313 $ hg -R server serve --stdio << EOF
318 $ hg -R server serve --stdio << EOF
314 > unknown withspace
319 > unknown withspace
315 > hello
320 > hello
316 > between
321 > between
317 > pairs 81
322 > pairs 81
318 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
323 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
319 > EOF
324 > EOF
320 0
325 0
321 384
326 384
322 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
327 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
323 1
328 1
324
329
325
330
326 $ hg -R server serve --stdio << EOF
331 $ hg -R server serve --stdio << EOF
327 > unknown with multiple spaces
332 > unknown with multiple spaces
328 > hello
333 > hello
329 > between
334 > between
330 > pairs 81
335 > pairs 81
331 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
336 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
332 > EOF
337 > EOF
333 0
338 0
334 384
339 384
335 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
340 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
336 1
341 1
337
342
338
343
339 $ hg -R server serve --stdio << EOF
344 $ hg -R server serve --stdio << EOF
340 > unknown with spaces
345 > unknown with spaces
341 > key 10
346 > key 10
342 > some value
347 > some value
343 > hello
348 > hello
344 > between
349 > between
345 > pairs 81
350 > pairs 81
346 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
351 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
347 > EOF
352 > EOF
348 0
353 0
349 0
354 0
350 0
355 0
351 384
356 384
352 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
357 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
353 1
358 1
354
359
355
360
356 Send an unknown command after the "between"
361 Send an unknown command after the "between"
357
362
358 $ hg -R server serve --stdio << EOF
363 $ hg -R server serve --stdio << EOF
359 > hello
364 > hello
360 > between
365 > between
361 > pairs 81
366 > pairs 81
362 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000unknown
367 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000unknown
363 > EOF
368 > EOF
364 384
369 384
365 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
370 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
366 1
371 1
367
372
368 0
373 0
369
374
370 And one with arguments
375 And one with arguments
371
376
372 $ hg -R server serve --stdio << EOF
377 $ hg -R server serve --stdio << EOF
373 > hello
378 > hello
374 > between
379 > between
375 > pairs 81
380 > pairs 81
376 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000unknown
381 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000unknown
377 > foo 5
382 > foo 5
378 > value
383 > value
379 > bar 3
384 > bar 3
380 > baz
385 > baz
381 > EOF
386 > EOF
382 384
387 384
383 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
388 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
384 1
389 1
385
390
386 0
391 0
387 0
392 0
388 0
393 0
389 0
394 0
390 0
395 0
391
396
392 Send an upgrade request to a server that doesn't support that command
397 Send an upgrade request to a server that doesn't support that command
393
398
394 $ hg -R server serve --stdio << EOF
399 $ hg -R server serve --stdio << EOF
395 > upgrade 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a proto=irrelevant1%2Cirrelevant2
400 > upgrade 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a proto=irrelevant1%2Cirrelevant2
396 > hello
401 > hello
397 > between
402 > between
398 > pairs 81
403 > pairs 81
399 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
404 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
400 > EOF
405 > EOF
401 0
406 0
402 384
407 384
403 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
408 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
404 1
409 1
405
410
406
411
407 $ hg --config experimental.sshpeer.advertise-v2=true --debug debugpeer ssh://user@dummy/server
412 $ hg --config experimental.sshpeer.advertise-v2=true --debug debugpeer ssh://user@dummy/server
408 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob)
413 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
414 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
409 sending upgrade request: * proto=exp-ssh-v2-0001 (glob)
415 sending upgrade request: * proto=exp-ssh-v2-0001 (glob)
410 devel-peer-request: hello
416 devel-peer-request: hello
411 sending hello command
417 sending hello command
412 devel-peer-request: between
418 devel-peer-request: between
413 devel-peer-request: pairs: 81 bytes
419 devel-peer-request: pairs: 81 bytes
414 sending between command
420 sending between command
415 remote: 0
421 remote: 0
416 remote: 384
422 remote: 384
417 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
423 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
418 remote: 1
424 remote: 1
419 url: ssh://user@dummy/server
425 url: ssh://user@dummy/server
420 local: no
426 local: no
421 pushable: yes
427 pushable: yes
422
428
423 Send an upgrade request to a server that supports upgrade
429 Send an upgrade request to a server that supports upgrade
424
430
425 $ SSHSERVERMODE=upgradev2 hg -R server serve --stdio << EOF
431 $ SSHSERVERMODE=upgradev2 hg -R server serve --stdio << EOF
426 > upgrade this-is-some-token proto=exp-ssh-v2-0001
432 > upgrade this-is-some-token proto=exp-ssh-v2-0001
427 > hello
433 > hello
428 > between
434 > between
429 > pairs 81
435 > pairs 81
430 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
436 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
431 > EOF
437 > EOF
432 upgraded this-is-some-token exp-ssh-v2-0001
438 upgraded this-is-some-token exp-ssh-v2-0001
433 383
439 383
434 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
440 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
435
441
436 $ SSHSERVERMODE=upgradev2 hg --config experimental.sshpeer.advertise-v2=true --debug debugpeer ssh://user@dummy/server
442 $ SSHSERVERMODE=upgradev2 hg --config experimental.sshpeer.advertise-v2=true --debug debugpeer ssh://user@dummy/server
437 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob)
443 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
444 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
438 sending upgrade request: * proto=exp-ssh-v2-0001 (glob)
445 sending upgrade request: * proto=exp-ssh-v2-0001 (glob)
439 devel-peer-request: hello
446 devel-peer-request: hello
440 sending hello command
447 sending hello command
441 devel-peer-request: between
448 devel-peer-request: between
442 devel-peer-request: pairs: 81 bytes
449 devel-peer-request: pairs: 81 bytes
443 sending between command
450 sending between command
444 protocol upgraded to exp-ssh-v2-0001
451 protocol upgraded to exp-ssh-v2-0001
445 url: ssh://user@dummy/server
452 url: ssh://user@dummy/server
446 local: no
453 local: no
447 pushable: yes
454 pushable: yes
448
455
449 Verify the peer has capabilities
456 Verify the peer has capabilities
450
457
451 $ SSHSERVERMODE=upgradev2 hg --config experimental.sshpeer.advertise-v2=true --debug debugcapabilities ssh://user@dummy/server
458 $ SSHSERVERMODE=upgradev2 hg --config experimental.sshpeer.advertise-v2=true --debug debugcapabilities ssh://user@dummy/server
452 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob)
459 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
460 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
453 sending upgrade request: * proto=exp-ssh-v2-0001 (glob)
461 sending upgrade request: * proto=exp-ssh-v2-0001 (glob)
454 devel-peer-request: hello
462 devel-peer-request: hello
455 sending hello command
463 sending hello command
456 devel-peer-request: between
464 devel-peer-request: between
457 devel-peer-request: pairs: 81 bytes
465 devel-peer-request: pairs: 81 bytes
458 sending between command
466 sending between command
459 protocol upgraded to exp-ssh-v2-0001
467 protocol upgraded to exp-ssh-v2-0001
460 Main capabilities:
468 Main capabilities:
461 batch
469 batch
462 branchmap
470 branchmap
463 $USUAL_BUNDLE2_CAPS_SERVER$
471 $USUAL_BUNDLE2_CAPS_SERVER$
464 changegroupsubset
472 changegroupsubset
465 getbundle
473 getbundle
466 known
474 known
467 lookup
475 lookup
468 pushkey
476 pushkey
469 streamreqs=generaldelta,revlogv1
477 streamreqs=generaldelta,revlogv1
470 unbundle=HG10GZ,HG10BZ,HG10UN
478 unbundle=HG10GZ,HG10BZ,HG10UN
471 unbundlehash
479 unbundlehash
472 Bundle2 capabilities:
480 Bundle2 capabilities:
473 HG20
481 HG20
474 bookmarks
482 bookmarks
475 changegroup
483 changegroup
476 01
484 01
477 02
485 02
478 digests
486 digests
479 md5
487 md5
480 sha1
488 sha1
481 sha512
489 sha512
482 error
490 error
483 abort
491 abort
484 unsupportedcontent
492 unsupportedcontent
485 pushraced
493 pushraced
486 pushkey
494 pushkey
487 hgtagsfnodes
495 hgtagsfnodes
488 listkeys
496 listkeys
489 phases
497 phases
490 heads
498 heads
491 pushkey
499 pushkey
492 remote-changegroup
500 remote-changegroup
493 http
501 http
494 https
502 https
General Comments 0
You need to be logged in to leave comments. Login now