Menu

Commit [r5763]  Maximize  Restore  History

TracMercurial: improve compatibility with Mercurial versions using `demandimport`.

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.

cboos 2007-06-27

changed /sandbox/mercurial-plugin-0.11/tracext/hg/backend.py
/sandbox/mercurial-plugin-0.11/tracext/hg/backend.py Diff Switch to side-by-side view
Loading...
Auth0 Logo