##// END OF EJS Templates
Add a features list to branches.cache to detect caches of old hg versions....
Add a features list to branches.cache to detect caches of old hg versions. The leading space in the written file makes sure that the feature list never can match an existing version, even if the first feature can be read as hex. Additionally old hg versions display the id with --debug, too.

File last commit:

r4069:3fef1348 default
r4168:bbfe5a3f default
Show More
test-ui-config
72 lines | 2.4 KiB | text/plain | TextLexer
Thomas Arendsen Hein
Allow using default values with ui.configlist, too, and add a test for this.
r2502 #!/usr/bin/env python
Alexis S. L. Carvalho
move the parsing of --config options to commands.py
r3346 from mercurial import ui, util, commands
Thomas Arendsen Hein
Allow using default values with ui.configlist, too, and add a test for this.
r2502
testui = ui.ui()
Alexis S. L. Carvalho
move the parsing of --config options to commands.py
r3346 parsed = commands.parseconfig([
Thomas Arendsen Hein
Allow using default values with ui.configlist, too, and add a test for this.
r2502 'values.string=string value',
'values.bool1=true',
'values.bool2=false',
'lists.list1=foo',
'lists.list2=foo bar baz',
'lists.list3=alice, bob',
'lists.list4=foo bar baz alice, bob',
Thomas Arendsen Hein
Include section name and parameter name (if available) in config errors....
r3073 'interpolation.value1=hallo',
'interpolation.value2=%(value1)s world',
'interpolation.value3=%(novalue)s',
'interpolation.value4=%(bad)1',
'interpolation.value5=%bad2',
Thomas Arendsen Hein
Allow using default values with ui.configlist, too, and add a test for this.
r2502 ])
Alexis S. L. Carvalho
move the parsing of --config options to commands.py
r3346 testui.updateopts(config=parsed)
Thomas Arendsen Hein
Allow using default values with ui.configlist, too, and add a test for this.
r2502
print repr(testui.configitems('values'))
print repr(testui.configitems('lists'))
Thomas Arendsen Hein
Include section name and parameter name (if available) in config errors....
r3073 try:
print repr(testui.configitems('interpolation'))
except util.Abort, inst:
print inst
Thomas Arendsen Hein
Allow using default values with ui.configlist, too, and add a test for this.
r2502 print "---"
print repr(testui.config('values', 'string'))
print repr(testui.config('values', 'bool1'))
print repr(testui.config('values', 'bool2'))
print repr(testui.config('values', 'unknown'))
print "---"
try:
print repr(testui.configbool('values', 'string'))
except ValueError, why:
print why
print repr(testui.configbool('values', 'bool1'))
print repr(testui.configbool('values', 'bool2'))
print repr(testui.configbool('values', 'bool2', True))
print repr(testui.configbool('values', 'unknown'))
print repr(testui.configbool('values', 'unknown', True))
print "---"
print repr(testui.configlist('lists', 'list1'))
print repr(testui.configlist('lists', 'list2'))
print repr(testui.configlist('lists', 'list3'))
print repr(testui.configlist('lists', 'list4'))
print repr(testui.configlist('lists', 'list4', ['foo']))
print repr(testui.configlist('lists', 'unknown'))
print repr(testui.configlist('lists', 'unknown', ''))
print repr(testui.configlist('lists', 'unknown', 'foo'))
print repr(testui.configlist('lists', 'unknown', ['foo']))
print repr(testui.configlist('lists', 'unknown', 'foo bar'))
print repr(testui.configlist('lists', 'unknown', 'foo, bar'))
print repr(testui.configlist('lists', 'unknown', ['foo bar']))
print repr(testui.configlist('lists', 'unknown', ['foo', 'bar']))
print "---"
Thomas Arendsen Hein
Include section name and parameter name (if available) in config errors....
r3073 print repr(testui.config('interpolation', 'value1'))
print repr(testui.config('interpolation', 'value2'))
try:
print repr(testui.config('interpolation', 'value3'))
except util.Abort, inst:
print inst
try:
print repr(testui.config('interpolation', 'value4'))
except util.Abort, inst:
print inst
try:
print repr(testui.config('interpolation', 'value5'))
except util.Abort, inst:
print inst
print "---"