##// END OF EJS Templates
tests: update duplicateoptions test to use bytestrings everywhere...
Augie Fackler -
r33689:5b2f331d default
parent child Browse files
Show More
@@ -1,41 +1,41 b''
1 from __future__ import absolute_import, print_function
1 from __future__ import absolute_import, print_function
2 import os
2 import os
3 from mercurial import (
3 from mercurial import (
4 commands,
4 commands,
5 extensions,
5 extensions,
6 ui as uimod,
6 ui as uimod,
7 )
7 )
8
8
9 ignore = {'highlight', 'win32text', 'factotum'}
9 ignore = {b'highlight', b'win32text', b'factotum'}
10
10
11 if os.name != 'nt':
11 if os.name != 'nt':
12 ignore.add('win32mbcs')
12 ignore.add(b'win32mbcs')
13
13
14 disabled = [ext for ext in extensions.disabled().keys() if ext not in ignore]
14 disabled = [ext for ext in extensions.disabled().keys() if ext not in ignore]
15
15
16 hgrc = open(os.environ["HGRCPATH"], 'w')
16 hgrc = open(os.environ["HGRCPATH"], 'wb')
17 hgrc.write('[extensions]\n')
17 hgrc.write(b'[extensions]\n')
18
18
19 for ext in disabled:
19 for ext in disabled:
20 hgrc.write(ext + '=\n')
20 hgrc.write(ext + b'=\n')
21
21
22 hgrc.close()
22 hgrc.close()
23
23
24 u = uimod.ui.load()
24 u = uimod.ui.load()
25 extensions.loadall(u)
25 extensions.loadall(u)
26
26
27 globalshort = set()
27 globalshort = set()
28 globallong = set()
28 globallong = set()
29 for option in commands.globalopts:
29 for option in commands.globalopts:
30 option[0] and globalshort.add(option[0])
30 option[0] and globalshort.add(option[0])
31 option[1] and globallong.add(option[1])
31 option[1] and globallong.add(option[1])
32
32
33 for cmd, entry in commands.table.iteritems():
33 for cmd, entry in commands.table.items():
34 seenshort = globalshort.copy()
34 seenshort = globalshort.copy()
35 seenlong = globallong.copy()
35 seenlong = globallong.copy()
36 for option in entry[1]:
36 for option in entry[1]:
37 if (option[0] and option[0] in seenshort) or \
37 if (option[0] and option[0] in seenshort) or \
38 (option[1] and option[1] in seenlong):
38 (option[1] and option[1] in seenlong):
39 print("command '" + cmd + "' has duplicate option " + str(option))
39 print("command '" + cmd + "' has duplicate option " + str(option))
40 seenshort.add(option[0])
40 seenshort.add(option[0])
41 seenlong.add(option[1])
41 seenlong.add(option[1])
General Comments 0
You need to be logged in to leave comments. Login now