Sat, 30 May 2015 12:46:30 +0900 hg: explicitly check that peer lookup object has instance() if call failed
Yuya Nishihara <yuya@tcha.org> [Sat, 30 May 2015 12:46:30 +0900] rev 25365
hg: explicitly check that peer lookup object has instance() if call failed If a "thing" is callable but raises TypeError for some reason, a callable object would be returned. Thereafter, unfriendly traceback would be displayed: Traceback (most recent call last): ... File "mercurial/hg.pyc", line 119, in _peerorrepo obj = _peerlookup(path).instance(ui, path, create) AttributeError: 'function' object has no attribute 'instance' Instead, we should show the reason why "thing(path)" didn't work: Traceback (most recent call last): ... File "hggit/__init__.py", line 89, in _local p = urlcls(path).localpath() TypeError: 'NoneType' object is not callable If a "thing" is not callable, it must be a module or an object that implements instance(). If that module didn't have instance(), the error message would be "<unloaded module 'foo'> object is not callable". It doesn't make perfect sense, but it isn't so bad as it can blame which module went wrong.
Mon, 30 Mar 2015 16:23:35 +0900 extensions: show traceback on load failure if --traceback flag is set
Yuya Nishihara <yuya@tcha.org> [Mon, 30 Mar 2015 16:23:35 +0900] rev 25364
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.
Sun, 31 May 2015 14:40:28 +0900 ui: flush stdout before writing traceback to stderr
Yuya Nishihara <yuya@tcha.org> [Sun, 31 May 2015 14:40:28 +0900] rev 25363
ui: flush stdout before writing traceback to stderr Sometimes a traceback message is paired with ui.debug(). This patch makes sure that these messages are displayed in the right order.
(0) -10000 -3000 -1000 -300 -100 -30 -10 -3 +3 +10 +30 +100 +300 +1000 +3000 +10000 tip