Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

hgtk: move to hggtk/hgtk.py, new small hgtk in root dir

advantages: in windows, hgtk.exe does almost never change, in linux, the code is precompiled (hgtk.pyc)

Changeset 4dc63f3bc15f

Parent c405ae14d089

by Simon Heimberg

Changes to 2 files · Browse files at 4dc63f3bc15f Showing diff from parent c405ae14d089 Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​hgtk.py Stacked
renamed from contrib/hgtk
 
70
71
72
 
73
74
75
 
70
71
72
73
74
75
76
@@ -70,6 +70,7 @@
    if args:   cmd, args = args[0], args[1:] + print table   aliases, i = cmdutil.findcmd(cmd, table, ui.config("ui", "strict"))   cmd = aliases[0]   c = list(i[1])
Change 1 of 1 Show Entire File hgtk Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
@@ -0,0 +1,48 @@
+#!/usr/bin/env python +# +# front-end script for TortoiseHg dialogs +# +# Copyright (C) 2008-9 Steve Borho <steve@borho.org> +# Copyright (C) 2008 TK Soh <teekaysoh@gmail.com> +# + + +shortlicense = '''\ +Copyright (C) 2009 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +''' + +TORTOISEHG_PATH = '~/tools/tortoisehg-dev' + +import sys + +if not hasattr(sys, "frozen"): + import os + # check if hggtk is a symlink first + pfile = __file__ + if pfile.endswith('.pyc'): + pfile = pfile[:-1] + thgpath = os.path.dirname(os.path.realpath(pfile)) + testpath = os.path.join(thgpath, 'hggtk') + if os.path.isdir(testpath): + if thgpath not in sys.path: + sys.path.insert(0, thgpath) + else: + # try environment or hard-coded path + thgpath = os.environ.get('TORTOISEHG_PATH', TORTOISEHG_PATH) + thgpath = os.path.normpath(os.path.expanduser(thgpath)) + if os.path.exists(thgpath) and thgpath not in sys.path: + sys.path.insert(0, thgpath) + # else assume tortoise is already in PYTHONPATH + +try: + import hggtk.hgtk +except ImportError: + sys.stderr.write("abort: couldn't find hggtk libraries in [%s]\n" % + ' '.join(sys.path)) + sys.stderr.write("(check your install and PYTHONPATH)\n") + sys.exit(-1) + +sys.exit(hggtk.hgtk.dispatch(sys.argv[1:])) +