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

stable setup: clarify hg script to use for binary installer

We ended up with two in contrib/ and only one of them had the
proper path workarounds. Remove redundant loads of sys module

Changeset 2e318553be7e

Parent 70b66c1ef08c

by Steve Borho

Changes to 3 files · Browse files at 2e318553be7e Showing diff from parent 70b66c1ef08c Diff from another changeset...

Change 1 of 1 Show Entire File contrib/​hg Stacked
 
4
5
6
7
8
 
 
 
 
 
 
 
 
 
 
 
 
 
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
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
@@ -4,20 +4,29 @@
 #  # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>  # -# This software may be used and distributed according to the terms -# of the GNU General Public License, incorporated herein by reference. +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference. + +import os, sys + +cwd = os.getcwd() +if cwd in sys.path: + # Always remove current directory for Windows exe + if hasattr(sys, "frozen"): + sys.path.remove(cwd) + elif os.path.dirname(__file__) != cwd: + sys.path.remove(cwd) + sys.path.append(cwd)    # enable importing on demand to reduce startup time  try:   from mercurial import demandimport; demandimport.enable()  except ImportError: - import sys   sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %   ' '.join(sys.path))   sys.stderr.write("(check your install and PYTHONPATH)\n")   sys.exit(-1)   -import sys  import mercurial.util  import mercurial.dispatch  
Change 1 of 1 Show Entire File contrib/​win32/​hg 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,38 +0,0 @@
-#!/usr/bin/env python -# -# mercurial - scalable distributed SCM -# -# Copyright 2005-2007 Matt Mackall <mpm@selenic.com> -# -# This software may be used and distributed according to the terms of the -# GNU General Public License version 2, incorporated herein by reference. - -import os, sys - -cwd = os.getcwd() -if cwd in sys.path: - # Always remove current directory for Windows exe - if hasattr(sys, "frozen"): - sys.path.remove(cwd) - elif os.path.dirname(__file__) != cwd: - sys.path.remove(cwd) - sys.path.append(cwd) - -# enable importing on demand to reduce startup time -try: - from mercurial import demandimport; demandimport.enable() -except ImportError: - import sys - sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" % - ' '.join(sys.path)) - sys.stderr.write("(check your install and PYTHONPATH)\n") - sys.exit(-1) - -import sys -import mercurial.util -import mercurial.dispatch - -for fp in (sys.stdin, sys.stdout, sys.stderr): - mercurial.util.set_binary(fp) - -mercurial.dispatch.run()
Change 1 of 1 Show Entire File setup.py Stacked
 
98
99
100
101
 
102
103
104
 
98
99
100
 
101
102
103
104
@@ -98,7 +98,7 @@
  }   }   extra['console'] = [ - {'script':'../build-hg/hg', 'icon_resources':[(0,'icons/hg.ico')]}, + {'script':'contrib/hg', 'icon_resources':[(0,'icons/hg.ico')]},   {'script':'hgtk', 'icon_resources':[(0,'icons/thg_logo.ico')]}   ]   extra['windows'] = [