mercurial/hgweb/hgwebdir_mod.py
changeset 7523 e60aaae83323
parent 7450 79d1bb737c16
child 7560 305efd897a63
--- a/mercurial/hgweb/hgwebdir_mod.py	Mon Dec 15 12:02:18 2008 -0800
+++ b/mercurial/hgweb/hgwebdir_mod.py	Thu Dec 18 22:32:48 2008 +0100
@@ -54,13 +54,18 @@
                 paths = cleannames(cp.items('paths'))
                 for prefix, root in paths:
                     roothead, roottail = os.path.split(root)
-                    if roottail != '*':
+                    # "foo = /bar/*" makes every subrepo of /bar/ to be
+                    # mounted as foo/subrepo
+                    # and "foo = /bar/**" does even recurse inside the
+                    # subdirectories, remember to use it without working dir.
+                    try:
+                        recurse = {'*': False, '**': True}[roottail]
+                    except KeyError:
                         self.repos.append((prefix, root))
                         continue
-                    # "foo = /bar/*" makes every subrepo of /bar/ to be
-                    # mounted as foo/subrepo
                     roothead = os.path.normpath(roothead)
-                    for path in util.walkrepos(roothead, followsym=True):
+                    for path in util.walkrepos(roothead, followsym=True,
+                                               recurse=recurse):
                         path = os.path.normpath(path)
                         name = util.pconvert(path[len(roothead):]).strip('/')
                         if prefix: