[PATCH STABLE] setup/hg: handle hg being a symlink when appending relative libdir to sys.path

L. David Baron dbaron at dbaron.org
Thu Oct 21 15:31:44 CDT 2010


On Thursday 2010-10-21 21:12 +0200, Thomas Arendsen Hein wrote:
> * L. David Baron <dbaron at dbaron.org> [20101021 19:23]:
> > # HG changeset patch
> > # User L. David Baron <dbaron at dbaron.org>
> > # Date 1287680302 25200
> > # Node ID 172c5e2d8baff6b65d09c779d64ae199b23eb886
> > # Parent  6bf8d48bec8e1ab2e0462ce14a914d06e64f7117
> > setup/hg: handle hg being a symlink when appending relative libdir to sys.path
> > 
> > Resolve symbolic links in the path to hg so that an hg that works when
> > invoked directly will also work when invoked via a symlink to it.
> 
> I can't reproduce the problem, I often install hg in this way and
> don't have problems with it:
> /usr/local/bin/hg is a symlink to ../mercurial-tah/hg
> and it just works, tested with version 1.6.4+185-c82cd7b08158 (and
> many versions before that)

Do you also set PYTHONPATH or something similar to add
/usr/local/mercurial-tah/lib/python2.6/site-packages to the path?
(Or did you actually mean ../mercurial-tah/hg rather than
../mercurial-tah/bin/hg ?)

In the past, I've always modified bin/hg in all my installs of
mercurial to add to sys.path (by just hardcoding the correct path).
When I installed current hg-stable, I noticed that I shouldn't need
to anymore, since this code had been added in 10da5a1f25dd.
However, it didn't work for me once I symlinked /usr/local/bin/hg to
/usr/local/hg-stable/bin/hg .

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/


More information about the Mercurial-devel mailing list