changeset 4051:022056263354

hgwebdir: class hgwebdir should also accept a configparser instance
author Michael Gebetsroither <michael.geb@gmx.at>
date Tue, 30 Jan 2007 22:07:22 +0100
parents 75313c36aa04
children 431f3c1d3a37
files mercurial/hgweb/hgwebdir_mod.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py	Tue Jan 30 11:40:17 2007 -0800
+++ b/mercurial/hgweb/hgwebdir_mod.py	Tue Jan 30 22:07:22 2007 +0100
@@ -29,8 +29,11 @@
             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'):