# HG changeset patch # User Nicolas Dumazet # Date 2009-05-23 11:38:08 # Node ID 1c610db4a8970fc36d1c1a414aeaf3e8e6d2a5f9 # Parent 9d0c521bce0e4da25757d196d2ca8c3bdf0edd24 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. diff --git a/hgext/inotify/server.py b/hgext/inotify/server.py --- a/hgext/inotify/server.py +++ b/hgext/inotify/server.py @@ -235,7 +235,6 @@ class repowatcher(pollable): self.statcache = {} self.statustrees = dict([(s, {}) for s in self.statuskeys]) - self.watches = 0 self.last_event = None self.lastevent = {} @@ -277,7 +276,6 @@ class repowatcher(pollable): 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