hg-extra for fedora

Mads Kiilerich mads at kiilerich.com
Fri Nov 12 18:26:33 CST 2010

John Hein wrote, On 11/13/2010 12:51 AM:
> Mads Kiilerich wrote at 14:41 +0100 on Nov 10, 2010:
>   >  There is no reason the extensions should live under site-packages. They
>   >  are intended to be loaded by Mercurials extension loader and are not
>   >  generally usable Python modules. (Mercurials extension loader will
>   >  however use Pythons import function unless a source file is specified.)
>   >
>   >  I suggest putting the files in for example /usr/share/mercurial-pbranch/
>   >  and dropping a /etc/mercurial/hgrc.d/pbranch.rc with something like
>   >
>   >  [extensions]
>   >  # pbranch = /usr/share/mercurial-pbranch/pbranch.py
>   >
>   >  Alternatively the package could place the extension files in _the_ hgext
>   >  folder. That would allow simple configuration with just "pbranch=".
> Is there a way to specify a search path for extensions (so, for
> example, I could have hg look in hgext first, then /usr/share/hgextra
> perhaps)?  I personally would use that for a site-wide repository of
> extra hg extensions, but would rather not put them into hgext directly
> with the distributed extensions.

Yes and no. There is no search path for extensions, but the extension 
loader will try to import from Pythons PYTHONPATH/sys.path.

Another way to manage extra extensions is to create a local clone of 
their repositories and point there with the full file path when you 
enable them. I think that is simpler and it has the advantage of being 
more explicit.


More information about the Mercurial-devel mailing list