localrepo: make invalidate() walk _filecache
authorIdan Kamara <idankk86@gmail.com>
Mon, 25 Jul 2011 15:08:37 +0300
changeset 14935 4ae7473f5b73
parent 14934 019fe0b0a7af
child 14936 9dca7653b525
localrepo: make invalidate() walk _filecache
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Mon Jul 25 15:08:37 2011 +0300
+++ b/mercurial/localrepo.py	Mon Jul 25 15:08:37 2011 +0300
@@ -813,9 +813,15 @@
             pass
 
     def invalidate(self):
-        for a in ("changelog", "manifest", "_bookmarks", "_bookmarkcurrent"):
-            if a in self.__dict__:
-                delattr(self, a)
+        for k in self._filecache:
+            # dirstate is invalidated separately in invalidatedirstate()
+            if k == 'dirstate':
+                continue
+
+            try:
+                delattr(self, k)
+            except AttributeError:
+                pass
         self.invalidatecaches()
 
     def _lock(self, lockname, wait, releasefn, acquirefn, desc):