--- a/hgext/inotify/server.py Sat Jun 13 18:14:50 2009 +0200
+++ b/hgext/inotify/server.py Sat Jun 13 18:41:28 2009 +0200
@@ -142,6 +142,24 @@
def shutdown(self):
raise NotImplementedError
+def eventaction(code):
+ """
+ Decorator to help handle events in repowatcher
+ """
+ def decorator(f):
+ def wrapper(self, wpath):
+ if code == 'm' and wpath in self.lastevent and \
+ self.lastevent[wpath] in 'cm':
+ return
+ self.lastevent[wpath] = code
+ self.timeout = 250
+
+ f(self, wpath)
+
+ wrapper.func_name = f.func_name
+ return wrapper
+ return decorator
+
class repowatcher(pollable):
"""
Watches inotify events
@@ -439,21 +457,6 @@
self.statcache.pop(wpath, None)
raise
- def eventaction(code):
- def decorator(f):
- def wrapper(self, wpath):
- if code == 'm' and wpath in self.lastevent and \
- self.lastevent[wpath] in 'cm':
- return
- self.lastevent[wpath] = code
- self.timeout = 250
-
- f(self, wpath)
-
- wrapper.func_name = f.func_name
- return wrapper
- return decorator
-
@eventaction('c')
def created(self, wpath):
if wpath == '.hgignore':