comparison mercurial/dirstate.py @ 4935:6b3ed43f77ba

dirstate.invalidate: avoid rebuilding _map Since hasattr will call __getattr__, the call to hasattr(self, '_dirs') will end up reparsing the dirstate file.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 19 Jul 2007 19:43:25 -0300
parents a11921d24ec4
children 4106dde15aed b304c2496f52
comparison
equal deleted inserted replaced
4934:a11921d24ec4 4935:6b3ed43f77ba
162 dmap[f] = e[:4] 162 dmap[f] = e[:4]
163 pos = newpos 163 pos = newpos
164 164
165 def invalidate(self): 165 def invalidate(self):
166 for a in "_map _copymap _branch _pl _dirs _ignore".split(): 166 for a in "_map _copymap _branch _pl _dirs _ignore".split():
167 if hasattr(self, a): 167 if a in self.__dict__:
168 self.__delattr__(a) 168 delattr(self, a)
169 self._dirty = 0 169 self._dirty = 0
170 170
171 def copy(self, source, dest): 171 def copy(self, source, dest):
172 self.markdirty() 172 self.markdirty()
173 self._copymap[dest] = source 173 self._copymap[dest] = source