3 # mercurial - scalable distributed SCM
5 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
7 # This software may be used and distributed according to the terms of the
8 # GNU General Public License version 2, incorporated herein by reference.
10 # enable importing on demand to reduce startup time
12 from mercurial import demandimport; demandimport.enable()
15 sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
17 sys.stderr.write("(check your install and PYTHONPATH)\n")
22 import mercurial.dispatch
24 if sys.platform == 'plan9':
27 home = os.environ['home']
28 if not 'HOME' in os.environ:
29 os.environ['HOME'] = home
32 return ['/sys/lib/hgrc']
35 return [home+'/lib/hgrc']
37 import mercurial.posix
38 mercurial.posix.system_rcpath = p9sys_rcpath
39 mercurial.posix.user_rcpath = p9usr_rcpath
41 for fp in (sys.stdin, sys.stdout, sys.stderr):
42 mercurial.util.set_binary(fp)
44 mercurial.dispatch.run()