##// 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 228 if result is None:
229 229 result = default or []
230 230 if isinstance(result, basestring):
231 result = _configlist(result)
231 result = _configlist(result.lstrip(' ,\n'))
232 232 if result is None:
233 233 result = default or []
234 234 return result
@@ -24,6 +24,7 b' parsed = dispatch._parseconfig(testui, ['
24 24 'lists.list15=" just with starting quotation',
25 25 'lists.list16="longer quotation" with "no ending quotation',
26 26 'lists.list17=this is \\" "not a quotation mark"',
27 'lists.list18=\n \n\nding\ndong',
27 28 ])
28 29
29 30 print repr(testui.configitems('values'))
@@ -62,6 +63,7 b" print repr(testui.configlist('lists', 'l"
62 63 print repr(testui.configlist('lists', 'list15'))
63 64 print repr(testui.configlist('lists', 'list16'))
64 65 print repr(testui.configlist('lists', 'list17'))
66 print repr(testui.configlist('lists', 'list18'))
65 67 print repr(testui.configlist('lists', 'unknown'))
66 68 print repr(testui.configlist('lists', 'unknown', ''))
67 69 print repr(testui.configlist('lists', 'unknown', 'foo'))
@@ -1,5 +1,5 b''
1 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 4 'string value'
5 5 'true'
@@ -31,6 +31,7 b' True'
31 31 ['"', 'just', 'with', 'starting', 'quotation']
32 32 ['longer quotation', 'with', '"no', 'ending', 'quotation']
33 33 ['this', 'is', '"', 'not a quotation mark']
34 ['ding', 'dong']
34 35 []
35 36 []
36 37 ['foo']
General Comments 0
You need to be logged in to leave comments. Login now