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