Debian Codegraph @

tests/test-debugcommands.t

raw
1 $ cat << EOF >> $HGRCPATH
2 > [ui]
3 > interactive=yes
4 > EOF
5
6 $ hg init debugrevlog
7 $ cd debugrevlog
8 $ echo a > a
9 $ hg ci -Am adda
10 adding a
11 $ hg rm .
12 removing a
13 $ hg ci -Am make-it-empty
14 $ hg revert --all -r 0
15 adding a
16 $ hg ci -Am make-it-full
17 $ hg debugrevlog -c
18 format : 1
19 flags : (none)
20
21 revisions : 3
22 merges : 0 ( 0.00%)
23 normal : 3 (100.00%)
24 revisions : 3
25 empty : 0 ( 0.00%)
26 text : 0 (100.00%)
27 delta : 0 (100.00%)
28 snapshot : 3 (100.00%)
29 lvl-0 : 3 (100.00%)
30 deltas : 0 ( 0.00%)
31 revision size : 191
32 snapshot : 191 (100.00%)
33 lvl-0 : 191 (100.00%)
34 deltas : 0 ( 0.00%)
35
36 chunks : 3
37 0x75 (u) : 3 (100.00%)
38 chunks size : 191
39 0x75 (u) : 191 (100.00%)
40
41
42 total-stored-content: 188 bytes
43
44 avg chain length : 0
45 max chain length : 0
46 max chain reach : 67
47 compression ratio : 0
48
49 uncompressed data size (min/max/avg) : 57 / 66 / 62
50 full revision size (min/max/avg) : 58 / 67 / 63
51 inter-snapshot size (min/max/avg) : 0 / 0 / 0
52 delta size (min/max/avg) : 0 / 0 / 0
53 $ hg debugrevlog -m
54 format : 1
55 flags : inline, generaldelta
56
57 revisions : 3
58 merges : 0 ( 0.00%)
59 normal : 3 (100.00%)
60 revisions : 3
61 empty : 1 (33.33%)
62 text : 1 (100.00%)
63 delta : 0 ( 0.00%)
64 snapshot : 2 (66.67%)
65 lvl-0 : 2 (66.67%)
66 deltas : 0 ( 0.00%)
67 revision size : 88
68 snapshot : 88 (100.00%)
69 lvl-0 : 88 (100.00%)
70 deltas : 0 ( 0.00%)
71
72 chunks : 3
73 empty : 1 (33.33%)
74 0x75 (u) : 2 (66.67%)
75 chunks size : 88
76 empty : 0 ( 0.00%)
77 0x75 (u) : 88 (100.00%)
78
79
80 total-stored-content: 86 bytes
81
82 avg chain length : 0
83 max chain length : 0
84 max chain reach : 44
85 compression ratio : 0
86
87 uncompressed data size (min/max/avg) : 0 / 43 / 28
88 full revision size (min/max/avg) : 44 / 44 / 44
89 inter-snapshot size (min/max/avg) : 0 / 0 / 0
90 delta size (min/max/avg) : 0 / 0 / 0
91 $ hg debugrevlog a
92 format : 1
93 flags : inline, generaldelta
94
95 revisions : 1
96 merges : 0 ( 0.00%)
97 normal : 1 (100.00%)
98 revisions : 1
99 empty : 0 ( 0.00%)
100 text : 0 (100.00%)
101 delta : 0 (100.00%)
102 snapshot : 1 (100.00%)
103 lvl-0 : 1 (100.00%)
104 deltas : 0 ( 0.00%)
105 revision size : 3
106 snapshot : 3 (100.00%)
107 lvl-0 : 3 (100.00%)
108 deltas : 0 ( 0.00%)
109
110 chunks : 1
111 0x75 (u) : 1 (100.00%)
112 chunks size : 3
113 0x75 (u) : 3 (100.00%)
114
115
116 total-stored-content: 2 bytes
117
118 avg chain length : 0
119 max chain length : 0
120 max chain reach : 3
121 compression ratio : 0
122
123 uncompressed data size (min/max/avg) : 2 / 2 / 2
124 full revision size (min/max/avg) : 3 / 3 / 3
125 inter-snapshot size (min/max/avg) : 0 / 0 / 0
126 delta size (min/max/avg) : 0 / 0 / 0
127
128 Test debugindex, with and without the --verbose/--debug flag
129 $ hg debugrevlogindex a
130 rev linkrev nodeid p1 p2
131 0 0 b789fdd96dc2 000000000000 000000000000
132
133 $ hg --verbose debugrevlogindex a
134 rev offset length linkrev nodeid p1 p2
135 0 0 3 0 b789fdd96dc2 000000000000 000000000000
136
137 $ hg --debug debugrevlogindex a
138 rev offset length linkrev nodeid p1 p2
139 0 0 3 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
140
141 $ hg debugrevlogindex -f 1 a
142 rev flag size link p1 p2 nodeid
143 0 0000 2 0 -1 -1 b789fdd96dc2
144
145 $ hg --verbose debugrevlogindex -f 1 a
146 rev flag offset length size link p1 p2 nodeid
147 0 0000 0 3 2 0 -1 -1 b789fdd96dc2
148
149 $ hg --debug debugrevlogindex -f 1 a
150 rev flag offset length size link p1 p2 nodeid
151 0 0000 0 3 2 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
152
153 $ hg debugindex -c
154 rev linkrev nodeid p1-nodeid p2-nodeid
155 0 0 07f494440405 000000000000 000000000000
156 1 1 8cccb4b5fec2 07f494440405 000000000000
157 2 2 b1e228c512c5 8cccb4b5fec2 000000000000
158 $ hg debugindex -c --debug
159 rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
160 0 -1 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 57 0 0 2 0 58 inline 0 0
161 1 -1 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 -1 0000000000000000000000000000000000000000 66 1 0 2 58 67 inline 0 0
162 2 -1 2 b1e228c512c5d7066d70562ed839c3323a62d6d2 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a -1 0000000000000000000000000000000000000000 65 2 0 2 125 66 inline 0 0
163 $ hg debugindex -m
164 rev linkrev nodeid p1-nodeid p2-nodeid
165 0 0 a0c8bcbbb45c 000000000000 000000000000
166 1 1 57faf8a737ae a0c8bcbbb45c 000000000000
167 2 2 a35b10320954 57faf8a737ae 000000000000
168 $ hg debugindex -m --debug
169 rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
170 0 -1 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 43 0 0 2 0 44 inline 0 0
171 1 -1 1 57faf8a737ae7faf490582941a82319ba6529dca 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 -1 0000000000000000000000000000000000000000 0 1 0 2 44 0 inline 0 0
172 2 -1 2 a35b103209548032201c16c7688cb2657f037a38 1 57faf8a737ae7faf490582941a82319ba6529dca -1 0000000000000000000000000000000000000000 43 2 0 2 44 44 inline 0 0
173 $ hg debugindex a
174 rev linkrev nodeid p1-nodeid p2-nodeid
175 0 0 b789fdd96dc2 000000000000 000000000000
176 $ hg debugindex --debug a
177 rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
178 0 -1 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 2 0 0 2 0 3 inline 0 0
179
180 debugdelta chain basic output
181
182 #if no-pure no-rust
183 $ hg debugindexstats
184 node trie capacity: 4
185 node trie count: 2
186 node trie depth: 1
187 node trie last rev scanned: -1 (no-rust !)
188 node trie last rev scanned: 3 (rust !)
189 node trie lookups: 3 (no-rust !)
190 node trie lookups: 2 (rust !)
191 node trie misses: 1
192 node trie splits: 1
193 revs in memory: 3
194 #else
195 $ hg debugindexstats
196 abort: debugindexstats only works with native C code
197 [255]
198 #endif
199
200 #if no-pure
201 $ hg debugdeltachain -m --all-info
202 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
203 0 -1 -1 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
204 1 0 -1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
205 2 1 -1 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
206
207 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
208 0 1 1
209 1 2 1
210 2 3 1
211
212 $ hg debugdeltachain -m -Tjson --size-info
213 [
214 {
215 "chainid": 1,
216 "chainlen": 1,
217 "chainratio": 1.0232558139534884,
218 "chainsize": 44,
219 "compsize": 44,
220 "deltatype": "base",
221 "p1": -1,
222 "p2": -1,
223 "prevrev": -1,
224 "rev": 0,
225 "uncompsize": 43
226 },
227 {
228 "chainid": 2,
229 "chainlen": 1,
230 "chainratio": 0,
231 "chainsize": 0,
232 "compsize": 0,
233 "deltatype": "base",
234 "p1": 0,
235 "p2": -1,
236 "prevrev": -1,
237 "rev": 1,
238 "uncompsize": 0
239 },
240 {
241 "chainid": 3,
242 "chainlen": 1,
243 "chainratio": 1.0232558139534884,
244 "chainsize": 44,
245 "compsize": 44,
246 "deltatype": "base",
247 "p1": 1,
248 "p2": -1,
249 "prevrev": -1,
250 "rev": 2,
251 "uncompsize": 43
252 }
253 ]
254
255 $ hg debugdeltachain -m -Tjson --all-info
256 [
257 {
258 "chainid": 1,
259 "chainlen": 1,
260 "chainratio": 1.0232558139534884,
261 "chainsize": 44,
262 "compsize": 44,
263 "deltatype": "base",
264 "extradist": 0,
265 "extraratio": 0.0,
266 "largestblock": 44,
267 "lindist": 44,
268 "p1": -1,
269 "p2": -1,
270 "prevrev": -1,
271 "readdensity": 1.0,
272 "readsize": 44,
273 "rev": 0,
274 "srchunks": 1,
275 "uncompsize": 43
276 },
277 {
278 "chainid": 2,
279 "chainlen": 1,
280 "chainratio": 0,
281 "chainsize": 0,
282 "compsize": 0,
283 "deltatype": "base",
284 "extradist": 0,
285 "extraratio": 0,
286 "largestblock": 0,
287 "lindist": 0,
288 "p1": 0,
289 "p2": -1,
290 "prevrev": -1,
291 "readdensity": 1,
292 "readsize": 0,
293 "rev": 1,
294 "srchunks": 1,
295 "uncompsize": 0
296 },
297 {
298 "chainid": 3,
299 "chainlen": 1,
300 "chainratio": 1.0232558139534884,
301 "chainsize": 44,
302 "compsize": 44,
303 "deltatype": "base",
304 "extradist": 0,
305 "extraratio": 0.0,
306 "largestblock": 44,
307 "lindist": 44,
308 "p1": 1,
309 "p2": -1,
310 "prevrev": -1,
311 "readdensity": 1.0,
312 "readsize": 44,
313 "rev": 2,
314 "srchunks": 1,
315 "uncompsize": 43
316 }
317 ]
318
319 debugdelta chain with sparse read enabled
320
321 $ cat >> $HGRCPATH <<EOF
322 > [experimental]
323 > sparse-read = True
324 > EOF
325 $ hg debugdeltachain -m --all-info
326 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
327 0 -1 -1 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
328 1 0 -1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
329 2 1 -1 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
330
331 $ hg debugdeltachain -m --sparse-info -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
332 0 1 1 44 44 1.0
333 1 2 1 0 0 1
334 2 3 1 44 44 1.0
335
336 $ hg debugdeltachain -m -Tjson --sparse-info
337 [
338 {
339 "chainid": 1,
340 "chainlen": 1,
341 "deltatype": "base",
342 "largestblock": 44,
343 "p1": -1,
344 "p2": -1,
345 "prevrev": -1,
346 "readdensity": 1.0,
347 "readsize": 44,
348 "rev": 0,
349 "srchunks": 1
350 },
351 {
352 "chainid": 2,
353 "chainlen": 1,
354 "deltatype": "base",
355 "largestblock": 0,
356 "p1": 0,
357 "p2": -1,
358 "prevrev": -1,
359 "readdensity": 1,
360 "readsize": 0,
361 "rev": 1,
362 "srchunks": 1
363 },
364 {
365 "chainid": 3,
366 "chainlen": 1,
367 "deltatype": "base",
368 "largestblock": 44,
369 "p1": 1,
370 "p2": -1,
371 "prevrev": -1,
372 "readdensity": 1.0,
373 "readsize": 44,
374 "rev": 2,
375 "srchunks": 1
376 }
377 ]
378
379 $ hg debugdeltachain -m -Tjson --all-info
380 [
381 {
382 "chainid": 1,
383 "chainlen": 1,
384 "chainratio": 1.0232558139534884,
385 "chainsize": 44,
386 "compsize": 44,
387 "deltatype": "base",
388 "extradist": 0,
389 "extraratio": 0.0,
390 "largestblock": 44,
391 "lindist": 44,
392 "p1": -1,
393 "p2": -1,
394 "prevrev": -1,
395 "readdensity": 1.0,
396 "readsize": 44,
397 "rev": 0,
398 "srchunks": 1,
399 "uncompsize": 43
400 },
401 {
402 "chainid": 2,
403 "chainlen": 1,
404 "chainratio": 0,
405 "chainsize": 0,
406 "compsize": 0,
407 "deltatype": "base",
408 "extradist": 0,
409 "extraratio": 0,
410 "largestblock": 0,
411 "lindist": 0,
412 "p1": 0,
413 "p2": -1,
414 "prevrev": -1,
415 "readdensity": 1,
416 "readsize": 0,
417 "rev": 1,
418 "srchunks": 1,
419 "uncompsize": 0
420 },
421 {
422 "chainid": 3,
423 "chainlen": 1,
424 "chainratio": 1.0232558139534884,
425 "chainsize": 44,
426 "compsize": 44,
427 "deltatype": "base",
428 "extradist": 0,
429 "extraratio": 0.0,
430 "largestblock": 44,
431 "lindist": 44,
432 "p1": 1,
433 "p2": -1,
434 "prevrev": -1,
435 "readdensity": 1.0,
436 "readsize": 44,
437 "rev": 2,
438 "srchunks": 1,
439 "uncompsize": 43
440 }
441 ]
442
443 $ printf "This test checks things.\n" >> a
444 $ hg ci -m a
445 $ hg branch other
446 marked working directory as branch other
447 (branches are permanent and global, did you want a bookmark?)
448 $ for i in `$TESTDIR/seq.py 5`; do
449 > printf "shorter ${i}" >> a
450 > hg ci -m "a other:$i"
451 > hg up -q default
452 > printf "for the branch default we want longer chains: ${i}" >> a
453 > hg ci -m "a default:$i"
454 > hg up -q other
455 > done
456 $ hg debugdeltachain a -T '{rev} {srchunks}\n' --all-info\
457 > --config experimental.sparse-read.density-threshold=0.50 \
458 > --config experimental.sparse-read.min-gap-size=0
459 0 1
460 1 1
461 2 2
462 3 2
463 4 2
464 5 2
465 6 1
466 7 3
467 8 2
468 9 3
469 10 2 (no-zstd !)
470 10 1 (zstd !)
471 11 4
472 $ hg --config extensions.strip= strip --no-backup -r 1
473 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
474
475 Test max chain len
476 $ cat >> $HGRCPATH << EOF
477 > [format]
478 > maxchainlen=4
479 > EOF
480
481 $ printf "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
482 $ hg ci -m a
483 $ printf "b\n" >> a
484 $ hg ci -m a
485 $ printf "c\n" >> a
486 $ hg ci -m a
487 $ printf "d\n" >> a
488 $ hg ci -m a
489 $ printf "e\n" >> a
490 $ hg ci -m a
491 $ printf "f\n" >> a
492 $ hg ci -m a
493 $ printf 'g\n' >> a
494 $ hg ci -m a
495 $ printf 'h\n' >> a
496 $ hg ci -m a
497
498 $ hg debugrevlog -d a
499 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
500 0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob)
501 1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob)
502 2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
503 3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
504 4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob)
505 5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob)
506 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob)
507 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
508 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
509 #endif
510
511 Test debuglocks command:
512
513 $ hg debuglocks
514 lock: free
515 wlock: free
516
517 * Test setting the lock
518
519 $ dolock() {
520 > {
521 > "$RUNTESTDIR/testlib/wait-on-file" 5 .hg/unlock
522 > rm -f .hg/unlock
523 > echo y
524 > } | hg debuglocks "$@" > /dev/null
525 > }
526 $ dolock -s &
527 $ "$RUNTESTDIR/testlib/wait-on-file" 5 .hg/store/lock
528
529 $ hg debuglocks
530 lock: user *, process * (*s) (glob)
531 wlock: free
532 [1]
533 $ touch .hg/unlock
534 $ wait
535 $ [ -f .hg/store/lock ] || echo "There is no lock"
536 There is no lock
537
538 * Test setting the wlock
539
540 $ dolock -S &
541 $ "$RUNTESTDIR/testlib/wait-on-file" 5 .hg/wlock
542
543 $ hg debuglocks
544 lock: free
545 wlock: user *, process * (*s) (glob)
546 [1]
547 $ touch .hg/unlock
548 $ wait
549 $ [ -f .hg/wlock ] || echo "There is no wlock"
550 There is no wlock
551
552 * Test setting both locks
553
554 $ dolock -Ss &
555 $ "$RUNTESTDIR/testlib/wait-on-file" 5 .hg/wlock
556 $ "$RUNTESTDIR/testlib/wait-on-file" 5 .hg/store/lock
557
558 $ hg debuglocks
559 lock: user *, process * (*s) (glob)
560 wlock: user *, process * (*s) (glob)
561 [2]
562
563 * Test failing to set a lock
564
565 $ hg debuglocks -s
566 abort: lock is already held
567 [255]
568
569 $ hg debuglocks -S
570 abort: wlock is already held
571 [255]
572
573 $ touch .hg/unlock
574 $ wait
575
576 $ hg debuglocks
577 lock: free
578 wlock: free
579
580 * Test forcing the lock
581
582 $ dolock -s &
583 $ "$RUNTESTDIR/testlib/wait-on-file" 5 .hg/store/lock
584
585 $ hg debuglocks
586 lock: user *, process * (*s) (glob)
587 wlock: free
588 [1]
589
590 $ hg debuglocks -L
591
592 $ hg debuglocks
593 lock: free
594 wlock: free
595
596 $ touch .hg/unlock
597 $ wait
598
599 * Test forcing the wlock
600
601 $ dolock -S &
602 $ "$RUNTESTDIR/testlib/wait-on-file" 5 .hg/wlock
603
604 $ hg debuglocks
605 lock: free
606 wlock: user *, process * (*s) (glob)
607 [1]
608
609 $ hg debuglocks -W
610
611 $ hg debuglocks
612 lock: free
613 wlock: free
614
615 $ touch .hg/unlock
616 $ wait
617
618 Test WdirUnsupported exception
619
620 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
621 abort: working directory revision cannot be specified
622 [255]
623
624 Test cache warming command
625
626 $ rm -rf .hg/cache/
627 $ hg debugupdatecaches --debug
628 updating the branch cache
629 resetting content of cache/rbc-revs-v2
630 $ ls -r .hg/cache/*
631 .hg/cache/tags2-served
632 .hg/cache/tags2
633 .hg/cache/rbc-revs-v2
634 .hg/cache/rbc-names-v2
635 .hg/cache/hgtagsfnodes1
636 .hg/cache/branch2-served
637
638 Test debug::unbundle
639
640 $ hg bundle --exact --rev tip foo.hg
641 1 changesets found
642 $ hg debug::unbundle foo.hg
643 adding changesets
644 adding manifests
645 adding file changes
646 added 0 changesets with 0 changes to 1 files (no-pure !)
647
648 Test debugcolor
649
650 #if no-windows
651 $ hg debugcolor --style --color always | grep -E 'mode|style|log\.'
652 color mode: 'ansi'
653 available style:
654 \x1b[0;33mlog.changeset\x1b[0m: \x1b[0;33myellow\x1b[0m (esc)
655 #endif
656
657 $ hg debugcolor --style --color never
658 color mode: None
659 available style:
660
661 $ cd ..
662
663 Test internal debugstacktrace command
664
665 $ cat > debugstacktrace.py << EOF
666 > from mercurial import (
667 > util,
668 > )
669 > from mercurial.utils import (
670 > procutil,
671 > )
672 > def f():
673 > util.debugstacktrace(f=procutil.stdout)
674 > g()
675 > def g():
676 > util.dst(b'hello from g\\n', skip=1)
677 > h()
678 > def h():
679 > util.dst(b'hi ...\\nfrom h hidden in g', 1, depth=2)
680 > f()
681 > EOF
682 $ "$PYTHON" debugstacktrace.py
683 stacktrace at:
684 *debugstacktrace.py:15 in * (glob)
685 *debugstacktrace.py:8 in f (glob)
686 hello from g at:
687 *debugstacktrace.py:15 in * (glob)
688 *debugstacktrace.py:9 in f (glob)
689 hi ...
690 from h hidden in g at:
691 *debugstacktrace.py:9 in f (glob)
692 *debugstacktrace.py:12 in g (glob)
693
694 Test debugcapabilities command:
695
696 $ hg debugcapabilities ./debugrevlog/
697 Main capabilities:
698 branchmap
699 $USUAL_BUNDLE2_CAPS$
700 getbundle
701 known
702 lookup
703 pushkey
704 unbundle
705 Bundle2 capabilities:
706 HG20
707 bookmarks
708 changegroup
709 01
710 02
711 03
712 checkheads
713 related
714 delta-compression
715 none
716 zlib
717 zstd (zstd !)
718 digests
719 md5
720 sha1
721 sha512
722 error
723 abort
724 unsupportedcontent
725 pushraced
726 pushkey
727 hgtagsfnodes
728 listkeys
729 phases
730 heads
731 pushkey
732 remote-changegroup
733 http
734 https
735 stream
736 v2
737
738 Test debugpeer
739
740 $ hg debugpeer ssh://user@dummy/debugrevlog
741 url: ssh://user@dummy/debugrevlog
742 local: no
743 pushable: yes
744
745 #if rust
746
747 $ hg --debug debugpeer ssh://user@dummy/debugrevlog
748 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R debugrevlog serve --stdio['"] (re)
749 devel-peer-request: hello+between
750 devel-peer-request: pairs: 81 bytes
751 sending hello command
752 sending between command
753 remote: 514
754 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlog-compression-zstd,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
755 remote: 1
756 devel-peer-request: protocaps
757 devel-peer-request: caps: * bytes (glob)
758 sending protocaps command
759 url: ssh://user@dummy/debugrevlog
760 local: no
761 pushable: yes
762
763 #endif
764
765 #if no-rust zstd
766
767 $ hg --debug debugpeer ssh://user@dummy/debugrevlog
768 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R debugrevlog serve --stdio['"] (re)
769 devel-peer-request: hello+between
770 devel-peer-request: pairs: 81 bytes
771 sending hello command
772 sending between command
773 remote: 514
774 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlog-compression-zstd,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
775 remote: 1
776 devel-peer-request: protocaps
777 devel-peer-request: caps: * bytes (glob)
778 sending protocaps command
779 url: ssh://user@dummy/debugrevlog
780 local: no
781 pushable: yes
782
783 #endif
784
785 #if no-rust no-zstd
786
787 $ hg --debug debugpeer ssh://user@dummy/debugrevlog
788 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R debugrevlog serve --stdio['"] (re)
789 devel-peer-request: hello+between
790 devel-peer-request: pairs: 81 bytes
791 sending hello command
792 sending between command
793 remote: 490 (zstd !)
794 remote: 483 (no-zstd !)
795 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
796 remote: 1
797 devel-peer-request: protocaps
798 devel-peer-request: caps: * bytes (glob)
799 sending protocaps command
800 url: ssh://user@dummy/debugrevlog
801 local: no
802 pushable: yes
803
804 #endif
805
806 Test debugshell
807
808 $ hg debugshell -c 'ui.write(b"%s\n" % ui.username())'
809 test
810
811 $ hg debugshell -c 'raise m.error.Abort("error should cause non-zero status")'
812 Traceback (most recent call last):
813 File "<input>", line 1, in <module>
814 mercurial.error.Abort: error should cause non-zero status
815 [1]