inotify: make mask a class variable since it's instance-independant
authorNicolas Dumazet <nicdumz.commits@gmail.com>
Fri, 08 May 2009 16:40:39 +0900
changeset 8383 dcfdcb51ac5c
parent 8382 6f44b1adc948
child 8384 483d9b2103da
inotify: make mask a class variable since it's instance-independant
hgext/inotify/server.py
--- a/hgext/inotify/server.py	Fri May 08 17:45:01 2009 +0900
+++ b/hgext/inotify/server.py	Fri May 08 16:40:39 2009 +0900
@@ -116,6 +116,18 @@
 class RepoWatcher(object):
     poll_events = select.POLLIN
     statuskeys = 'almr!?'
+    mask = (
+        inotify.IN_ATTRIB |
+        inotify.IN_CREATE |
+        inotify.IN_DELETE |
+        inotify.IN_DELETE_SELF |
+        inotify.IN_MODIFY |
+        inotify.IN_MOVED_FROM |
+        inotify.IN_MOVED_TO |
+        inotify.IN_MOVE_SELF |
+        inotify.IN_ONLYDIR |
+        inotify.IN_UNMOUNT |
+        0)
 
     def __init__(self, ui, repo, master):
         self.ui = ui
@@ -123,18 +135,6 @@
         self.wprefix = self.repo.wjoin('')
         self.timeout = None
         self.master = master
-        self.mask = (
-            inotify.IN_ATTRIB |
-            inotify.IN_CREATE |
-            inotify.IN_DELETE |
-            inotify.IN_DELETE_SELF |
-            inotify.IN_MODIFY |
-            inotify.IN_MOVED_FROM |
-            inotify.IN_MOVED_TO |
-            inotify.IN_MOVE_SELF |
-            inotify.IN_ONLYDIR |
-            inotify.IN_UNMOUNT |
-            0)
         try:
             self.watcher = watcher.Watcher()
         except OSError, err: