comparison hgext/inotify/server.py @ 9117:a87bc6e2a907

inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735)
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Mon, 13 Jul 2009 21:55:17 +0900
parents f90bbf1ea09f
children 954f7a879495
comparison
equal deleted inserted replaced
9116:f90bbf1ea09f 9117:a87bc6e2a907
634 (self.event_time(), len(events))) 634 (self.event_time(), len(events)))
635 for evt in events: 635 for evt in events:
636 assert evt.fullpath.startswith(self.wprefix) 636 assert evt.fullpath.startswith(self.wprefix)
637 wpath = evt.fullpath[len(self.wprefix):] 637 wpath = evt.fullpath[len(self.wprefix):]
638 638
639 # paths have been normalized, wpath never ends with a '/'
640
641 if wpath.startswith('.hg/') and evt.mask & inotify.IN_ISDIR:
642 # ignore subdirectories of .hg/ (merge, patches...)
643 continue
644
639 if evt.mask & inotify.IN_UNMOUNT: 645 if evt.mask & inotify.IN_UNMOUNT:
640 self.process_unmount(wpath, evt) 646 self.process_unmount(wpath, evt)
641 elif evt.mask & (inotify.IN_MODIFY | inotify.IN_ATTRIB): 647 elif evt.mask & (inotify.IN_MODIFY | inotify.IN_ATTRIB):
642 self.process_modify(wpath, evt) 648 self.process_modify(wpath, evt)
643 elif evt.mask & (inotify.IN_DELETE | inotify.IN_DELETE_SELF | 649 elif evt.mask & (inotify.IN_DELETE | inotify.IN_DELETE_SELF |