##// END OF EJS Templates
dirstate: fix in memory dirstate entries for 1-second race...
Benoit Boissinot -
r10836:e5aaa454 stable
parent child Browse files
Show More
@@ -391,16 +391,8 b' class dirstate(object):'
391 391 # use the modification time of the newly created temporary file as the
392 392 # filesystem's notion of 'now'
393 393 now = int(util.fstat(st).st_mtime)
394
395 cs = cStringIO.StringIO()
396 copymap = self._copymap
397 pack = struct.pack
398 write = cs.write
399 write("".join(self._pl))
400 for f, e in self._map.iteritems():
401 if f in copymap:
402 f = "%s\0%s" % (f, copymap[f])
403
394 for f in self._map.keys():
395 e = self._map[f]
404 396 if e[0] == 'n' and e[3] == now:
405 397 # The file was last modified "simultaneously" with the current
406 398 # write to dirstate (i.e. within the same second for file-
@@ -411,8 +403,16 b' class dirstate(object):'
411 403 # dirstate, forcing future 'status' calls to compare the
412 404 # contents of the file. This prevents mistakenly treating such
413 405 # files as clean.
414 e = (e[0], 0, -1, -1) # mark entry as 'unset'
406 self._map[f] = (e[0], 0, -1, -1) # mark entry as 'unset'
415 407
408 cs = cStringIO.StringIO()
409 copymap = self._copymap
410 pack = struct.pack
411 write = cs.write
412 write("".join(self._pl))
413 for f, e in self._map.iteritems():
414 if f in copymap:
415 f = "%s\0%s" % (f, copymap[f])
416 416 e = pack(_format, e[0], e[1], e[2], e[3], len(f))
417 417 write(e)
418 418 write(f)
General Comments 0
You need to be logged in to leave comments. Login now