hg-extra for fedora

Augie Fackler durin42 at gmail.com
Fri Nov 12 19:26:18 CST 2010


On Nov 12, 2010, at 6:26 PM, Mads Kiilerich wrote:

> 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.

A search path for extensions actually sounds like a really great feature. Matt, what are your thoughts on that? I'm envisioning something that's off by default but could be used by users if they wanted something other than sys.path and hgext.

> 
> /Mads
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list