##// END OF EJS Templates
inotify: inotify.server.walk*() remove unnecessary var...
Nicolas Dumazet -
r8324:b923d599 default
parent child Browse files
Show More
@@ -35,12 +35,10 b' def walkrepodirs(repo):'
35
35
36 def walkit(dirname, top):
36 def walkit(dirname, top):
37 fullpath = rootslash + dirname
37 fullpath = rootslash + dirname
38 hginside = False
39 try:
38 try:
40 for name, kind in osutil.listdir(fullpath):
39 for name, kind in osutil.listdir(fullpath):
41 if kind == stat.S_IFDIR:
40 if kind == stat.S_IFDIR:
42 if name == '.hg':
41 if name == '.hg':
43 hginside = True
44 if not top:
42 if not top:
45 return
43 return
46 else:
44 else:
@@ -52,8 +50,7 b' def walkrepodirs(repo):'
52 except OSError, err:
50 except OSError, err:
53 if err.errno not in walk_ignored_errors:
51 if err.errno not in walk_ignored_errors:
54 raise
52 raise
55 if top or not hginside:
53 yield fullpath
56 yield fullpath
57
54
58 return walkit('', True)
55 return walkit('', True)
59
56
@@ -66,14 +63,12 b' def walk(repo, root):'
66
63
67 def walkit(root, reporoot):
64 def walkit(root, reporoot):
68 files, dirs = [], []
65 files, dirs = [], []
69 hginside = False
70
66
71 try:
67 try:
72 fullpath = rootslash + root
68 fullpath = rootslash + root
73 for name, kind in osutil.listdir(fullpath):
69 for name, kind in osutil.listdir(fullpath):
74 if kind == stat.S_IFDIR:
70 if kind == stat.S_IFDIR:
75 if name == '.hg':
71 if name == '.hg':
76 hginside = True
77 if reporoot:
72 if reporoot:
78 continue
73 continue
79 else:
74 else:
@@ -81,8 +76,7 b' def walk(repo, root):'
81 dirs.append(name)
76 dirs.append(name)
82 elif kind in (stat.S_IFREG, stat.S_IFLNK):
77 elif kind in (stat.S_IFREG, stat.S_IFLNK):
83 files.append((name, kind))
78 files.append((name, kind))
84 if reporoot or not hginside:
79 yield fullpath, dirs, files
85 yield fullpath, dirs, files
86
80
87 for subdir in dirs:
81 for subdir in dirs:
88 path = join(root, subdir)
82 path = join(root, subdir)
General Comments 0
You need to be logged in to leave comments. Login now