##// END OF EJS Templates
ui: handle leading newlines/spaces/commas in configlist...
Thomas Arendsen Hein -
r11309:ef7636ef default
parent child Browse files
Show More
@@ -228,7 +228,7 b' class ui(object):'
228 if result is None:
228 if result is None:
229 result = default or []
229 result = default or []
230 if isinstance(result, basestring):
230 if isinstance(result, basestring):
231 result = _configlist(result)
231 result = _configlist(result.lstrip(' ,\n'))
232 if result is None:
232 if result is None:
233 result = default or []
233 result = default or []
234 return result
234 return result
@@ -24,6 +24,7 b' parsed = dispatch._parseconfig(testui, ['
24 'lists.list15=" just with starting quotation',
24 'lists.list15=" just with starting quotation',
25 'lists.list16="longer quotation" with "no ending quotation',
25 'lists.list16="longer quotation" with "no ending quotation',
26 'lists.list17=this is \\" "not a quotation mark"',
26 'lists.list17=this is \\" "not a quotation mark"',
27 'lists.list18=\n \n\nding\ndong',
27 ])
28 ])
28
29
29 print repr(testui.configitems('values'))
30 print repr(testui.configitems('values'))
@@ -62,6 +63,7 b" print repr(testui.configlist('lists', 'l"
62 print repr(testui.configlist('lists', 'list15'))
63 print repr(testui.configlist('lists', 'list15'))
63 print repr(testui.configlist('lists', 'list16'))
64 print repr(testui.configlist('lists', 'list16'))
64 print repr(testui.configlist('lists', 'list17'))
65 print repr(testui.configlist('lists', 'list17'))
66 print repr(testui.configlist('lists', 'list18'))
65 print repr(testui.configlist('lists', 'unknown'))
67 print repr(testui.configlist('lists', 'unknown'))
66 print repr(testui.configlist('lists', 'unknown', ''))
68 print repr(testui.configlist('lists', 'unknown', ''))
67 print repr(testui.configlist('lists', 'unknown', 'foo'))
69 print repr(testui.configlist('lists', 'unknown', 'foo'))
@@ -1,5 +1,5 b''
1 [('string', 'string value'), ('bool1', 'true'), ('bool2', 'false')]
1 [('string', 'string value'), ('bool1', 'true'), ('bool2', 'false')]
2 [('list1', 'foo'), ('list2', 'foo bar baz'), ('list3', 'alice, bob'), ('list4', 'foo bar baz alice, bob'), ('list5', 'abc d"ef"g "hij def"'), ('list6', '"hello world", "how are you?"'), ('list7', 'Do"Not"Separate'), ('list8', '"Do"Separate'), ('list9', '"Do\\"NotSeparate"'), ('list10', 'string "with extraneous" quotation mark"'), ('list11', 'x, y'), ('list12', '"x", "y"'), ('list13', '""" key = "x", "y" """'), ('list14', ',,,, '), ('list15', '" just with starting quotation'), ('list16', '"longer quotation" with "no ending quotation'), ('list17', 'this is \\" "not a quotation mark"')]
2 [('list1', 'foo'), ('list2', 'foo bar baz'), ('list3', 'alice, bob'), ('list4', 'foo bar baz alice, bob'), ('list5', 'abc d"ef"g "hij def"'), ('list6', '"hello world", "how are you?"'), ('list7', 'Do"Not"Separate'), ('list8', '"Do"Separate'), ('list9', '"Do\\"NotSeparate"'), ('list10', 'string "with extraneous" quotation mark"'), ('list11', 'x, y'), ('list12', '"x", "y"'), ('list13', '""" key = "x", "y" """'), ('list14', ',,,, '), ('list15', '" just with starting quotation'), ('list16', '"longer quotation" with "no ending quotation'), ('list17', 'this is \\" "not a quotation mark"'), ('list18', '\n \n\nding\ndong')]
3 ---
3 ---
4 'string value'
4 'string value'
5 'true'
5 'true'
@@ -31,6 +31,7 b' True'
31 ['"', 'just', 'with', 'starting', 'quotation']
31 ['"', 'just', 'with', 'starting', 'quotation']
32 ['longer quotation', 'with', '"no', 'ending', 'quotation']
32 ['longer quotation', 'with', '"no', 'ending', 'quotation']
33 ['this', 'is', '"', 'not a quotation mark']
33 ['this', 'is', '"', 'not a quotation mark']
34 ['ding', 'dong']
34 []
35 []
35 []
36 []
36 ['foo']
37 ['foo']
General Comments 0
You need to be logged in to leave comments. Login now