comparison tests/test-duplicateoptions.py @ 43076:2372284d9457

formatting: blacken the codebase This is using my patch to black (https://github.com/psf/black/pull/826) so we don't un-wrap collection literals. Done with: hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S # skip-blame mass-reformatting only # no-check-commit reformats foo_bar functions Differential Revision: https://phab.mercurial-scm.org/D6971
author Augie Fackler <augie@google.com>
date Sun, 06 Oct 2019 09:45:02 -0400
parents aaad36b88298
children 6000f5b25c9b
comparison
equal deleted inserted replaced
43075:57875cf423c9 43076:2372284d9457
8 8
9 ignore = {b'highlight', b'win32text', b'factotum', b'beautifygraph'} 9 ignore = {b'highlight', b'win32text', b'factotum', b'beautifygraph'}
10 10
11 try: 11 try:
12 import sqlite3 12 import sqlite3
13 del sqlite3 # unused, just checking that import works 13
14 del sqlite3 # unused, just checking that import works
14 except ImportError: 15 except ImportError:
15 ignore.add(b'sqlitestore') 16 ignore.add(b'sqlitestore')
16 17
17 if os.name != 'nt': 18 if os.name != 'nt':
18 ignore.add(b'win32mbcs') 19 ignore.add(b'win32mbcs')
39 40
40 for cmd, entry in commands.table.items(): 41 for cmd, entry in commands.table.items():
41 seenshort = globalshort.copy() 42 seenshort = globalshort.copy()
42 seenlong = globallong.copy() 43 seenlong = globallong.copy()
43 for option in entry[1]: 44 for option in entry[1]:
44 if ((option[0] and option[0] in seenshort) or 45 if (option[0] and option[0] in seenshort) or (
45 (option[1] and option[1] in seenlong)): 46 option[1] and option[1] in seenlong
47 ):
46 print("command '" + cmd + "' has duplicate option " + str(option)) 48 print("command '" + cmd + "' has duplicate option " + str(option))
47 seenshort.add(option[0]) 49 seenshort.add(option[0])
48 seenlong.add(option[1]) 50 seenlong.add(option[1])