##// END OF EJS Templates
hg: wrap the highest layer in the `hg` script possible in trace event...
Augie Fackler -
r39628:5e78c100 default
parent child Browse files
Show More
@@ -27,15 +27,17 b" if libdir != '@' 'LIBDIR' '@':"
27 libdir = os.path.abspath(libdir)
27 libdir = os.path.abspath(libdir)
28 sys.path.insert(0, libdir)
28 sys.path.insert(0, libdir)
29
29
30 # enable importing on demand to reduce startup time
30 from hgdemandimport import tracing
31 try:
31 with tracing.log('hg script'):
32 if sys.version_info[0] < 3 or sys.version_info >= (3, 6):
32 # enable importing on demand to reduce startup time
33 import hgdemandimport; hgdemandimport.enable()
33 try:
34 except ImportError:
34 if sys.version_info[0] < 3 or sys.version_info >= (3, 6):
35 sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
35 import hgdemandimport; hgdemandimport.enable()
36 ' '.join(sys.path))
36 except ImportError:
37 sys.stderr.write("(check your install and PYTHONPATH)\n")
37 sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
38 sys.exit(-1)
38 ' '.join(sys.path))
39 sys.stderr.write("(check your install and PYTHONPATH)\n")
40 sys.exit(-1)
39
41
40 from mercurial import dispatch
42 from mercurial import dispatch
41 dispatch.run()
43 dispatch.run()
General Comments 0
You need to be logged in to leave comments. Login now