2005-05-04 01:16:10 +04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
#
|
2006-02-06 07:21:02 +03:00
|
|
|
# mercurial - scalable distributed SCM
|
2005-05-04 01:16:10 +04:00
|
|
|
#
|
2007-06-19 10:51:34 +04:00
|
|
|
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
|
2005-05-04 01:16:10 +04:00
|
|
|
#
|
2009-04-26 03:08:54 +04:00
|
|
|
# This software may be used and distributed according to the terms of the
|
2010-01-20 07:20:08 +03:00
|
|
|
# GNU General Public License version 2 or any later version.
|
2017-08-22 21:14:19 +03:00
|
|
|
from __future__ import absolute_import
|
2010-08-17 17:44:38 +04:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2018-08-17 20:40:01 +03:00
|
|
|
libdir = "@LIBDIR@"
|
|
|
|
if libdir != "@" "LIBDIR" "@":
|
2018-08-27 22:06:07 +03:00
|
|
|
# Installed as a script.
|
2010-08-17 17:44:38 +04:00
|
|
|
if not os.path.isabs(libdir):
|
2018-08-17 20:40:01 +03:00
|
|
|
libdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), libdir)
|
2010-08-17 17:44:38 +04:00
|
|
|
libdir = os.path.abspath(libdir)
|
|
|
|
sys.path.insert(0, libdir)
|
2018-08-27 22:06:07 +03:00
|
|
|
else:
|
|
|
|
# Not installed as a script.
|
|
|
|
# Check whether the correct interpreter is used.
|
|
|
|
try:
|
|
|
|
hgdir = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
except NameError:
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
envpath = os.path.join(hgdir, "build", "env")
|
|
|
|
if os.path.exists(envpath):
|
|
|
|
with open(envpath, "r") as f:
|
|
|
|
env = dict(l.split("=", 1) for l in f.read().splitlines() if "=" in l)
|
|
|
|
# Use the right interpreter.
|
|
|
|
python = env.get("PYTHON_SYS_EXECUTABLE")
|
|
|
|
if python and python != sys.executable:
|
|
|
|
import subprocess
|
|
|
|
p = subprocess.Popen([python] + sys.argv)
|
|
|
|
sys.exit(p.wait())
|
2010-08-17 17:44:38 +04:00
|
|
|
|
2018-08-17 20:40:01 +03:00
|
|
|
from mercurial import entrypoint
|
|
|
|
|
2018-08-30 14:40:35 +03:00
|
|
|
entrypoint.run(False)
|