diff 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
line wrap: on
line diff
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -15,7 +15,7 @@ platform-specific details from the core.
 from i18n import gettext as _
 from demandload import *
 demandload(globals(), "cStringIO errno getpass popen2 re shutil sys tempfile")
-demandload(globals(), "os threading time calendar")
+demandload(globals(), "os threading time calendar ConfigParser")
 
 # used by parsedate
 defaultdateformats = ('%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M',
@@ -24,6 +24,11 @@ defaultdateformats = ('%Y-%m-%d %H:%M:%S
 class SignalInterrupt(Exception):
     """Exception raised on SIGTERM and SIGHUP."""
 
+# like SafeConfigParser but with case-sensitive keys
+class configparser(ConfigParser.SafeConfigParser):
+    def optionxform(self, optionstr):
+        return optionstr
+
 def cachefunc(func):
     '''cache the result of function calls'''
     # XXX doesn't handle keywords args