comparison mercurial/debugcommands.py @ 32249:85dc5a25f1fc

debuginstall: check C extensions only if they are loadable per policy This check is useless in pure installation and I want to make it directly import C extension modules.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 26 Apr 2017 23:30:52 +0900
parents 70d163b86316
children 75e93d95aae6
comparison
equal deleted inserted replaced
32248:d74b0cff94a9 32249:85dc5a25f1fc
1018 fm.write('hgmodulepolicy', _("checking module policy (%s)\n"), 1018 fm.write('hgmodulepolicy', _("checking module policy (%s)\n"),
1019 policy.policy) 1019 policy.policy)
1020 fm.write('hgmodules', _("checking installed modules (%s)...\n"), 1020 fm.write('hgmodules', _("checking installed modules (%s)...\n"),
1021 os.path.dirname(pycompat.fsencode(__file__))) 1021 os.path.dirname(pycompat.fsencode(__file__)))
1022 1022
1023 err = None 1023 if policy.policy in ('c', 'allow'):
1024 try: 1024 err = None
1025 from . import ( 1025 try:
1026 base85, 1026 from . import (
1027 bdiff, 1027 base85,
1028 mpatch, 1028 bdiff,
1029 osutil, 1029 mpatch,
1030 ) 1030 osutil,
1031 dir(bdiff), dir(mpatch), dir(base85), dir(osutil) # quiet pyflakes 1031 )
1032 except Exception as inst: 1032 dir(bdiff), dir(mpatch), dir(base85), dir(osutil) # quiet pyflakes
1033 err = inst 1033 except Exception as inst:
1034 problems += 1 1034 err = inst
1035 fm.condwrite(err, 'extensionserror', " %s\n", err) 1035 problems += 1
1036 fm.condwrite(err, 'extensionserror', " %s\n", err)
1036 1037
1037 compengines = util.compengines._engines.values() 1038 compengines = util.compengines._engines.values()
1038 fm.write('compengines', _('checking registered compression engines (%s)\n'), 1039 fm.write('compengines', _('checking registered compression engines (%s)\n'),
1039 fm.formatlist(sorted(e.name() for e in compengines), 1040 fm.formatlist(sorted(e.name() for e in compengines),
1040 name='compengine', fmt='%s', sep=', ')) 1041 name='compengine', fmt='%s', sep=', '))