manifestcache: test the cache is warm after a commit
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 14 Mar 2019 11:46:18 +0000
changeset 41960 7d417ab1eda9
parent 41959 e3307243d188
child 41961 c3522b015f81
manifestcache: test the cache is warm after a commit
tests/test-manifest.t
--- a/tests/test-manifest.t	Fri Mar 15 13:52:36 2019 +0000
+++ b/tests/test-manifest.t	Thu Mar 14 11:46:18 2019 +0000
@@ -158,3 +158,24 @@
   id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
   total cache data size 268 bytes, on-disk 268 bytes
   $ hg debugmanifestfulltextcache --clear
+
+Test caching behavior on actual operation
+-----------------------------------------
+
+Make sure we start empty
+
+  $ hg debugmanifestfulltextcache
+  cache empty
+
+Commit should have the new node cached:
+
+  $ echo a >> b/a
+  $ hg commit -m 'foo'
+  $ hg debugmanifestfulltextcache
+  cache contains 2 manifest entries, in order of most to least recent:
+  id: 26b8653b67af8c1a0a0317c4ee8dac50a41fdb65, size 133 bytes
+  id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
+  total cache data size 314 bytes, on-disk 314 bytes
+  $ hg log -r 'ancestors(., 1)' --debug | grep 'manifest:'
+  manifest:    1:1e01206b1d2f72bd55f2a33fa8ccad74144825b7
+  manifest:    2:26b8653b67af8c1a0a0317c4ee8dac50a41fdb65