70c70
< from os.path import isdir, join as joinpath
---
> from os.path import join as joinpath
100,127d99
< def check_style_hook(ui):
< ui.readconfig(joinpath(ROOT, '.hg', 'hgrc'))
< style_hook = ui.config('hooks', 'pretxncommit.style', None)
<
< if not style_hook:
< print """\
< You're missing the M5 style hook.
< Please install the hook so we can ensure that all code fits a common style.
<
< All you'd need to do is add the following lines to your repository .hg/hgrc
< or your personal .hgrc
< ----------------
<
< [extensions]
< style = %s/util/style.py
<
< [hooks]
< pretxncommit.style = python:style.check_whitespace
< """ % (ROOT)
< sys.exit(1)
<
< if isdir(joinpath(ROOT, '.hg')):
< try:
< from mercurial import ui
< check_style_hook(ui.ui())
< except ImportError:
< pass
<
290c262,263
< if swig_version[0] != 'SWIG' or swig_version[1] != 'Version':
---
> if len(swig_version) < 3 or \
> swig_version[0] != 'SWIG' or swig_version[1] != 'Version':