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