Fwd: how to install my own extension
Georg
gwk.rko at googlemail.com
Mon Jun 9 14:09:39 CDT 2008
Sorry, should have gone to the list.
---------- Forwarded message ----------
From: Georg <gwk.rko at googlemail.com>
Date: 2008/6/9
Subject: Re: how to install my own extension
I can't get it to work. If I follow your suggestion and put:
hgext.msc = /usr/local/lib/python2.5/site-packages/hgext/msc.py
then I get:
abort: pre-update.msc hook is invalid (import of "hgext.msc" failed)
The offending hook line is
pre-update.msc = python:hgext.msc.hook
It appears it somehow does not recognize the hook is in the hgext package
any more.
Now I can experiment and strip the "hgext" from the hook entry, then I get:
abort: pre-update.msc hook is invalid (import of "msc" failed)
Finally if I also strip the msc, then I get:
abort: pre-update.msc hook is invalid ("hook" not in a module)
However I put it, it just doesn't like me :(
Any help dearly appreciated.
2008/6/9 Peter Arrenbrecht <peter.arrenbrecht at gmail.com>:
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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://selenic.com/pipermail/mercurial/attachments/20080609/c690cbbe/attachment.htm
More information about the Mercurial
mailing list