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
|
2005-05-04 01:16:10 +04:00
|
|
|
|
2010-08-17 17:44:38 +04:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2014-06-23 17:33:07 +04:00
|
|
|
if os.environ.get('HGUNICODEPEDANTRY', False):
|
2016-04-05 04:35:36 +03:00
|
|
|
try:
|
|
|
|
reload(sys)
|
|
|
|
sys.setdefaultencoding("undefined")
|
|
|
|
except NameError:
|
|
|
|
pass
|
2014-06-23 17:33:07 +04:00
|
|
|
|
2010-08-17 17:44:38 +04:00
|
|
|
libdir = '@LIBDIR@'
|
|
|
|
|
|
|
|
if libdir != '@' 'LIBDIR' '@':
|
|
|
|
if not os.path.isabs(libdir):
|
2010-10-21 20:58:22 +04: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)
|
|
|
|
|
2007-08-18 13:37:08 +04:00
|
|
|
# enable importing on demand to reduce startup time
|
2009-01-20 01:19:09 +03:00
|
|
|
try:
|
2017-05-21 22:51:01 +03:00
|
|
|
if sys.version_info[0] < 3 or sys.version_info >= (3, 6):
|
|
|
|
import hgdemandimport; hgdemandimport.enable()
|
2009-01-20 01:19:09 +03:00
|
|
|
except ImportError:
|
|
|
|
sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
|
|
|
|
' '.join(sys.path))
|
|
|
|
sys.stderr.write("(check your install and PYTHONPATH)\n")
|
|
|
|
sys.exit(-1)
|
2007-08-18 13:37:08 +04:00
|
|
|
|
2017-08-22 21:14:19 +03:00
|
|
|
from mercurial import (
|
|
|
|
dispatch,
|
|
|
|
util,
|
|
|
|
)
|
2007-11-10 23:30:59 +03:00
|
|
|
for fp in (sys.stdin, sys.stdout, sys.stderr):
|
2017-08-22 21:14:19 +03:00
|
|
|
util.setbinary(fp)
|
2007-11-10 23:30:59 +03:00
|
|
|
|
2017-08-22 21:14:19 +03:00
|
|
|
dispatch.run()
|