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.
--- 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