inotify: repowatcher: don't use a watches attribute to count watches
authorNicolas Dumazet <nicdumz.commits@gmail.com>
Sat, 23 May 2009 20:38:08 +0900
changeset 8794 1c610db4a897
parent 8793 9d0c521bce0e
child 8795 51c29aec0b75
child 8802 ca14b3982ffe
inotify: repowatcher: don't use a watches attribute to count watches The encapsulated watcher alread has a __len__ method for this purpose. Also, repowatcher.watches was never decremented on watch deletions.
hgext/inotify/server.py
--- a/hgext/inotify/server.py	Thu May 21 23:51:54 2009 +0900
+++ b/hgext/inotify/server.py	Sat May 23 20:38:08 2009 +0900
@@ -235,7 +235,6 @@
         self.statcache = {}
         self.statustrees = dict([(s, {}) for s in self.statuskeys])
 
-        self.watches = 0
         self.last_event = None
 
         self.lastevent = {}
@@ -277,7 +276,6 @@
                 self.ui.note(_('watching %r\n') % path[len(self.wprefix):])
             try:
                 self.watcher.add(path, mask)
-                self.watches += 1
             except OSError, err:
                 if err.errno in (errno.ENOENT, errno.ENOTDIR):
                     return