changeset 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 a00a4db76a15
children 6f44b1adc948
files hgext/inotify/server.py
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
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