diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
index ef0e3cc684b3de5527bf71a1141fe568c616e4ec_bWVyY3VyaWFsL2xvY2FscmVwby5weQ==..70b71421fd331dbe7aede9bc65cdbc657c3f1b77_bWVyY3VyaWFsL2xvY2FscmVwby5weQ== 100644
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -2107,6 +2107,7 @@
             # accessing the 'ser ved' branchmap should refresh all the others,
             self.ui.debug('updating the branch cache\n')
             self.filtered('served').branchmap()
+            self.filtered('served.hidden').branchmap()
 
         if full:
             unfi = self.unfiltered()
diff --git a/tests/test-rebase-conflicts.t b/tests/test-rebase-conflicts.t
index ef0e3cc684b3de5527bf71a1141fe568c616e4ec_dGVzdHMvdGVzdC1yZWJhc2UtY29uZmxpY3RzLnQ=..70b71421fd331dbe7aede9bc65cdbc657c3f1b77_dGVzdHMvdGVzdC1yZWJhc2UtY29uZmxpY3RzLnQ= 100644
--- a/tests/test-rebase-conflicts.t
+++ b/tests/test-rebase-conflicts.t
@@ -330,6 +330,7 @@
   bundle2-input-bundle: 2 parts total
   updating the branch cache
   invalid branchheads cache (served): tip differs
+  invalid branchheads cache (served.hidden): tip differs
   rebase completed
 
 Test minimization of merge conflicts
diff --git a/tests/test-remote-hidden.t b/tests/test-remote-hidden.t
index ef0e3cc684b3de5527bf71a1141fe568c616e4ec_dGVzdHMvdGVzdC1yZW1vdGUtaGlkZGVuLnQ=..70b71421fd331dbe7aede9bc65cdbc657c3f1b77_dGVzdHMvdGVzdC1yZW1vdGUtaGlkZGVuLnQ= 100644
--- a/tests/test-remote-hidden.t
+++ b/tests/test-remote-hidden.t
@@ -72,6 +72,20 @@
 Test the feature
 ================
 
+Check cache pre-warm
+--------------------
+
+  $ ls -1 repo-with-hidden/.hg/cache
+  branch2
+  branch2-base
+  branch2-served
+  branch2-served.hidden
+  branch2-visible
+  rbc-names-v1
+  rbc-revs-v1
+  tags2
+  tags2-visible
+
 Check that the `served.hidden` repoview
 ---------------------------------------