mercurial.py: Converts to plug-in module