comparison tests/test-bad-extension.t @ 25364:de23a552fc23

extensions: show traceback on load failure if --traceback flag is set Before this patch, there was no handy way to investigate the reason why extension couldn't be loaded. If ui.debug is set, tracebacks of both "hgext.foo" and "foo" are displayed because the first ImportError could occur at very deep dependency module.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 30 Mar 2015 16:23:35 +0900
parents e955549cd045
children f39953663cc9
comparison
equal deleted inserted replaced
25363:3ff4b07412ad 25364:de23a552fc23
13 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow 13 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
14 *** failed to import extension badext2: No module named badext2 14 *** failed to import extension badext2: No module named badext2
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]