changeset 1143:4fffb3d84b7c

Allow list of (virtual, real) or dictionary to be passed to hgwebdir.
author Thomas Arendsen Hein <thomas@intevation.de>
date Mon, 29 Aug 2005 07:39:01 +0200
parents 74d184a40a2e
children 8a39df05d2c1
files mercurial/hgweb.py
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb.py	Mon Aug 29 07:34:35 2005 +0200
+++ b/mercurial/hgweb.py	Mon Aug 29 07:39:01 2005 +0200
@@ -922,10 +922,16 @@
 # This is a stopgap
 class hgwebdir:
     def __init__(self, config):
-        cp = ConfigParser.SafeConfigParser()
-        cp.read(config)
-        self.repos = cp.items("paths")
-        self.repos.sort()
+        if type(config) == type([]):
+            self.repos = config
+        elif type(config) == type({}):
+            self.repos = config.items()
+            self.repos.sort()
+        else:
+            cp = ConfigParser.SafeConfigParser()
+            cp.read(config)
+            self.repos = cp.items("paths")
+            self.repos.sort()
 
     def run(self):
         def header(**map):