Mercurial > hg
comparison tests/test-branches.t @ 23862:7aa1405528a3
branchcache: add debug output whenever cache files use truncate
The cache files are usually append only but will automatically be truncated and
recover in exceptional situations. Add a debug notice when such exceptional
situations are encountered.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Wed, 14 Jan 2015 01:15:26 +0100 |
parents | 01426cad66dc |
children | 577f65cf1a57 |
comparison
equal
deleted
inserted
replaced
23861:01426cad66dc | 23862:7aa1405528a3 |
---|---|
548 0060: e3 d4 9c 05 80 00 00 02 e2 3b 55 05 00 00 00 02 |.........;U.....| | 548 0060: e3 d4 9c 05 80 00 00 02 e2 3b 55 05 00 00 00 02 |.........;U.....| |
549 0070: f8 94 c2 56 80 00 00 03 |...V....| | 549 0070: f8 94 c2 56 80 00 00 03 |...V....| |
550 recovery from invalid cache revs file with trailing data | 550 recovery from invalid cache revs file with trailing data |
551 $ echo >> .hg/cache/rbc-revs-v1 | 551 $ echo >> .hg/cache/rbc-revs-v1 |
552 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug | 552 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug |
553 truncating cache/rbc-revs-v1 to 120 | |
553 5 | 554 5 |
554 $ f --size .hg/cache/rbc-revs* | 555 $ f --size .hg/cache/rbc-revs* |
555 .hg/cache/rbc-revs-v1: size=120 | 556 .hg/cache/rbc-revs-v1: size=120 |
556 recovery from invalid cache file with partial last record | 557 recovery from invalid cache file with partial last record |
557 $ mv .hg/cache/rbc-revs-v1 . | 558 $ mv .hg/cache/rbc-revs-v1 . |
558 $ f -qDB 119 rbc-revs-v1 > .hg/cache/rbc-revs-v1 | 559 $ f -qDB 119 rbc-revs-v1 > .hg/cache/rbc-revs-v1 |
559 $ f --size .hg/cache/rbc-revs* | 560 $ f --size .hg/cache/rbc-revs* |
560 .hg/cache/rbc-revs-v1: size=119 | 561 .hg/cache/rbc-revs-v1: size=119 |
561 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug | 562 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug |
563 truncating cache/rbc-revs-v1 to 112 | |
562 5 | 564 5 |
563 $ f --size .hg/cache/rbc-revs* | 565 $ f --size .hg/cache/rbc-revs* |
564 .hg/cache/rbc-revs-v1: size=120 | 566 .hg/cache/rbc-revs-v1: size=120 |
565 recovery from invalid cache file with missing record - no truncation | 567 recovery from invalid cache file with missing record - no truncation |
566 $ mv .hg/cache/rbc-revs-v1 . | 568 $ mv .hg/cache/rbc-revs-v1 . |
578 $ f --size .hg/cache/rbc-revs* | 580 $ f --size .hg/cache/rbc-revs* |
579 .hg/cache/rbc-revs-v1: size=120 | 581 .hg/cache/rbc-revs-v1: size=120 |
580 $ hg log -r 'branch(.)' -T '{rev} ' | 582 $ hg log -r 'branch(.)' -T '{rev} ' |
581 3 4 8 9 10 11 12 13 (no-eol) | 583 3 4 8 9 10 11 12 13 (no-eol) |
582 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug | 584 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug |
585 truncating cache/rbc-revs-v1 to 8 | |
583 5 | 586 5 |
584 $ f --size --hexdump --bytes=16 .hg/cache/rbc-revs* | 587 $ f --size --hexdump --bytes=16 .hg/cache/rbc-revs* |
585 .hg/cache/rbc-revs-v1: size=120 | 588 .hg/cache/rbc-revs-v1: size=120 |
586 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....| | 589 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....| |
587 cache is updated when committing | 590 cache is updated when committing |