Mercurial > public > mercurial-scm > hg
comparison mercurial/extensions.py @ 23953:af73c05e735a stable
extensions: don't quit loading extensions in the middle if traceback is on
This was introduced way back in 2006 (rev 1f6d520557ec) as sys.exit(0) if
loading an extension failed when --traceback was on, then at some point morphed
into a 'return 1' in a function that otherwise returns nothing.
At this point, if ui.traceback is enabled and if loading an extension fails for
whatever reason, including one as innocent as it not being present, we leave
any extensions loaded so far in a bogus half-initialized state. That doesn't
really make any sense.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Fri, 23 Jan 2015 20:30:49 -0800 |
parents | ecdbbb6e5d06 |
children | d8837ad682dd |
comparison
equal
deleted
inserted
replaced
23952:ea61e278ae92 | 23953:af73c05e735a |
---|---|
105 ui.warn(_("*** failed to import extension %s from %s: %s\n") | 105 ui.warn(_("*** failed to import extension %s from %s: %s\n") |
106 % (name, path, inst)) | 106 % (name, path, inst)) |
107 else: | 107 else: |
108 ui.warn(_("*** failed to import extension %s: %s\n") | 108 ui.warn(_("*** failed to import extension %s: %s\n") |
109 % (name, inst)) | 109 % (name, inst)) |
110 if ui.traceback(): | |
111 return 1 | |
112 | 110 |
113 for name in _order[newindex:]: | 111 for name in _order[newindex:]: |
114 uisetup = getattr(_extensions[name], 'uisetup', None) | 112 uisetup = getattr(_extensions[name], 'uisetup', None) |
115 if uisetup: | 113 if uisetup: |
116 uisetup(ui) | 114 uisetup(ui) |