Show More
@@ -48,6 +48,8 b' test-commit-amend.t' | |||
|
48 | 48 | test-commit-unresolved.t |
|
49 | 49 | test-commit.t |
|
50 | 50 | test-completion.t |
|
51 | test-config-env.py | |
|
52 | test-config.t | |
|
51 | 53 | test-conflict.t |
|
52 | 54 | test-confused-revert.t |
|
53 | 55 | test-contrib-check-code.t |
@@ -11,24 +11,24 b' from mercurial import (' | |||
|
11 | 11 | util, |
|
12 | 12 | ) |
|
13 | 13 | |
|
14 | testtmp = encoding.environ['TESTTMP'] | |
|
14 | testtmp = encoding.environ[b'TESTTMP'] | |
|
15 | 15 | |
|
16 | 16 | # prepare hgrc files |
|
17 | 17 | def join(name): |
|
18 | 18 | return os.path.join(testtmp, name) |
|
19 | 19 | |
|
20 | with open(join('sysrc'), 'w') as f: | |
|
21 | f.write('[ui]\neditor=e0\n[pager]\npager=p0\n') | |
|
20 | with open(join(b'sysrc'), 'wb') as f: | |
|
21 | f.write(b'[ui]\neditor=e0\n[pager]\npager=p0\n') | |
|
22 | 22 | |
|
23 | with open(join('userrc'), 'w') as f: | |
|
24 | f.write('[ui]\neditor=e1') | |
|
23 | with open(join(b'userrc'), 'wb') as f: | |
|
24 | f.write(b'[ui]\neditor=e1') | |
|
25 | 25 | |
|
26 | 26 | # replace rcpath functions so they point to the files above |
|
27 | 27 | def systemrcpath(): |
|
28 | return [join('sysrc')] | |
|
28 | return [join(b'sysrc')] | |
|
29 | 29 | |
|
30 | 30 | def userrcpath(): |
|
31 | return [join('userrc')] | |
|
31 | return [join(b'userrc')] | |
|
32 | 32 | |
|
33 | 33 | rcutil.systemrcpath = systemrcpath |
|
34 | 34 | rcutil.userrcpath = userrcpath |
@@ -41,9 +41,10 b' def printconfigs(env):' | |||
|
41 | 41 | ui = uimod.ui.load() |
|
42 | 42 | for section, name, value in ui.walkconfig(): |
|
43 | 43 | source = ui.configsource(section, name) |
|
44 | print('%s.%s=%s # %s' % (section, name, value, util.pconvert(source))) | |
|
45 | print('') | |
|
44 | util.stdout.write(b'%s.%s=%s # %s\n' | |
|
45 | % (section, name, value, util.pconvert(source))) | |
|
46 | util.stdout.write(b'\n') | |
|
46 | 47 | |
|
47 | 48 | # environment variable overrides |
|
48 | 49 | printconfigs({}) |
|
49 | printconfigs({'EDITOR': 'e2', 'PAGER': 'p2'}) | |
|
50 | printconfigs({b'EDITOR': b'e2', b'PAGER': b'p2'}) |
General Comments 0
You need to be logged in to leave comments.
Login now