[PATCH 1 of 2 RFC] hgweb: support multiple directories for the same path

timeless timeless at gmail.com
Tue Mar 15 21:35:58 CDT 2011


# HG changeset patch
# User timeless <timeless at gmail.com>
# Date 1300241217 -3600
# Node ID d1b2d37302564f3638fe96478952e47778284b73
# Parent  0652b2da832daada866a68f7a4359227570c2447
hgweb: support multiple directories for the same path

[paths]
/dir = /path/1/*, /path/2/*

diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -77,7 +77,10 @@ class hgwebdir(object):
             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):


More information about the Mercurial-devel mailing list