[PATCH 09 of 11 v2] localrepo: make invalidate() walk _filecache

Idan Kamara idankk86 at gmail.com
Mon Jul 25 07:09:16 CDT 2011


# HG changeset patch
# User Idan Kamara <idankk86 at gmail.com>
# Date 1311595717 -10800
# Node ID 7cfe3f679e3cfbd9bad573f9c3c80bd122e60397
# Parent  e8e811688286f5b881602483498660ee3a773ee2
localrepo: make invalidate() walk _filecache

diff -r e8e811688286 -r 7cfe3f679e3c 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):


More information about the Mercurial-devel mailing list