Patchwork [7,of,8,"] manifestcache: make sure the entry are ordered by access time

login
register
mail settings
Submitter Pierre-Yves David
Date March 15, 2019, 11:43 a.m.
Message ID <01b0e1930dd902040648.1552650209@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/39262/
State Accepted
Headers show

Comments

Pierre-Yves David - March 15, 2019, 11:43 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1552561133 0
#      Thu Mar 14 10:58:53 2019 +0000
# Node ID 01b0e1930dd902040648343e0908ee6be75552d3
# Parent  87c06c6f7e62897a14bd4e2291d0ff805f689848
# EXP-Topic manifestcache
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 01b0e1930dd9
manifestcache: make sure the entry are ordered by access time

This is an LRU cache, let us make sure of that.

Patch

diff --git a/tests/test-manifest.t b/tests/test-manifest.t
--- a/tests/test-manifest.t
+++ b/tests/test-manifest.t
@@ -133,3 +133,12 @@  Adding a second entry
   id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
   id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
   total cache data size 268 bytes, on-disk 268 bytes
+
+Accessing the initial entry again, refresh their order
+
+  $ hg debugmanifestfulltextcache --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7
+  $ hg debugmanifestfulltextcache
+  cache contains 2 manifest entries, in order of most to least recent:
+  id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
+  id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
+  total cache data size 268 bytes, on-disk 268 bytes