hgwebdir: class hgwebdir should also accept a configparser instance
authorMichael Gebetsroither <michael.geb@gmx.at>
Tue, 30 Jan 2007 22:07:22 +0100
changeset 4051 022056263354
parent 4050 75313c36aa04
child 4059 431f3c1d3a37
hgwebdir: class hgwebdir should also accept a configparser instance
mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -29,8 +29,11 @@ class hgwebdir(object):
             self.repos = cleannames(config.items())
             self.repos.sort()
         else:
-            cp = util.configparser()
-            cp.read(config)
+            if isinstance(config, util.configparser):
+                cp = config
+            else:
+                cp = util.configparser()
+                cp.read(config)
             self.repos = []
             if cp.has_section('web'):
                 if cp.has_option('web', 'motd'):