Show More
@@ -454,6 +454,7 test-tags.t | |||
|
454 | 454 | test-template-engine.t |
|
455 | 455 | test-treemanifest.t |
|
456 | 456 | test-ui-color.py |
|
457 | test-ui-config.py | |
|
457 | 458 | test-ui-verbosity.py |
|
458 | 459 | test-unamend.t |
|
459 | 460 | test-uncommit.t |
@@ -2,8 +2,12 from __future__ import absolute_import, | |||
|
2 | 2 | from mercurial import ( |
|
3 | 3 | dispatch, |
|
4 | 4 | error, |
|
5 | pycompat, | |
|
5 | 6 | ui as uimod, |
|
6 | 7 | ) |
|
8 | from mercurial.utils import ( | |
|
9 | stringutil, | |
|
10 | ) | |
|
7 | 11 | |
|
8 | 12 | testui = uimod.ui.load() |
|
9 | 13 | |
@@ -46,59 +50,62 parsed = dispatch._parseconfig(testui, [ | |||
|
46 | 50 | b'date.invalid=0' |
|
47 | 51 | ]) |
|
48 | 52 | |
|
49 | print(repr(testui.configitems(b'values'))) | |
|
50 | print(repr(testui.configitems(b'lists'))) | |
|
53 | def pprint(obj): | |
|
54 | return stringutil.pprint(obj, bprefix=False).decode('ascii') | |
|
55 | ||
|
56 | print(pprint(testui.configitems(b'values'))) | |
|
57 | print(pprint(testui.configitems(b'lists'))) | |
|
51 | 58 | print("---") |
|
52 |
print( |
|
|
53 |
print( |
|
|
54 |
print( |
|
|
55 |
print( |
|
|
59 | print(pprint(testui.config(b'values', b'string'))) | |
|
60 | print(pprint(testui.config(b'values', b'bool1'))) | |
|
61 | print(pprint(testui.config(b'values', b'bool2'))) | |
|
62 | print(pprint(testui.config(b'values', b'unknown'))) | |
|
56 | 63 | print("---") |
|
57 | 64 | try: |
|
58 |
print( |
|
|
65 | print(pprint(testui.configbool(b'values', b'string'))) | |
|
59 | 66 | except error.ConfigError as inst: |
|
60 | print(inst) | |
|
61 |
print( |
|
|
62 |
print( |
|
|
63 |
print( |
|
|
64 |
print( |
|
|
65 |
print( |
|
|
67 | print(pprint(pycompat.bytestr(inst))) | |
|
68 | print(pprint(testui.configbool(b'values', b'bool1'))) | |
|
69 | print(pprint(testui.configbool(b'values', b'bool2'))) | |
|
70 | print(pprint(testui.configbool(b'values', b'bool2', True))) | |
|
71 | print(pprint(testui.configbool(b'values', b'unknown'))) | |
|
72 | print(pprint(testui.configbool(b'values', b'unknown', True))) | |
|
66 | 73 | print("---") |
|
67 |
print( |
|
|
68 |
print( |
|
|
74 | print(pprint(testui.configint(b'values', b'int1'))) | |
|
75 | print(pprint(testui.configint(b'values', b'int2'))) | |
|
69 | 76 | print("---") |
|
70 |
print( |
|
|
71 |
print( |
|
|
72 |
print( |
|
|
73 |
print( |
|
|
74 |
print( |
|
|
75 |
print( |
|
|
76 |
print( |
|
|
77 |
print( |
|
|
78 |
print( |
|
|
79 |
print( |
|
|
80 |
print( |
|
|
81 |
print( |
|
|
82 |
print( |
|
|
83 |
print( |
|
|
84 |
print( |
|
|
85 |
print( |
|
|
86 |
print( |
|
|
87 |
print( |
|
|
88 |
print( |
|
|
89 |
print( |
|
|
90 |
print( |
|
|
91 |
print( |
|
|
92 |
print( |
|
|
93 |
print( |
|
|
94 |
print( |
|
|
95 |
print( |
|
|
96 |
print( |
|
|
77 | print(pprint(testui.configlist(b'lists', b'list1'))) | |
|
78 | print(pprint(testui.configlist(b'lists', b'list2'))) | |
|
79 | print(pprint(testui.configlist(b'lists', b'list3'))) | |
|
80 | print(pprint(testui.configlist(b'lists', b'list4'))) | |
|
81 | print(pprint(testui.configlist(b'lists', b'list4', [b'foo']))) | |
|
82 | print(pprint(testui.configlist(b'lists', b'list5'))) | |
|
83 | print(pprint(testui.configlist(b'lists', b'list6'))) | |
|
84 | print(pprint(testui.configlist(b'lists', b'list7'))) | |
|
85 | print(pprint(testui.configlist(b'lists', b'list8'))) | |
|
86 | print(pprint(testui.configlist(b'lists', b'list9'))) | |
|
87 | print(pprint(testui.configlist(b'lists', b'list10'))) | |
|
88 | print(pprint(testui.configlist(b'lists', b'list11'))) | |
|
89 | print(pprint(testui.configlist(b'lists', b'list12'))) | |
|
90 | print(pprint(testui.configlist(b'lists', b'list13'))) | |
|
91 | print(pprint(testui.configlist(b'lists', b'list14'))) | |
|
92 | print(pprint(testui.configlist(b'lists', b'list15'))) | |
|
93 | print(pprint(testui.configlist(b'lists', b'list16'))) | |
|
94 | print(pprint(testui.configlist(b'lists', b'list17'))) | |
|
95 | print(pprint(testui.configlist(b'lists', b'list18'))) | |
|
96 | print(pprint(testui.configlist(b'lists', b'unknown'))) | |
|
97 | print(pprint(testui.configlist(b'lists', b'unknown', b''))) | |
|
98 | print(pprint(testui.configlist(b'lists', b'unknown', b'foo'))) | |
|
99 | print(pprint(testui.configlist(b'lists', b'unknown', [b'foo']))) | |
|
100 | print(pprint(testui.configlist(b'lists', b'unknown', b'foo bar'))) | |
|
101 | print(pprint(testui.configlist(b'lists', b'unknown', b'foo, bar'))) | |
|
102 | print(pprint(testui.configlist(b'lists', b'unknown', [b'foo bar']))) | |
|
103 | print(pprint(testui.configlist(b'lists', b'unknown', [b'foo', b'bar']))) | |
|
97 | 104 | print("---") |
|
98 |
print( |
|
|
99 |
print( |
|
|
105 | print(pprint(testui.configdate(b'date', b'epoch'))) | |
|
106 | print(pprint(testui.configdate(b'date', b'birth'))) | |
|
100 | 107 | |
|
101 |
print( |
|
|
108 | print(pprint(testui.config(b'values', b'String'))) | |
|
102 | 109 | |
|
103 | 110 | def function(): |
|
104 | 111 | pass |
General Comments 0
You need to be logged in to leave comments.
Login now