# HG changeset patch # User Nicolas Dumazet # Date 2009-05-04 08:06:59 # Node ID ec985dcfd7da64960c3a6908f948b1eef0c67175 # Parent a1305c1c8d8e51fa1e8d6e7d75fbbbfb6b4f0753 inotify: inotify.server.walkrepodirs() simplify compute string concatenation only once diff --git a/hgext/inotify/server.py b/hgext/inotify/server.py --- a/hgext/inotify/server.py +++ b/hgext/inotify/server.py @@ -33,9 +33,10 @@ def walkrepodirs(repo): Exclude the .hg directory, any nested repos, and ignored dirs.''' rootslash = repo.root + os.sep def walkit(dirname, top): + fullpath = rootslash + dirname hginside = False try: - for name, kind in osutil.listdir(rootslash + dirname): + for name, kind in osutil.listdir(fullpath): if kind == stat.S_IFDIR: if name == '.hg': hginside = True @@ -50,7 +51,7 @@ def walkrepodirs(repo): except OSError, err: if err.errno not in walk_ignored_errors: raise - yield rootslash + dirname, hginside + yield fullpath, hginside for dirname, hginside in walkit('', True): yield dirname