mercurial/hgweb/hgwebdir_mod.py
changeset 7450 79d1bb737c16
parent 7396 526c40a74bd0
child 7523 e60aaae83323
--- a/mercurial/hgweb/hgwebdir_mod.py	Mon Dec 01 13:44:34 2008 +0100
+++ b/mercurial/hgweb/hgwebdir_mod.py	Mon Dec 01 14:20:20 2008 +0100
@@ -51,7 +51,21 @@
                 if cp.has_option('web', 'baseurl'):
                     self._baseurl = cp.get('web', 'baseurl')
             if cp.has_section('paths'):
-                self.repos.extend(cleannames(cp.items('paths')))
+                paths = cleannames(cp.items('paths'))
+                for prefix, root in paths:
+                    roothead, roottail = os.path.split(root)
+                    if roottail != '*':
+                        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):
+                        path = os.path.normpath(path)
+                        name = util.pconvert(path[len(roothead):]).strip('/')
+                        if prefix:
+                            name = prefix + '/' + name
+                        self.repos.append((name, path))
             if cp.has_section('collections'):
                 for prefix, root in cp.items('collections'):
                     for path in util.walkrepos(root, followsym=True):