# HG changeset patch # User Alexis S. L. Carvalho # Date 1184885005 10800 # Node ID 6b3ed43f77bab079ea1afc6b85a5f1d851ce3b9e # Parent a11921d24ec4f6cdc1720d4d37f90c6f9a74ad2f dirstate.invalidate: avoid rebuilding _map Since hasattr will call __getattr__, the call to hasattr(self, '_dirs') will end up reparsing the dirstate file. diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -164,8 +164,8 @@ class dirstate(object): def invalidate(self): for a in "_map _copymap _branch _pl _dirs _ignore".split(): - if hasattr(self, a): - self.__delattr__(a) + if a in self.__dict__: + delattr(self, a) self._dirty = 0 def copy(self, source, dest):