changeset 46:8075151c30e9

enumerate_repos() does not skip directories by accident any more.
author Simon Law <simon@akoha.org>
date Fri, 01 Jun 2007 15:50:18 -0400
parents c00f4879211c
children 7ed36c52acd0
files forest.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/forest.py	Fri Mar 30 18:25:54 2007 +0200
+++ b/forest.py	Fri Jun 01 15:50:18 2007 -0400
@@ -90,7 +90,8 @@
     while paths:
         path = paths.pop()
         for root, dirs, files in os.walk(path, onerror=errhandler):
-            for d in dirs:
+            hgdirs = dirs[:]  # Shallow-copy to protect d from dirs.remove() 
+            for d in hgdirs:
                 if d == '.hg':
                     res.append(root)
                     dirs.remove(d)