changelog shortlog tags branches changeset files revisions annotate raw help

Mercurial > hg > plan9front / rc/bin/hg

changeset 7243: 34f64dcbbc25
parent: 32d8a86c8128
author: cinap_lenrek@felloff.net
date: Fri, 17 May 2019 18:14:10 +0200
permissions: -rwxr-xr-x
description: 7l: don't hardcode 4k pagesize, use INITRND
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  import os
26 
27  home = os.environ['home']
28  if not 'HOME' in os.environ:
29  os.environ['HOME'] = home
30 
31  def p9sys_rcpath():
32  return ['/sys/lib/hgrc']
33 
34  def p9usr_rcpath():
35  return [home+'/lib/hgrc']
36 
37  import mercurial.posix
38  mercurial.posix.system_rcpath = p9sys_rcpath
39  mercurial.posix.user_rcpath = p9usr_rcpath
40 
41 for fp in (sys.stdin, sys.stdout, sys.stderr):
42  mercurial.util.set_binary(fp)
43 
44 mercurial.dispatch.run()