mercurial/commands.py
changeset 2056 1f6d520557ec
parent 2049 f70952384ae7
child 2057 fef2d653beaf
equal deleted inserted replaced
2055:bd94dda70bbe 2056:1f6d520557ec
  3261         sys.exit(1)
  3261         sys.exit(1)
  3262 
  3262 
  3263     external = []
  3263     external = []
  3264     for x in u.extensions():
  3264     for x in u.extensions():
  3265         def on_exception(exc, inst):
  3265         def on_exception(exc, inst):
  3266             u.warn(_("*** failed to import extension %s\n") % x[1])
  3266             u.warn(_("*** failed to import extension %s: %s\n") % (x[0], inst))
  3267             u.warn("%s\n" % inst)
       
  3268             if "--traceback" in sys.argv[1:]:
  3267             if "--traceback" in sys.argv[1:]:
  3269                 traceback.print_exc()
  3268                 traceback.print_exc()
       
  3269                 sys.exit(0)
  3270         if x[1]:
  3270         if x[1]:
  3271             try:
  3271             try:
  3272                 mod = imp.load_source(x[0], x[1])
  3272                 mod = imp.load_source(x[0], x[1])
  3273             except Exception, inst:
  3273             except Exception, inst:
  3274                 on_exception(Exception, inst)
  3274                 on_exception(Exception, inst)