Indentation and comment changes to multidir_deep.
Wed Dec 21 14:29:46 UTC 2005 Alberto Bertogli <albertogli@telpin.com.ar>
* Indentation and comment changes to multidir_deep.
diff -rN -u old-darcsweb/config.py.sample new-darcsweb/config.py.sample
--- old-darcsweb/config.py.sample 2014-04-11 16:16:24.000000000 +0000
+++ new-darcsweb/config.py.sample 2014-04-11 16:16:24.000000000 +0000
@@ -93,14 +93,16 @@
# The name is taken from the directory, and inside the variables the string
# "%(name)s" gets expanded to the it.
#
-# If you set multidir_deep to True then all subdirectories are searched
-# for darcs repositories. Subdirectories starting with a dot (.) are not
-# searched. This may be slow, if huge directory trees must be searched.
+# If you set multidir_deep to True (note the capitalization) then all
+# subdirectories are searched for darcs repositories. Subdirectories starting
+# with a dot (.) are not searched. This may be slow, if huge directory trees
+# must be searched. It's unnecesary unless you have a multidir with several
+# nested repositories. It defaults to False, and it's optional.
#
class multi1:
multidir = '/usr/local/src'
- multidir_deep = False
+ #multidir_deep = False
repodesc = 'Repository for %(name)s'
repourl = 'http://auriga.wearlab.de/~alb/repos/%(name)s'
repoencoding = 'latin1'
diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi
--- old-darcsweb/darcsweb.cgi 2014-04-11 16:16:24.000000000 +0000
+++ new-darcsweb/darcsweb.cgi 2014-04-11 16:16:24.000000000 +0000
@@ -1973,13 +1973,15 @@
entries = []
if 'multidir_deep' in dir(c) and c.multidir_deep:
- for (root, dirs, files) in os.walk(c.multidir):
- # do not visit hidden directories
- dirs[:] = [d for d in dirs if not d.startswith('.')]
- if '_darcs' in dirs:
- entries.append(root[1+len(c.multidir):])
+ for (root, dirs, files) in os.walk(c.multidir):
+ # do not visit hidden directories
+ dirs[:] = [d for d in dirs \
+ if not d.startswith('.')]
+ if '_darcs' in dirs:
+ p = root[1 + len(c.multidir):]
+ entries.append(p)
else:
- entries = os.listdir(c.multidir)
+ entries = os.listdir(c.multidir)
entries.sort()
for name in entries: