comparison hgext/inotify/server.py @ 8383:dcfdcb51ac5c

inotify: make mask a class variable since it's instance-independant
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Fri, 08 May 2009 16:40:39 +0900
parents 6f44b1adc948
children 483d9b2103da
comparison
equal deleted inserted replaced
8382:6f44b1adc948 8383:dcfdcb51ac5c
114 % repo.root) 114 % repo.root)
115 115
116 class RepoWatcher(object): 116 class RepoWatcher(object):
117 poll_events = select.POLLIN 117 poll_events = select.POLLIN
118 statuskeys = 'almr!?' 118 statuskeys = 'almr!?'
119 mask = (
120 inotify.IN_ATTRIB |
121 inotify.IN_CREATE |
122 inotify.IN_DELETE |
123 inotify.IN_DELETE_SELF |
124 inotify.IN_MODIFY |
125 inotify.IN_MOVED_FROM |
126 inotify.IN_MOVED_TO |
127 inotify.IN_MOVE_SELF |
128 inotify.IN_ONLYDIR |
129 inotify.IN_UNMOUNT |
130 0)
119 131
120 def __init__(self, ui, repo, master): 132 def __init__(self, ui, repo, master):
121 self.ui = ui 133 self.ui = ui
122 self.repo = repo 134 self.repo = repo
123 self.wprefix = self.repo.wjoin('') 135 self.wprefix = self.repo.wjoin('')
124 self.timeout = None 136 self.timeout = None
125 self.master = master 137 self.master = master
126 self.mask = (
127 inotify.IN_ATTRIB |
128 inotify.IN_CREATE |
129 inotify.IN_DELETE |
130 inotify.IN_DELETE_SELF |
131 inotify.IN_MODIFY |
132 inotify.IN_MOVED_FROM |
133 inotify.IN_MOVED_TO |
134 inotify.IN_MOVE_SELF |
135 inotify.IN_ONLYDIR |
136 inotify.IN_UNMOUNT |
137 0)
138 try: 138 try:
139 self.watcher = watcher.Watcher() 139 self.watcher = watcher.Watcher()
140 except OSError, err: 140 except OSError, err:
141 raise util.Abort(_('inotify service not available: %s') % 141 raise util.Abort(_('inotify service not available: %s') %
142 err.strerror) 142 err.strerror)