# HG changeset patch # User Augie Fackler # Date 1496757796 14400 # Node ID b6384b3d4ebe67097662d64e028ead2688ed4d2a # Parent de09138bf0f511c865cc6c6afa7eb481dee9762c tests: add test demonstrating how broken third-party extensions can get I intend to fix this, but will do the fix as a separate change to make the behavior change obvious. This was inspired by some users having the patience diff extension, which broke when we moved bdiff.so so thoroughly the users can't even run 'hg debuginstall'. diff -r de09138bf0f5 -r b6384b3d4ebe tests/test-extension.t --- a/tests/test-extension.t Thu Jun 08 10:44:53 2017 -0400 +++ b/tests/test-extension.t Tue Jun 06 10:03:16 2017 -0400 @@ -1606,3 +1606,28 @@ $ hg --config extensions.nonregistrar=`pwd`/nonregistrar.py version > /dev/null devel-warn: cmdutil.command is deprecated, use registrar.command to register 'foo' (compatibility will be dropped after Mercurial-4.6, update your code.) * (glob) + +Make sure a broken uisetup doesn't globally break hg: + $ cat > baduisetup.py < from mercurial import ( + > bdiff, + > extensions, + > ) + > + > def blockswrapper(orig, *args, **kwargs): + > return orig(*args, **kwargs) + > + > def uisetup(ui): + > extensions.wrapfunction(bdiff, 'blocks', blockswrapper) + > EOF + $ cat >> $HGRCPATH < [extensions] + > baduisetup = $PWD/baduisetup.py + > EOF + +Broken: an extension that triggers the import of bdiff during uisetup +can't be easily debugged: + $ hg version + abort: No module named bdiff! + (did you forget to compile extensions?) + [255]