Show More
@@ -1,60 +1,59 b'' | |||
|
1 | 1 | #!/usr/bin/env python3 |
|
2 | 2 | # |
|
3 | 3 | # mercurial - scalable distributed SCM |
|
4 | 4 | # |
|
5 | 5 | # Copyright 2005-2007 Olivia Mackall <olivia@selenic.com> |
|
6 | 6 | # |
|
7 | 7 | # This software may be used and distributed according to the terms of the |
|
8 | 8 | # GNU General Public License version 2 or any later version. |
|
9 | 9 | |
|
10 | 10 | import os |
|
11 | 11 | import sys |
|
12 | 12 | |
|
13 | 13 | libdir = '@LIBDIR@' |
|
14 | 14 | |
|
15 | 15 | if libdir != '@' 'LIBDIR' '@': |
|
16 | 16 | if not os.path.isabs(libdir): |
|
17 | 17 | libdir = os.path.join( |
|
18 | 18 | os.path.dirname(os.path.realpath(__file__)), libdir |
|
19 | 19 | ) |
|
20 | 20 | libdir = os.path.abspath(libdir) |
|
21 | 21 | sys.path.insert(0, libdir) |
|
22 | 22 | |
|
23 | 23 | # Make `pip install --user ...` packages available to the official Windows |
|
24 | 24 | # build. Most py2 packaging installs directly into the system python |
|
25 | 25 | # environment, so no changes are necessary for other platforms. The Windows |
|
26 | 26 | # py2 package uses py2exe, which lacks a `site` module. Hardcode it according |
|
27 | 27 | # to the documentation. |
|
28 | 28 | if getattr(sys, 'frozen', None) == 'console_exe': |
|
29 | 29 | vi = sys.version_info |
|
30 | 30 | appdata = os.environ.get('APPDATA') |
|
31 | 31 | if appdata: |
|
32 | 32 | sys.path.append( |
|
33 | 33 | os.path.join( |
|
34 | 34 | appdata, |
|
35 | 35 | 'Python', |
|
36 | 36 | 'Python%d%d' % (vi[0], vi[1]), |
|
37 | 37 | 'site-packages', |
|
38 | 38 | ) |
|
39 | 39 | ) |
|
40 | 40 | |
|
41 | 41 | from hgdemandimport import tracing |
|
42 | 42 | |
|
43 | 43 | with tracing.log('hg script'): |
|
44 | 44 | # enable importing on demand to reduce startup time |
|
45 | 45 | try: |
|
46 | if sys.version_info[0] < 3 or sys.version_info >= (3, 6): | |
|
47 | import hgdemandimport | |
|
46 | import hgdemandimport | |
|
48 | 47 | |
|
49 |
|
|
|
48 | hgdemandimport.enable() | |
|
50 | 49 | except ImportError: |
|
51 | 50 | sys.stderr.write( |
|
52 | 51 | "abort: couldn't find mercurial libraries in [%s]\n" |
|
53 | 52 | % ' '.join(sys.path) |
|
54 | 53 | ) |
|
55 | 54 | sys.stderr.write("(check your install and PYTHONPATH)\n") |
|
56 | 55 | sys.exit(-1) |
|
57 | 56 | |
|
58 | 57 | from mercurial import dispatch |
|
59 | 58 | |
|
60 | 59 | dispatch.run() |
General Comments 0
You need to be logged in to leave comments.
Login now