inotify: inotify.server.walk*() cleanup
authorNicolas Dumazet <nicdumz.commits@gmail.com>
Mon, 04 May 2009 17:17:03 +0900
changeset 8323 589a82fb02a2
parent 8322 3c6c21eb3416
child 8324 b923d599c309
inotify: inotify.server.walk*() cleanup When not in root repo, if we meet a .hg, bail out. break was used, but return can be safely used instead: if we go through break then (top or not hginside) == False -> nothing is done after the for loop
hgext/inotify/server.py
--- a/hgext/inotify/server.py	Mon May 04 17:11:49 2009 +0900
+++ b/hgext/inotify/server.py	Mon May 04 17:17:03 2009 +0900
@@ -41,7 +41,8 @@
                 if kind == stat.S_IFDIR:
                     if name == '.hg':
                         hginside = True
-                        if not top: break
+                        if not top:
+                            return
                     else:
                         d = join(dirname, name)
                         if repo.dirstate._ignore(d):
@@ -76,7 +77,7 @@
                         if reporoot:
                             continue
                         else:
-                            break
+                            return
                     dirs.append(name)
                 elif kind in (stat.S_IFREG, stat.S_IFLNK):
                     files.append((name, kind))