comparison mercurial/util.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 c9cd63a6fce9
children 8b55c0ba8048
comparison
equal deleted inserted replaced
3414:9b1c126b74cd 3415:ec6f400cff4d
13 """ 13 """
14 14
15 from i18n import gettext as _ 15 from i18n import gettext as _
16 from demandload import * 16 from demandload import *
17 demandload(globals(), "cStringIO errno getpass popen2 re shutil sys tempfile") 17 demandload(globals(), "cStringIO errno getpass popen2 re shutil sys tempfile")
18 demandload(globals(), "os threading time calendar") 18 demandload(globals(), "os threading time calendar ConfigParser")
19 19
20 # used by parsedate 20 # used by parsedate
21 defaultdateformats = ('%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M', 21 defaultdateformats = ('%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M',
22 '%a %b %d %H:%M:%S %Y') 22 '%a %b %d %H:%M:%S %Y')
23 23
24 class SignalInterrupt(Exception): 24 class SignalInterrupt(Exception):
25 """Exception raised on SIGTERM and SIGHUP.""" 25 """Exception raised on SIGTERM and SIGHUP."""
26
27 # like SafeConfigParser but with case-sensitive keys
28 class configparser(ConfigParser.SafeConfigParser):
29 def optionxform(self, optionstr):
30 return optionstr
26 31
27 def cachefunc(func): 32 def cachefunc(func):
28 '''cache the result of function calls''' 33 '''cache the result of function calls'''
29 # XXX doesn't handle keywords args 34 # XXX doesn't handle keywords args
30 cache = {} 35 cache = {}