Mercurial > hg
comparison tests/test-branches.t @ 24378:9347c15d8136
revbranchcache: write cache even during read operations
Previously we would only actually write the revbranchcache to disk if we were in
the middle of a write operation (like commit). Now we will also write it during
any read operation. The cache knows how to invalidate itself, so it shouldn't
become corrupt if multiple writers try at once (and the write-on-read
behavior/risk is the same as all our other caches).
author | Durham Goode <durham@fb.com> |
---|---|
date | Tue, 24 Feb 2015 18:43:31 -0800 |
parents | 577f65cf1a57 |
children | 701df761aa94 |
comparison
equal
deleted
inserted
replaced
24377:656f93ce66d5 | 24378:9347c15d8136 |
---|---|
559 #endif | 559 #endif |
560 | 560 |
561 recovery from invalid cache revs file with trailing data | 561 recovery from invalid cache revs file with trailing data |
562 $ echo >> .hg/cache/rbc-revs-v1 | 562 $ echo >> .hg/cache/rbc-revs-v1 |
563 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug | 563 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug |
564 5 | |
564 truncating cache/rbc-revs-v1 to 120 | 565 truncating cache/rbc-revs-v1 to 120 |
565 5 | |
566 $ f --size .hg/cache/rbc-revs* | 566 $ f --size .hg/cache/rbc-revs* |
567 .hg/cache/rbc-revs-v1: size=120 | 567 .hg/cache/rbc-revs-v1: size=120 |
568 recovery from invalid cache file with partial last record | 568 recovery from invalid cache file with partial last record |
569 $ mv .hg/cache/rbc-revs-v1 . | 569 $ mv .hg/cache/rbc-revs-v1 . |
570 $ f -qDB 119 rbc-revs-v1 > .hg/cache/rbc-revs-v1 | 570 $ f -qDB 119 rbc-revs-v1 > .hg/cache/rbc-revs-v1 |
571 $ f --size .hg/cache/rbc-revs* | 571 $ f --size .hg/cache/rbc-revs* |
572 .hg/cache/rbc-revs-v1: size=119 | 572 .hg/cache/rbc-revs-v1: size=119 |
573 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug | 573 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug |
574 5 | |
574 truncating cache/rbc-revs-v1 to 112 | 575 truncating cache/rbc-revs-v1 to 112 |
575 5 | |
576 $ f --size .hg/cache/rbc-revs* | 576 $ f --size .hg/cache/rbc-revs* |
577 .hg/cache/rbc-revs-v1: size=120 | 577 .hg/cache/rbc-revs-v1: size=120 |
578 recovery from invalid cache file with missing record - no truncation | 578 recovery from invalid cache file with missing record - no truncation |
579 $ mv .hg/cache/rbc-revs-v1 . | 579 $ mv .hg/cache/rbc-revs-v1 . |
580 $ f -qDB 112 rbc-revs-v1 > .hg/cache/rbc-revs-v1 | 580 $ f -qDB 112 rbc-revs-v1 > .hg/cache/rbc-revs-v1 |
588 $ f --size .hg/cache/rbc-revs* | 588 $ f --size .hg/cache/rbc-revs* |
589 .hg/cache/rbc-revs-v1: size=8 | 589 .hg/cache/rbc-revs-v1: size=8 |
590 $ f -qDB 112 rbc-revs-v1 >> .hg/cache/rbc-revs-v1 | 590 $ f -qDB 112 rbc-revs-v1 >> .hg/cache/rbc-revs-v1 |
591 $ f --size .hg/cache/rbc-revs* | 591 $ f --size .hg/cache/rbc-revs* |
592 .hg/cache/rbc-revs-v1: size=120 | 592 .hg/cache/rbc-revs-v1: size=120 |
593 $ hg log -r 'branch(.)' -T '{rev} ' | 593 $ hg log -r 'branch(.)' -T '{rev} ' --debug |
594 3 4 8 9 10 11 12 13 (no-eol) | 594 3 4 8 9 10 11 12 13 truncating cache/rbc-revs-v1 to 8 |
595 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug | 595 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug |
596 truncating cache/rbc-revs-v1 to 8 | |
597 5 | 596 5 |
597 truncating cache/rbc-revs-v1 to 104 | |
598 $ f --size --hexdump --bytes=16 .hg/cache/rbc-revs* | 598 $ f --size --hexdump --bytes=16 .hg/cache/rbc-revs* |
599 .hg/cache/rbc-revs-v1: size=120 | 599 .hg/cache/rbc-revs-v1: size=120 |
600 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....| | 600 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....| |
601 cache is updated when committing | 601 cache is updated when committing |
602 $ hg branch i-will-regret-this | 602 $ hg branch i-will-regret-this |