Mercurial > hg
diff mercurial/extensions.py @ 32341:b88d879e468a
extensions: optionally print hint on import failure
Test will be added by the next patch.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 14 May 2017 15:46:45 +0900 |
parents | bd872f64a8ba |
children | e5fbf9687600 |
line wrap: on
line diff
--- a/mercurial/extensions.py Sun May 14 15:41:27 2017 +0900 +++ b/mercurial/extensions.py Sun May 14 15:46:45 2017 +0900 @@ -172,13 +172,15 @@ try: load(ui, name, path) except Exception as inst: - inst = _forbytes(inst) + msg = _forbytes(inst) if path: ui.warn(_("*** failed to import extension %s from %s: %s\n") - % (name, path, inst)) + % (name, path, msg)) else: ui.warn(_("*** failed to import extension %s: %s\n") - % (name, inst)) + % (name, msg)) + if isinstance(inst, error.Hint) and inst.hint: + ui.warn(_("*** (%s)\n") % inst.hint) ui.traceback() for name in _order[newindex:]: