Extending extension lookups

Augie Fackler raf at durin42.com
Tue Jan 19 10:03:14 CST 2016


On Sun, Jan 17, 2016 at 08:10:08PM -0600, Matt Mackall wrote:
> On Wed, 2016-01-13 at 18:58 +0000, Martijn Pieters wrote:
> > I was asked by Pierre-Yves to create a proposal to support more than
> > just an hgext namespace for extensions bundled with Mercurial, to help
> > facilitate experimental extensions (see
> > https://www.mercurial-scm.org/wiki/ExperimentalExtensionsPlan).
>
> I guess I don't see what the advantage is here over simply adding the
> "(EXPERIMENTAL)" flag to the top of the docs. Commands and extensions marked
> experimental are hidden from the help today (see the chg extension) and we are
> free to have whatever stability policy we want with them.
>
> I guess if people find extensions by poking around on disk, they
> might be slightly more prone to not realizing a given extension is
> experimental if it's not in a separate directory.. but I must
> confess I have pretty limited sympathy for people who poke around in
> source code without looking at either the source or the docs.
>
> One minor downside with your plan that doesn't exist with the status quo is that
> we'll eventually have to move the code if we decide to make it official.
>
> > While I'm at it, I also want to look at where extensions (3rd party or
> > core) are to be installed. Mercurial extensions are currently expected
> > to be installed in the standard Python site-packages directory. Is
> > there any interest in moving extension out to a new, separate
> > location? With a little work (like a provided hgsetup.py module),
> > installation of extensions can still be done with the standard Python
> > tools. Mercurial would add that new location to the Python module
> > search path on startup and loading extensions would not have to
> > otherwise change. But at the same time, you then guarantee that
> > Mercurial extensions can't be confused with 'regular' Python
> > libraries. Is there any interest in doing this?
>
> I am interested in being able to have extensions in a standard place in my home
> directory that hg can automatically find. In particular, I'd like it to be able
> to search in ~/src/foobar/hgext/foobar.py without having to run anything (except
> maybe configure my extension path to ~/src/). Then all third-party modules I
> grab off Bitbucket with a reasonable directory layout can just be cloned into a
> directory together.

I think we might be able to do this with some sort of entry_points
thing in setuptools. Should I look further?

>
> --
> Mathematics is the supreme nostalgia of our time.
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list