##// END OF EJS Templates
Catch illegal boolean values in hgrc nicely....
Thomas Arendsen Hein -
r4729:9881abfc default
parent child Browse files
Show More
@@ -237,7 +237,7 b' class ui(object):'
237 try:
237 try:
238 func = getattr(cdata, funcname)
238 func = getattr(cdata, funcname)
239 return func(section, name)
239 return func(section, name)
240 except ConfigParser.InterpolationError, inst:
240 except (ConfigParser.InterpolationError, ValueError), inst:
241 msg = _("Error in configuration section [%s] "
241 msg = _("Error in configuration section [%s] "
242 "parameter '%s':\n%s") % (section, name, inst)
242 "parameter '%s':\n%s") % (section, name, inst)
243 if abort:
243 if abort:
@@ -34,8 +34,8 b" print repr(testui.config('values', 'unkn"
34 print "---"
34 print "---"
35 try:
35 try:
36 print repr(testui.configbool('values', 'string'))
36 print repr(testui.configbool('values', 'string'))
37 except ValueError, why:
37 except util.Abort, inst:
38 print why
38 print inst
39 print repr(testui.configbool('values', 'bool1'))
39 print repr(testui.configbool('values', 'bool1'))
40 print repr(testui.configbool('values', 'bool2'))
40 print repr(testui.configbool('values', 'bool2'))
41 print repr(testui.configbool('values', 'bool2', True))
41 print repr(testui.configbool('values', 'bool2', True))
@@ -8,6 +8,7 b' Error in configuration section [interpol'
8 'false'
8 'false'
9 None
9 None
10 ---
10 ---
11 Error in configuration section [values] parameter 'string':
11 Not a boolean: string value
12 Not a boolean: string value
12 True
13 True
13 False
14 False
General Comments 0
You need to be logged in to leave comments. Login now