changeset 29614:5c79bae8166f stable

rbc: test case for incorrect and too aggressive invalidation of invalid caches
author Mads Kiilerich <madski@unity3d.com>
date Mon, 18 Jul 2016 22:23:44 +0200
parents 616cbcb59e05
children a2a380e2750f
files tests/test-branches.t
diffstat 1 files changed, 33 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-branches.t	Tue Jul 19 10:15:35 2016 -0700
+++ b/tests/test-branches.t	Mon Jul 18 22:23:44 2016 +0200
@@ -668,3 +668,36 @@
   0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
 
   $ cd ..
+
+Test for multiple incorrect branch cache entries:
+
+  $ hg init b
+  $ cd b
+  $ touch f
+  $ hg ci -Aqmf
+  $ echo >> f
+  $ hg ci -Amf
+  $ hg branch -q branch
+  $ hg ci -Amf
+
+  $ f --size --hexdump .hg/cache/rbc-*
+  .hg/cache/rbc-names-v1: size=14
+  0000: 64 65 66 61 75 6c 74 00 62 72 61 6e 63 68       |default.branch|
+  .hg/cache/rbc-revs-v1: size=24
+  0000: 66 e5 f5 aa 00 00 00 00 fa 4c 04 e5 00 00 00 00 |f........L......|
+  0010: 56 46 78 69 00 00 00 01                         |VFxi....|
+  $ : > .hg/cache/rbc-revs-v1
+
+  $ hg log -r "branch(null)&branch(branch)" --debug
+  rebuilding corrupted revision branch cache
+  rebuilding corrupted revision branch cache
+  truncating cache/rbc-revs-v1 to 8
+BUG: the cache was declared corrupt multiple times and not fully rebuilt:
+  $ f --size --hexdump .hg/cache/rbc-*
+  .hg/cache/rbc-names-v1: size=14
+  0000: 64 65 66 61 75 6c 74 00 62 72 61 6e 63 68       |default.branch|
+  .hg/cache/rbc-revs-v1: size=24
+  0000: 00 00 00 00 00 00 00 00 fa 4c 04 e5 00 00 00 00 |.........L......|
+  0010: 56 46 78 69 00 00 00 01                         |VFxi....|
+
+  $ cd ..