comparison hgext/inotify/server.py @ 10090:a3ad96ead8f0

inotify: do not rely on stat(.hg/dirstate) to invalidate our dirstate stat() is not reliable when several events happen quickly. Which means that if two hg actions occur in the same second, stat() result will not reflect the second change. And only _one_ invalidate() call was done. Also ignore the events that occur when wlock is held, since wlock release will trigger a full rescan anyway. Fixes 17 run-tests.py --inotify tests.
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Fri, 11 Dec 2009 15:58:09 +0900
parents b2e87fde6806
children 8e4be44a676f
comparison
equal deleted inserted replaced
10089:8fab31727037 10090:a3ad96ead8f0
278 nuke.append(wfn) 278 nuke.append(wfn)
279 for wfn in nuke: 279 for wfn in nuke:
280 root, fn = split(wfn) 280 root, fn = split(wfn)
281 del self.statustrees[key].dir(root).files[fn] 281 del self.statustrees[key].dir(root).files[fn]
282 del self.tree.dir(root).files[fn] 282 del self.tree.dir(root).files[fn]
283
284 def check_dirstate(self):
285 ds_info = self.dirstate_info()
286 if ds_info == self.ds_info:
287 return
288 self.ds_info = ds_info
289 if not self.ui.debugflag:
290 self.last_event = None
291 self.dirstate.invalidate()
292 self.handle_timeout()
293 self.scan()
294 283
295 def update_hgignore(self): 284 def update_hgignore(self):
296 # An update of the ignore file can potentially change the 285 # An update of the ignore file can potentially change the
297 # states of all unknown and ignored files. 286 # states of all unknown and ignored files.
298 287