Mercurial > hg
changeset 8323:589a82fb02a2
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
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Mon, 04 May 2009 17:17:03 +0900 |
parents | 3c6c21eb3416 |
children | b923d599c309 |
files | hgext/inotify/server.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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))