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