Mercurial > hg
comparison tests/test-extension.t @ 32723:b6384b3d4ebe
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'.
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 06 Jun 2017 10:03:16 -0400 |
parents | d47d7d3bd07b |
children | ea1c2eb7abd3 |
comparison
equal
deleted
inserted
replaced
32722:de09138bf0f5 | 32723:b6384b3d4ebe |
---|---|
1604 > EOF | 1604 > EOF |
1605 | 1605 |
1606 $ hg --config extensions.nonregistrar=`pwd`/nonregistrar.py version > /dev/null | 1606 $ hg --config extensions.nonregistrar=`pwd`/nonregistrar.py version > /dev/null |
1607 devel-warn: cmdutil.command is deprecated, use registrar.command to register 'foo' | 1607 devel-warn: cmdutil.command is deprecated, use registrar.command to register 'foo' |
1608 (compatibility will be dropped after Mercurial-4.6, update your code.) * (glob) | 1608 (compatibility will be dropped after Mercurial-4.6, update your code.) * (glob) |
1609 | |
1610 Make sure a broken uisetup doesn't globally break hg: | |
1611 $ cat > baduisetup.py <<EOF | |
1612 > from mercurial import ( | |
1613 > bdiff, | |
1614 > extensions, | |
1615 > ) | |
1616 > | |
1617 > def blockswrapper(orig, *args, **kwargs): | |
1618 > return orig(*args, **kwargs) | |
1619 > | |
1620 > def uisetup(ui): | |
1621 > extensions.wrapfunction(bdiff, 'blocks', blockswrapper) | |
1622 > EOF | |
1623 $ cat >> $HGRCPATH <<EOF | |
1624 > [extensions] | |
1625 > baduisetup = $PWD/baduisetup.py | |
1626 > EOF | |
1627 | |
1628 Broken: an extension that triggers the import of bdiff during uisetup | |
1629 can't be easily debugged: | |
1630 $ hg version | |
1631 abort: No module named bdiff! | |
1632 (did you forget to compile extensions?) | |
1633 [255] |