don't use hasattr in repo.invalidate
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Sun, 23 Mar 2008 21:03:24 -0300
changeset 6371 b2f1d97d10eb
parent 6370 6440e25a1ba3
child 6372 8f79820443a4
don't use hasattr in repo.invalidate hasattr ends up calling __getattr__ which will instantiate the very attributes we want to remove.
mercurial/localrepo.py
--- 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