Patchwork [2,of,5,"] updatecaches: also warm the tags caches

login
register
mail settings
Submitter Pierre-Yves David
Date March 11, 2019, 9:24 a.m.
Message ID <d3b70c96c0fec26e4529.1552296241@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/39206/
State Accepted
Headers show

Comments

Pierre-Yves David - March 11, 2019, 9:24 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1552268052 -3600
#      Mon Mar 11 02:34:12 2019 +0100
# Node ID d3b70c96c0fec26e452925592a5e916e943a7abd
# Parent  c081522ea066709de26be0b61c5553f095b1fd6d
# EXP-Topic fnodecache
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r d3b70c96c0fe
updatecaches: also warm the tags caches

Resolving any name requires the tags cache to be warm. We make sure that `hg
debugupdatecache` warm the tag cache entry too.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -2095,6 +2095,10 @@  class localrepository(object):
             for ctx in self['.'].parents():
                 ctx.manifest()  # accessing the manifest is enough
 
+            # accessing tags warm the cache
+            self.tags()
+            self.filtered('served').tags()
+
     def invalidatecaches(self):
 
         if r'_tagscache' in vars(self):
diff --git a/tests/test-debugcommands.t b/tests/test-debugcommands.t
--- a/tests/test-debugcommands.t
+++ b/tests/test-debugcommands.t
@@ -541,6 +541,8 @@  Test cache warming command
   $ hg debugupdatecaches --debug
   updating the branch cache
   $ ls -r .hg/cache/*
+  .hg/cache/tags2-served
+  .hg/cache/tags2
   .hg/cache/rbc-revs-v1
   .hg/cache/rbc-names-v1
   .hg/cache/manifestfulltextcache (reporevlogstore !)