comparison tests/test-ui-config @ 3346:1700a103458e

move the parsing of --config options to commands.py
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Tue, 10 Oct 2006 18:43:20 -0300
parents 24c1db20990c
children 3fef134832d8
comparison
equal deleted inserted replaced
3345:a09be4317f9c 3346:1700a103458e
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 from mercurial import ui, util 3 from mercurial import ui, util, commands
4 4
5 testui = ui.ui() 5 testui = ui.ui()
6 testui.updateopts(config=[ 6 parsed = commands.parseconfig([
7 'values.string=string value', 7 'values.string=string value',
8 'values.bool1=true', 8 'values.bool1=true',
9 'values.bool2=false', 9 'values.bool2=false',
10 'lists.list1=foo', 10 'lists.list1=foo',
11 'lists.list2=foo bar baz', 11 'lists.list2=foo bar baz',
15 'interpolation.value2=%(value1)s world', 15 'interpolation.value2=%(value1)s world',
16 'interpolation.value3=%(novalue)s', 16 'interpolation.value3=%(novalue)s',
17 'interpolation.value4=%(bad)1', 17 'interpolation.value4=%(bad)1',
18 'interpolation.value5=%bad2', 18 'interpolation.value5=%bad2',
19 ]) 19 ])
20 testui.updateopts(config=parsed)
20 21
21 print repr(testui.configitems('values')) 22 print repr(testui.configitems('values'))
22 print repr(testui.configitems('lists')) 23 print repr(testui.configitems('lists'))
23 try: 24 try:
24 print repr(testui.configitems('interpolation')) 25 print repr(testui.configitems('interpolation'))