inotify: inotify.server.walk() simplify control flow
authorNicolas Dumazet <nicdumz.commits@gmail.com>
Mon, 04 May 2009 18:04:41 +0900
changeset 8325 f2559645643a
parent 8324 b923d599c309
child 8326 b7017097a4ec
inotify: inotify.server.walk() simplify control flow
hgext/inotify/server.py
--- a/hgext/inotify/server.py	Mon May 04 17:58:26 2009 +0900
+++ b/hgext/inotify/server.py	Mon May 04 18:04:41 2009 +0900
@@ -69,11 +69,10 @@
             for name, kind in osutil.listdir(fullpath):
                 if kind == stat.S_IFDIR:
                     if name == '.hg':
-                        if reporoot:
-                            continue
-                        else:
+                        if not reporoot:
                             return
-                    dirs.append(name)
+                    else:
+                        dirs.append(name)
                 elif kind in (stat.S_IFREG, stat.S_IFLNK):
                     files.append((name, kind))
             yield fullpath, dirs, files