comparison mercurial/hgweb/hgwebdir_mod.py @ 3415:ec6f400cff4d

Use a case-sensitive version of SafeConfigParser everywhere This change has the potential to break existing setups, but the current behaviour (the keys in configuration files are always lower-cased) can bite us in a few places: - no way to use a Command in [defaults] - hgext.Extension doesn't work in [extensions] - you can't use an Upper/case/PATH in the [paths] section of hgweb.config - you can't (easily) protect paths with upper-case letters with the acl extension - you can't specify a /Path/TO/a/rEPO in the [reposubs] section for the notify extension
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Mon, 16 Oct 2006 15:38:53 -0300
parents cf680c9ab1dd
children 2896ce093ec4
comparison
equal deleted inserted replaced
3414:9b1c126b74cd 3415:ec6f400cff4d
6 # This software may be used and distributed according to the terms 6 # This software may be used and distributed according to the terms
7 # of the GNU General Public License, incorporated herein by reference. 7 # of the GNU General Public License, incorporated herein by reference.
8 8
9 import os 9 import os
10 from mercurial.demandload import demandload 10 from mercurial.demandload import demandload
11 demandload(globals(), "ConfigParser mimetools cStringIO") 11 demandload(globals(), "mimetools cStringIO")
12 demandload(globals(), "mercurial:ui,hg,util,templater") 12 demandload(globals(), "mercurial:ui,hg,util,templater")
13 demandload(globals(), "mercurial.hgweb.hgweb_mod:hgweb") 13 demandload(globals(), "mercurial.hgweb.hgweb_mod:hgweb")
14 demandload(globals(), "mercurial.hgweb.common:get_mtime,staticfile,style_map") 14 demandload(globals(), "mercurial.hgweb.common:get_mtime,staticfile,style_map")
15 from mercurial.i18n import gettext as _ 15 from mercurial.i18n import gettext as _
16 16
28 self.repos_sorted = ('', False) 28 self.repos_sorted = ('', False)
29 elif isinstance(config, dict): 29 elif isinstance(config, dict):
30 self.repos = cleannames(config.items()) 30 self.repos = cleannames(config.items())
31 self.repos.sort() 31 self.repos.sort()
32 else: 32 else:
33 cp = ConfigParser.SafeConfigParser() 33 cp = util.configparser()
34 cp.read(config) 34 cp.read(config)
35 self.repos = [] 35 self.repos = []
36 if cp.has_section('web'): 36 if cp.has_section('web'):
37 if cp.has_option('web', 'motd'): 37 if cp.has_option('web', 'motd'):
38 self.motd = cp.get('web', 'motd') 38 self.motd = cp.get('web', 'motd')