changeset 12805:cae1c187abd4 stable

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.
author L. David Baron <dbaron@dbaron.org>
date Thu, 21 Oct 2010 09:58:22 -0700
parents e0e8b123b75e
children 57b9fd75b6f8
files hg
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hg	Thu Oct 21 21:34:30 2010 +0200
+++ b/hg	Thu Oct 21 09:58:22 2010 -0700
@@ -14,7 +14,8 @@
 
 if libdir != '@' 'LIBDIR' '@':
     if not os.path.isabs(libdir):
-        libdir = os.path.join(os.path.dirname(__file__), libdir)
+        libdir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+                              libdir)
         libdir = os.path.abspath(libdir)
     sys.path.insert(0, libdir)