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
--- 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))