changeset 8321:ec985dcfd7da

inotify: inotify.server.walkrepodirs() simplify compute string concatenation only once
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Mon, 04 May 2009 17:06:59 +0900
parents a1305c1c8d8e
children 3c6c21eb3416
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 16:57:52 2009 +0900
+++ b/hgext/inotify/server.py	Mon May 04 17:06:59 2009 +0900
@@ -33,9 +33,10 @@
     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 @@
         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