##// END OF EJS Templates
extensions: show traceback on load failure if --traceback flag is set...
Yuya Nishihara -
r25364:de23a552 default
parent child Browse files
Show More
@@ -85,6 +85,8 b' def load(ui, name, path):'
85 except ImportError, err:
85 except ImportError, err:
86 ui.debug('could not import hgext.%s (%s): trying %s\n'
86 ui.debug('could not import hgext.%s (%s): trying %s\n'
87 % (name, err, name))
87 % (name, err, name))
88 if ui.debugflag:
89 ui.traceback()
88 mod = importh(name)
90 mod = importh(name)
89 _extensions[shortname] = mod
91 _extensions[shortname] = mod
90 _order.append(shortname)
92 _order.append(shortname)
@@ -110,6 +112,7 b' def loadall(ui):'
110 else:
112 else:
111 ui.warn(_("*** failed to import extension %s: %s\n")
113 ui.warn(_("*** failed to import extension %s: %s\n")
112 % (name, inst))
114 % (name, inst))
115 ui.traceback()
113
116
114 for name in _order[newindex:]:
117 for name in _order[newindex:]:
115 uisetup = getattr(_extensions[name], 'uisetup', None)
118 uisetup = getattr(_extensions[name], 'uisetup', None)
@@ -15,3 +15,32 b''
15 hg help [-ec] [TOPIC]
15 hg help [-ec] [TOPIC]
16
16
17 show help for a given topic or a help overview
17 show help for a given topic or a help overview
18
19 show traceback
20
21 $ hg -q help help --traceback 2>&1 | grep -v '^ '
22 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
23 Traceback (most recent call last):
24 Exception: bit bucket overflow
25 *** failed to import extension badext2: No module named badext2
26 Traceback (most recent call last):
27 ImportError: No module named badext2
28 hg help [-ec] [TOPIC]
29
30 show help for a given topic or a help overview
31
32 show traceback for ImportError of hgext.name if debug is set
33 (note that --debug option isn't applied yet when loading extensions)
34
35 $ hg help help --traceback --config ui.debug=True 2>&1 \
36 > | grep -v '^ ' | head -n10
37 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
38 Traceback (most recent call last):
39 Exception: bit bucket overflow
40 could not import hgext.badext2 (No module named badext2): trying badext2
41 Traceback (most recent call last):
42 ImportError: No module named badext2
43 *** failed to import extension badext2: No module named badext2
44 Traceback (most recent call last):
45 ImportError: No module named badext2
46 hg help [-ec] [TOPIC]
General Comments 0
You need to be logged in to leave comments. Login now