# HG changeset patch # User Nicolas Dumazet # Date 1243078688 -32400 # 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 -r 9d0c521bce0e -r 1c610db4a897 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