changeset 2056:1f6d520557ec

Polished exception handling when importing extensions: - Warning about failed import is printed on one line. - For this warning the [extensions] section key is used, because the value doesn't have to be set. - Whan a --traceback is requested, exit immediately to not mix up problems when importing an extension with other problems.
author Thomas Arendsen Hein <thomas@intevation.de>
date Tue, 11 Apr 2006 07:08:16 +0200
parents bd94dda70bbe
children fef2d653beaf
files mercurial/commands.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Apr 11 06:34:27 2006 +0200
+++ b/mercurial/commands.py	Tue Apr 11 07:08:16 2006 +0200
@@ -3263,10 +3263,10 @@
     external = []
     for x in u.extensions():
         def on_exception(exc, inst):
-            u.warn(_("*** failed to import extension %s\n") % x[1])
-            u.warn("%s\n" % inst)
+            u.warn(_("*** failed to import extension %s: %s\n") % (x[0], inst))
             if "--traceback" in sys.argv[1:]:
                 traceback.print_exc()
+                sys.exit(0)
         if x[1]:
             try:
                 mod = imp.load_source(x[0], x[1])