[PATCH 1 of 2 v2 stable] rbc: test case for incorrect and too aggressive invalidation of invalid caches

Mads Kiilerich mads at kiilerich.com
Tue Jul 19 22:20:04 UTC 2016


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1468873424 -7200
#      Mon Jul 18 22:23:44 2016 +0200
# Branch stable
# Node ID 33a9257663527f333478cc9a9e12bcdfa68e1b85
# Parent  334632380e22e4aa960068fc7e173bbe8a13d983
rbc: test case for incorrect and too aggressive invalidation of invalid caches

diff --git a/tests/test-branches.t b/tests/test-branches.t
--- a/tests/test-branches.t
+++ b/tests/test-branches.t
@@ -668,3 +668,36 @@ Test that cache files are created and gr
   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 ..


More information about the Mercurial-devel mailing list