hgweb: support multiple directories for the same path
authortimeless <timeless@gmail.com>
Wed, 16 Mar 2011 03:06:57 +0100
changeset 13667 8cbb59124e67
parent 13666 c49cddce0a81
child 13668 9a41af6b9f29
hgweb: support multiple directories for the same path [paths] /dir = /path/1/*, /path/2/*
mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py	Wed Mar 16 03:28:56 2011 +0100
+++ b/mercurial/hgweb/hgwebdir_mod.py	Wed Mar 16 03:06:57 2011 +0100
@@ -77,7 +77,10 @@
             if not os.path.exists(self.conf):
                 raise util.Abort(_('config file %s not found!') % self.conf)
             u.readconfig(self.conf, remap=map, trust=True)
-            paths = u.configitems('hgweb-paths')
+            paths = []
+            for name, ignored in u.configitems('hgweb-paths'):
+                for path in u.configlist('hgweb-paths', name):
+                    paths.append((name, path))
         elif isinstance(self.conf, (list, tuple)):
             paths = self.conf
         elif isinstance(self.conf, dict):