changeset 39242:1347bcf52d51

manifest: set appropriate cache entry when clearing _dirlogcache() manifestrevlog applies to any manifest, not just the root manifest. Resetting the cache and populating its root entry with self is not correct when the instance does not refer to the root manifest. This has no test fallout. So I'm guessing we only ever call clearcaches() on the root manifest. Or we have no test coverage that are impacted by a bad cache on a non-root manifestrevlog. Differential Revision: https://phab.mercurial-scm.org/D4275
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 10 Aug 2018 14:40:02 -0700
parents aad4b46e89bb
children 0d97530eb535
files mercurial/manifest.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/manifest.py	Fri Aug 10 14:20:47 2018 -0700
+++ b/mercurial/manifest.py	Fri Aug 10 14:40:02 2018 -0700
@@ -1325,7 +1325,7 @@
     def clearcaches(self, clear_persisted_data=False):
         super(manifestrevlog, self).clearcaches()
         self._fulltextcache.clear(clear_persisted_data=clear_persisted_data)
-        self._dirlogcache = {'': self}
+        self._dirlogcache = {self._dir: self}
 
     def dirlog(self, d):
         if d: