comparison mercurial/dirstate.py @ 5080:b304c2496f52

dirstate: fix rebuild; add a test If rebuild calls invalidate, it will just queue a (re)read of the dirstate file, while what we really want is to empty the current state.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sun, 05 Aug 2007 23:04:56 -0300
parents 6b3ed43f77ba
children 79373ec3f27d
comparison
equal deleted inserted replaced
5079:ccdc8db02bdf 5080:b304c2496f52
238 self._decpath(f) 238 self._decpath(f)
239 except KeyError: 239 except KeyError:
240 self._ui.warn(_("not in dirstate: %s!\n") % f) 240 self._ui.warn(_("not in dirstate: %s!\n") % f)
241 pass 241 pass
242 242
243 def clear(self):
244 self._map = {}
245 self._copymap = {}
246 self._pl = [nullid, nullid]
247 self.markdirty()
248
243 def rebuild(self, parent, files): 249 def rebuild(self, parent, files):
244 self.invalidate() 250 self.clear()
245 for f in files: 251 for f in files:
246 if files.execf(f): 252 if files.execf(f):
247 self._map[f] = ('n', 0777, -1, 0) 253 self._map[f] = ('n', 0777, -1, 0)
248 else: 254 else:
249 self._map[f] = ('n', 0666, -1, 0) 255 self._map[f] = ('n', 0666, -1, 0)