2016-04-03 16:56:15 +03:00
|
|
|
from __future__ import absolute_import
|
2011-05-27 18:51:16 +04:00
|
|
|
import os
|
2016-04-03 16:56:15 +03:00
|
|
|
from mercurial import (
|
|
|
|
commands,
|
|
|
|
extensions,
|
|
|
|
ui,
|
|
|
|
)
|
2011-05-27 18:51:16 +04:00
|
|
|
|
2014-03-02 02:20:15 +04:00
|
|
|
ignore = set(['highlight', 'win32text', 'factotum'])
|
2011-05-27 18:51:16 +04:00
|
|
|
|
|
|
|
if os.name != 'nt':
|
|
|
|
ignore.add('win32mbcs')
|
|
|
|
|
|
|
|
disabled = [ext for ext in extensions.disabled().keys() if ext not in ignore]
|
|
|
|
|
|
|
|
hgrc = open(os.environ["HGRCPATH"], 'w')
|
|
|
|
hgrc.write('[extensions]\n')
|
|
|
|
|
|
|
|
for ext in disabled:
|
|
|
|
hgrc.write(ext + '=\n')
|
|
|
|
|
|
|
|
hgrc.close()
|
|
|
|
|
|
|
|
u = ui.ui()
|
|
|
|
extensions.loadall(u)
|
|
|
|
|
2011-09-14 19:06:33 +04:00
|
|
|
globalshort = set()
|
|
|
|
globallong = set()
|
|
|
|
for option in commands.globalopts:
|
|
|
|
option[0] and globalshort.add(option[0])
|
|
|
|
option[1] and globallong.add(option[1])
|
|
|
|
|
2011-05-27 18:51:16 +04:00
|
|
|
for cmd, entry in commands.table.iteritems():
|
2011-09-14 19:06:33 +04:00
|
|
|
seenshort = globalshort.copy()
|
|
|
|
seenlong = globallong.copy()
|
2011-05-27 18:51:16 +04:00
|
|
|
for option in entry[1]:
|
|
|
|
if (option[0] and option[0] in seenshort) or \
|
|
|
|
(option[1] and option[1] in seenlong):
|
|
|
|
print "command '" + cmd + "' has duplicate option " + str(option)
|
|
|
|
seenshort.add(option[0])
|
|
|
|
seenlong.add(option[1])
|