Show More
@@ -285,17 +285,27 b' class dirstate(object):' | |||||
285 | self._dirty = True |
|
285 | self._dirty = True | |
286 | self._addpath(f) |
|
286 | self._addpath(f) | |
287 | s = os.lstat(self._join(f)) |
|
287 | s = os.lstat(self._join(f)) | |
288 | self._map[f] = ('n', s.st_mode, s.st_size, int(s.st_mtime)) |
|
288 | mtime = int(s.st_mtime) | |
|
289 | self._map[f] = ('n', s.st_mode, s.st_size, mtime) | |||
289 | if f in self._copymap: |
|
290 | if f in self._copymap: | |
290 | del self._copymap[f] |
|
291 | del self._copymap[f] | |
291 |
|
292 | |||
292 | # Right now, this file is clean: but if some code in this |
|
293 | if mtime < self._lastnormaltime: | |
293 | # process modifies it without changing its size before the clock |
|
294 | # We have already seen files with modification times from newer | |
294 | # ticks over to the next second, then it won't be clean anymore. |
|
295 | # filesystem timeslots, so this timeslot is old and harmless. | |
295 | # So make sure that status() will look harder at it. |
|
296 | # Comparing file times will work just fine for detecting modified | |
296 | if self._lastnormaltime < s.st_mtime: |
|
297 | # files in status(). No special treatment is needed for f. | |
297 | self._lastnormaltime = s.st_mtime |
|
298 | pass | |
|
299 | else: | |||
|
300 | # f was modified most recently. | |||
|
301 | if mtime > self._lastnormaltime: | |||
|
302 | # A new timeslot, which we've never seen before. | |||
|
303 | # We can drop the filenames of an older timeslot. | |||
|
304 | self._lastnormaltime = mtime | |||
298 | self._lastnormal = set() |
|
305 | self._lastnormal = set() | |
|
306 | # Remember f in _lastnormal for closer inspection on status(), | |||
|
307 | # to make sure we won't miss future size-preserving file content | |||
|
308 | # modifications that happen within the same timeslot. | |||
299 | self._lastnormal.add(f) |
|
309 | self._lastnormal.add(f) | |
300 |
|
310 | |||
301 | def normallookup(self, f): |
|
311 | def normallookup(self, f): |
General Comments 0
You need to be logged in to leave comments.
Login now