Show More
@@ -0,0 +1,7 b'' | |||||
|
1 | #!/bin/sh | |||
|
2 | ||||
|
3 | echo '[Section]' >> $HGRCPATH | |||
|
4 | echo 'KeY = Case Sensitive' >> $HGRCPATH | |||
|
5 | echo 'key = lower case' >> $HGRCPATH | |||
|
6 | ||||
|
7 | hg showconfig |
@@ -8,7 +8,7 b'' | |||||
8 |
|
8 | |||
9 | import os |
|
9 | import os | |
10 | from mercurial.demandload import demandload |
|
10 | from mercurial.demandload import demandload | |
11 |
demandload(globals(), " |
|
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") | |
@@ -30,7 +30,7 b' class hgwebdir(object):' | |||||
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 = |
|
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'): |
@@ -11,7 +11,7 b' demandload(globals(), "errno getpass os ' | |||||
11 | demandload(globals(), "ConfigParser traceback util") |
|
11 | demandload(globals(), "ConfigParser traceback util") | |
12 |
|
12 | |||
13 | def dupconfig(orig): |
|
13 | def dupconfig(orig): | |
14 |
new = |
|
14 | new = util.configparser(orig.defaults()) | |
15 | updateconfig(orig, new) |
|
15 | updateconfig(orig, new) | |
16 | return new |
|
16 | return new | |
17 |
|
17 | |||
@@ -37,7 +37,7 b' class ui(object):' | |||||
37 | self.debugflag = debug |
|
37 | self.debugflag = debug | |
38 | self.interactive = interactive |
|
38 | self.interactive = interactive | |
39 | self.traceback = traceback |
|
39 | self.traceback = traceback | |
40 |
self.cdata = |
|
40 | self.cdata = util.configparser() | |
41 | self.readconfig(util.rcpath()) |
|
41 | self.readconfig(util.rcpath()) | |
42 | self.updateopts(verbose, debug, quiet, interactive) |
|
42 | self.updateopts(verbose, debug, quiet, interactive) | |
43 | else: |
|
43 | else: | |
@@ -126,7 +126,7 b' class ui(object):' | |||||
126 |
|
126 | |||
127 | def setconfig(self, section, name, value): |
|
127 | def setconfig(self, section, name, value): | |
128 | if not self.overlay: |
|
128 | if not self.overlay: | |
129 |
self.overlay = |
|
129 | self.overlay = util.configparser() | |
130 | for cdata in (self.overlay, self.cdata): |
|
130 | for cdata in (self.overlay, self.cdata): | |
131 | if not cdata.has_section(section): |
|
131 | if not cdata.has_section(section): | |
132 | cdata.add_section(section) |
|
132 | cdata.add_section(section) |
@@ -15,7 +15,7 b' platform-specific details from the core.' | |||||
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', | |
@@ -24,6 +24,11 b" defaultdateformats = ('%Y-%m-%d %H:%M:%S" | |||||
24 | class SignalInterrupt(Exception): |
|
24 | class SignalInterrupt(Exception): | |
25 | """Exception raised on SIGTERM and SIGHUP.""" |
|
25 | """Exception raised on SIGTERM and SIGHUP.""" | |
26 |
|
26 | |||
|
27 | # like SafeConfigParser but with case-sensitive keys | |||
|
28 | class configparser(ConfigParser.SafeConfigParser): | |||
|
29 | def optionxform(self, optionstr): | |||
|
30 | return optionstr | |||
|
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 |
General Comments 0
You need to be logged in to leave comments.
Login now