##// END OF EJS Templates
inotify: server: move split() out of server...
Nicolas Dumazet -
r8787:9aca7650 default
parent child Browse files
Show More
@@ -26,6 +26,12 b' def join(a, b):'
26 return a + '/' + b
26 return a + '/' + b
27 return b
27 return b
28
28
29 def split(path):
30 c = path.rfind('/')
31 if c == -1:
32 return '', path
33 return path[:c], path[c+1:]
34
29 walk_ignored_errors = (errno.ENOENT, errno.ENAMETOOLONG)
35 walk_ignored_errors = (errno.ENOENT, errno.ENAMETOOLONG)
30
36
31 def walkrepodirs(repo):
37 def walkrepodirs(repo):
@@ -251,12 +257,6 b' class repowatcher(pollable):'
251 return 'd'
257 return 'd'
252 return tree
258 return tree
253
259
254 def split(self, path):
255 c = path.rfind('/')
256 if c == -1:
257 return '', path
258 return path[:c], path[c+1:]
259
260 def filestatus(self, fn, st):
260 def filestatus(self, fn, st):
261 try:
261 try:
262 type_, mode, size, time = self.repo.dirstate._map[fn][:4]
262 type_, mode, size, time = self.repo.dirstate._map[fn][:4]
@@ -307,7 +307,7 b' class repowatcher(pollable):'
307 newstatus: - char in (statuskeys + 'ni'), new status to apply.
307 newstatus: - char in (statuskeys + 'ni'), new status to apply.
308 - or None, to stop tracking wfn
308 - or None, to stop tracking wfn
309 '''
309 '''
310 root, fn = self.split(wfn)
310 root, fn = split(wfn)
311 d = self.dir(self.tree, root)
311 d = self.dir(self.tree, root)
312
312
313 oldstatus = d.get(fn)
313 oldstatus = d.get(fn)
@@ -346,7 +346,7 b' class repowatcher(pollable):'
346 if wfn not in self.repo.dirstate:
346 if wfn not in self.repo.dirstate:
347 nuke.append(wfn)
347 nuke.append(wfn)
348 for wfn in nuke:
348 for wfn in nuke:
349 root, fn = self.split(wfn)
349 root, fn = split(wfn)
350 del self.dir(self.statustrees[key], root)[fn]
350 del self.dir(self.statustrees[key], root)[fn]
351 del self.dir(self.tree, root)[fn]
351 del self.dir(self.tree, root)[fn]
352
352
General Comments 0
You need to be logged in to leave comments. Login now