diff 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
line wrap: on
line diff
--- a/tests/test-branches.t	Tue Feb 10 20:06:12 2015 -0800
+++ b/tests/test-branches.t	Tue Feb 24 18:43:31 2015 -0800
@@ -561,8 +561,8 @@
 recovery from invalid cache revs file with trailing data
   $ echo >> .hg/cache/rbc-revs-v1
   $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
+  5
   truncating cache/rbc-revs-v1 to 120
-  5
   $ f --size .hg/cache/rbc-revs*
   .hg/cache/rbc-revs-v1: size=120
 recovery from invalid cache file with partial last record
@@ -571,8 +571,8 @@
   $ f --size .hg/cache/rbc-revs*
   .hg/cache/rbc-revs-v1: size=119
   $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
+  5
   truncating cache/rbc-revs-v1 to 112
-  5
   $ f --size .hg/cache/rbc-revs*
   .hg/cache/rbc-revs-v1: size=120
 recovery from invalid cache file with missing record - no truncation
@@ -590,11 +590,11 @@
   $ f -qDB 112 rbc-revs-v1 >> .hg/cache/rbc-revs-v1
   $ f --size .hg/cache/rbc-revs*
   .hg/cache/rbc-revs-v1: size=120
-  $ hg log -r 'branch(.)' -T '{rev} '
-  3 4 8 9 10 11 12 13  (no-eol)
+  $ hg log -r 'branch(.)' -T '{rev} ' --debug
+  3 4 8 9 10 11 12 13 truncating cache/rbc-revs-v1 to 8
   $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
-  truncating cache/rbc-revs-v1 to 8
   5
+  truncating cache/rbc-revs-v1 to 104
   $ f --size --hexdump --bytes=16 .hg/cache/rbc-revs*
   .hg/cache/rbc-revs-v1: size=120
   0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|