manifest: set appropriate cache entry when clearing _dirlogcache()
authorGregory Szorc <gregory.szorc@gmail.com>
Fri, 10 Aug 2018 14:40:02 -0700
changeset 39242 1347bcf52d51
parent 39241 aad4b46e89bb
child 39243 0d97530eb535
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
mercurial/manifest.py
--- 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: