inotify: server.walk(): use yield instead of for
iterate on subdir when the directory is found, not
once all the directories are found, since yield order doesn't matter
--- a/hgext/inotify/server.py Thu May 14 10:59:55 2009 +0200
+++ b/hgext/inotify/server.py Mon May 04 18:19:26 2009 +0900
@@ -73,16 +73,15 @@
return
else:
dirs.append(name)
+ path = join(root, name)
+ if repo.dirstate._ignore(path):
+ continue
+ for result in walkit(path, False):
+ yield result
elif kind in (stat.S_IFREG, stat.S_IFLNK):
files.append(name)
yield fullpath, dirs, files
- for subdir in dirs:
- path = join(root, subdir)
- if repo.dirstate._ignore(path):
- continue
- for result in walkit(path, False):
- yield result
except OSError, err:
if err.errno not in walk_ignored_errors:
raise