hg
changeset 12661 10da5a1f25dd
parent 10263 25e572394f5c
child 12805 cae1c187abd4
equal deleted inserted replaced
12660:6ed5ae6264c2 12661:10da5a1f25dd
     4 #
     4 #
     5 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
     5 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
     6 #
     6 #
     7 # This software may be used and distributed according to the terms of the
     7 # This software may be used and distributed according to the terms of the
     8 # GNU General Public License version 2 or any later version.
     8 # GNU General Public License version 2 or any later version.
       
     9 
       
    10 import os
       
    11 import sys
       
    12 
       
    13 libdir = '@LIBDIR@'
       
    14 
       
    15 if libdir != '@' 'LIBDIR' '@':
       
    16     if not os.path.isabs(libdir):
       
    17         libdir = os.path.join(os.path.dirname(__file__), libdir)
       
    18         libdir = os.path.abspath(libdir)
       
    19     sys.path.insert(0, libdir)
     9 
    20 
    10 # enable importing on demand to reduce startup time
    21 # enable importing on demand to reduce startup time
    11 try:
    22 try:
    12     from mercurial import demandimport; demandimport.enable()
    23     from mercurial import demandimport; demandimport.enable()
    13 except ImportError:
    24 except ImportError:
    15     sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
    26     sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
    16                      ' '.join(sys.path))
    27                      ' '.join(sys.path))
    17     sys.stderr.write("(check your install and PYTHONPATH)\n")
    28     sys.stderr.write("(check your install and PYTHONPATH)\n")
    18     sys.exit(-1)
    29     sys.exit(-1)
    19 
    30 
    20 import sys
       
    21 import mercurial.util
    31 import mercurial.util
    22 import mercurial.dispatch
    32 import mercurial.dispatch
    23 
    33 
    24 for fp in (sys.stdin, sys.stdout, sys.stderr):
    34 for fp in (sys.stdin, sys.stdout, sys.stderr):
    25     mercurial.util.set_binary(fp)
    35     mercurial.util.set_binary(fp)