how to install my own extension

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Mon Jun 9 00:56:32 CDT 2008


On Fri, Jun 6, 2008 at 7:23 PM, Georg <gwk.rko at googlemail.com> wrote:
> Hi,
>
> I wrote an extension containing some hook functions.
>
> I can install my *.py file into the hgext subdirectory that is installed by
> mercurial itself, and it will be found and it works.
>
> However, the mercurial hgext subdir should only contain extensions installed
> with mercurial.  I'm afraid as soon as I reinstall or upgrade mercurial,
> e.g. using easy_install, it will wipe out its own hgext directory and
> install a new one.  After all, the directory has the name of an egg,
> mercurial-1.0.1-py2.5-linux-x86_64.egg/hgext.
>
> So I tried to install my extension into my own hgext directory on the python
> path, /usr/local/.../site-packages/hgext.  I verified by 'print sys.path'
> that this is actually on the python path (site-packages that is, not hgext
> itself). But my extension is not found, I get *** failed to import extension
> hgext.msc: No module named msc
>
> I also tried to create an empty __init__.py in that hgext directory, but it
> doesn't help either.
>
> Could someone shed some light on this?

You can do something like

[extensions]
myext=/path/to/myext.py

-parren


More information about the Mercurial mailing list