eggs/mercurial-1.7.3-py2.6-linux-x86_64.egg/EGG-INFO/scripts/hg
changeset 69 c6bca38c1cbf
equal deleted inserted replaced
68:5ff1fc726848 69:c6bca38c1cbf
       
     1 #!/usr/bin/python
       
     2 #
       
     3 # mercurial - scalable distributed SCM
       
     4 #
       
     5 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
       
     6 #
       
     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.
       
     9 
       
    10 import os
       
    11 import sys
       
    12 
       
    13 libdir = '../../'
       
    14 
       
    15 if libdir != '@' 'LIBDIR' '@':
       
    16     if not os.path.isabs(libdir):
       
    17         libdir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
       
    18                               libdir)
       
    19         libdir = os.path.abspath(libdir)
       
    20     sys.path.insert(0, libdir)
       
    21 
       
    22 # enable importing on demand to reduce startup time
       
    23 try:
       
    24     from mercurial import demandimport; demandimport.enable()
       
    25 except ImportError:
       
    26     import sys
       
    27     sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
       
    28                      ' '.join(sys.path))
       
    29     sys.stderr.write("(check your install and PYTHONPATH)\n")
       
    30     sys.exit(-1)
       
    31 
       
    32 import mercurial.util
       
    33 import mercurial.dispatch
       
    34 
       
    35 for fp in (sys.stdin, sys.stdout, sys.stderr):
       
    36     mercurial.util.set_binary(fp)
       
    37 
       
    38 mercurial.dispatch.run()