Mercurial > hg
diff hgext/inotify/server.py @ 8381:f52fcc864df4
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
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Mon, 04 May 2009 18:19:26 +0900 |
parents | 114f067229bd |
children | 6f44b1adc948 |
line wrap: on
line diff
--- 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