changeset 35015:ecede5263adb

dirstate: clear map cached properties when clearing the map dirstatemap.clear should remove all record of the files in the map. This includes removing caches of values derived from these. Differential Revision: https://phab.mercurial-scm.org/D1338
author Mark Thomas <mbthomas@fb.com>
date Wed, 08 Nov 2017 09:23:53 -0800
parents be6aa0cff8ea
children 1664dc7ccd8a
files mercurial/dirstate.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Wed Nov 08 09:18:18 2017 -0800
+++ b/mercurial/dirstate.py	Wed Nov 08 09:23:53 2017 -0800
@@ -1226,6 +1226,11 @@
         self._map.clear()
         self.copymap.clear()
         self.setparents(nullid, nullid)
+        util.clearcachedproperty(self, "dirs")
+        util.clearcachedproperty(self, "filefoldmap")
+        util.clearcachedproperty(self, "dirfoldmap")
+        util.clearcachedproperty(self, "nonnormalset")
+        util.clearcachedproperty(self, "otherparentset")
 
     def iteritems(self):
         return self._map.iteritems()