Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9.3, 2.0, and 2.0.1

stable about: use hg proxy if any to open version URL

System proxy is not always recognized by Python
(PAC file for instance).

Changeset 78660f611adf

Parent 450580015feb

by André Sintzoff

Changes to one file · Browse files at 78660f611adf Showing diff from parent 450580015feb Diff from another changeset...

 
13
14
15
 
 
16
17
18
 
162
163
164
 
165
166
 
167
168
169
 
172
173
174
175
 
176
177
 
178
179
180
 
13
14
15
16
17
18
19
20
 
164
165
166
167
168
 
169
170
171
172
 
175
176
177
 
178
179
 
180
181
182
183
@@ -13,6 +13,8 @@
   import os, sys, urllib2   +from mercurial import ui, url +  from tortoisehg.hgqt.i18n import _  from tortoisehg.hgqt import qtlib  from tortoisehg.util import version, hglib, shlib, paths @@ -162,8 +164,9 @@
  def run(self):   verurl = 'http://tortoisehg.bitbucket.org/curversion.txt'   newver = (0,0,0) + opener = url.opener(ui.ui())   try: - f = urllib2.urlopen(verurl).read().splitlines() + f = opener.open(verurl).read().splitlines()   newver = tuple([int(p) for p in f[0].split('.')])   upgradeurl = f[1] # generic download URL   platform = sys.platform @@ -172,9 +175,9 @@
  platform = IsX64() and 'x64' or 'x86'   # linux2 for Linux, darwin for OSX   for line in f[2:]: - p, url = line.split(':') + p, _url = line.split(':')   if platform == p: - upgradeurl = url.strip() + upgradeurl = _url.strip()   break   except:   pass