mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
inotify: server: remove wpath method
Only called once. And can be simplified to an easy oneliner.
This commit is contained in:
parent
e0ab0a167d
commit
968f9e4e5f
@ -288,14 +288,6 @@ class repowatcher(pollable):
|
||||
self.add_watch(self.repo.path, inotify.IN_DELETE)
|
||||
self.check_dirstate()
|
||||
|
||||
def wpath(self, evt):
|
||||
path = evt.fullpath
|
||||
if path == self.repo.root:
|
||||
return ''
|
||||
if path.startswith(self.wprefix):
|
||||
return path[len(self.wprefix):]
|
||||
raise 'wtf? ' + path
|
||||
|
||||
def dir(self, tree, path):
|
||||
if path:
|
||||
for name in path.split('/'):
|
||||
@ -585,7 +577,9 @@ class repowatcher(pollable):
|
||||
self.ui.note(_('%s reading %d events\n') %
|
||||
(self.event_time(), len(events)))
|
||||
for evt in events:
|
||||
wpath = self.wpath(evt)
|
||||
assert evt.fullpath.startswith(self.wprefix)
|
||||
wpath = evt.fullpath[len(self.wprefix):]
|
||||
|
||||
if evt.mask & inotify.IN_UNMOUNT:
|
||||
self.process_unmount(wpath, evt)
|
||||
elif evt.mask & (inotify.IN_MODIFY | inotify.IN_ATTRIB):
|
||||
|
Loading…
Reference in New Issue
Block a user