]> git.lizzy.rs Git - plan9front.git/blob - rc/bin/hg
crop /lib/face/48x48x8/n/nixie.1 to the right size (was 512x512)
[plan9front.git] / rc / bin / hg
1 #!/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, incorporated herein by reference.
9
10 # enable importing on demand to reduce startup time
11 try:
12     from mercurial import demandimport; demandimport.enable()
13 except ImportError:
14     import sys
15     sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
16                      ' '.join(sys.path))
17     sys.stderr.write("(check your install and PYTHONPATH)\n")
18     sys.exit(-1)
19
20 import sys
21 import mercurial.util
22 import mercurial.dispatch
23
24 if sys.platform == 'plan9':
25     def p9sys_rcpath():
26         return ['/sys/lib/hgrc']
27
28     def p9usr_rcpath():
29         import os
30         return [os.environ['home']+'/lib/hgrc']
31
32     import mercurial.posix
33     mercurial.posix.system_rcpath = p9sys_rcpath
34     mercurial.posix.user_rcpath = p9usr_rcpath
35
36 for fp in (sys.stdin, sys.stdout, sys.stderr):
37     mercurial.util.set_binary(fp)
38
39 mercurial.dispatch.run()