[PATCH 5 of 6] Allow list of (virtual, real) or dictionary to be passed to hgwebdir

Thomas Arendsen Hein thomas at intevation.de
Mon Aug 29 00:44:01 CDT 2005


# HG changeset patch
# User Thomas Arendsen Hein <thomas at intevation.de>
# Node ID 4fffb3d84b7c794f9fd61088b07abf0f3fa6a0bd
# Parent  74d184a40a2ea2fb6bddc518af8fa3953d0b02f6
Allow list of (virtual, real) or dictionary to be passed to hgwebdir.

diff -r 74d184a40a2e -r 4fffb3d84b7c mercurial/hgweb.py
--- a/mercurial/hgweb.py	Mon Aug 29 05:34:35 2005
+++ b/mercurial/hgweb.py	Mon Aug 29 05:39:01 2005
@@ -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):


More information about the Mercurial mailing list