[PATCH 2 of 2] setup: call identify directly from mercurial.commands

Steve Borho steve at borho.org
Thu Feb 12 19:27:42 CST 2009


On Thu, 2009-02-12 at 23:40 +0100, Gilles Moris wrote:
> On Thu February 12 2009 21:21:49 Martin Geisler wrote:
> > Gilles Moris <gilles.moris at free.fr> writes:
> > > Why not:
> > >     sys.path.insert(0, 'mercurial')
> > >     sys.path.insert(0, os.path.join('mercurial', 'pure'))
> > > to have [ 'mercurial/pure', 'mercurial' ] in front.
> > > Otherwise, it takes the site-wise mpatch instead of the local pure.
> > 
> > Does that make a difference? The old code spawned 'hg id' and so it
> > would also have used the site-wise mpatch.
> > 
> 
> Just that internal API are supposed to be less stable than CLI across versions.

Since setup.py is stored in the same repository as the mercurial
package, there's not much risk of it getting out of sync.

A compromise would be to use the dispatch API.  This still avoids having
to run an external hg process at the same time using a fairly stable
API.

--
Steve



More information about the Mercurial-devel mailing list