changeset 6371:b2f1d97d10eb

don't use hasattr in repo.invalidate hasattr ends up calling __getattr__ which will instantiate the very attributes we want to remove.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sun, 23 Mar 2008 21:03:24 -0300
parents 6440e25a1ba3
children 8f79820443a4
files mercurial/localrepo.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sun Mar 23 21:03:24 2008 -0300
+++ b/mercurial/localrepo.py	Sun Mar 23 21:03:24 2008 -0300
@@ -633,8 +633,8 @@
 
     def invalidate(self):
         for a in "changelog manifest".split():
-            if hasattr(self, a):
-                self.__delattr__(a)
+            if a in self.__dict__:
+                delattr(self, a)
         self.tagscache = None
         self._tagstypecache = None
         self.nodetagscache = None