dirstate: clear map cached properties when clearing the map
authorMark Thomas <mbthomas@fb.com>
Wed, 08 Nov 2017 09:23:53 -0800
changeset 35015 ecede5263adb
parent 35014 be6aa0cff8ea
child 35016 1664dc7ccd8a
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
mercurial/dirstate.py
--- 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()