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