The `demandimport` mechanism modifies the `__import__` builtin, and this can lead to surprising errors, like with the TH:AccountManager plugin:
{{{
# in mercurial/node.py, with `demandimport` enabled:
import binascii
# in acct_mgr/pwhash.py:
from binascii import hexlify
...
v = long(hexlify(urandom(4)), 16)
# raises => TypeError: 'unloaded module' object is not callable
}}}
It's possibly a bug with demandimport, but even if this gets fixed, we must be compatible with the released Mercurial 0.9.4 (and demandimport is not needed anyway for long running processes).
Thanks to Gregory Collins for reporting the issue.