# HG changeset patch # User Nicolas Dumazet # Date 1241425023 -32400 # Node ID 589a82fb02a2ce865bf51026c79ee35da69d4d10 # Parent 3c6c21eb34161ee0c820b9c2323ef322fb0ede6f 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 diff -r 3c6c21eb3416 -r 589a82fb02a2 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))