Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0.4, 2.0.5, and 2.1

stable py24: fix thg compatibility with python 2.4 and CentOS 5

First I have replaced control statement that are invalid in py24:
- try ... except ... finally only appears in py25
- yield is forbidden inside a try ... finally

Then the RPM spec file has been modified so that:
- the mandatory --vendor option is a nil operation as it use the same
name as the prefix
- egg-info is not generated on older platform (typically py2.4)

Changeset c8060a9b71b5

Parent 420a051ade88

by Gilles Moris

Changes to 7 files · Browse files at c8060a9b71b5 Showing diff from parent 420a051ade88 Diff from another changeset...

 
67
68
69
70
 
71
72
73
 
80
81
82
 
83
 
84
85
86
 
67
68
69
 
70
71
72
73
 
80
81
82
83
84
85
86
87
88
@@ -67,7 +67,7 @@
 install contrib/mergetools.rc $RPM_BUILD_ROOT%{_sysconfdir}/mercurial/hgrc.d/thgmergetools.rc    ln -s tortoisehg/icons/svg/thg_logo.svg %{buildroot}%{_datadir}/pixmaps/%{name}_logo.svg -desktop-file-install --dir=%{buildroot}%{_datadir}/applications contrib/%{name}.desktop +desktop-file-install --dir=%{buildroot}%{_datadir}/applications contrib/%{name}.desktop --vendor %{name}    %find_lang %{name}   @@ -80,7 +80,9 @@
 %doc COPYING.txt doc/build/html/  %{_bindir}/thg  %{python_sitelib}/tortoisehg/ +%if "%{?pythonver}" > "2.4"  %{python_sitelib}/tortoisehg-*.egg-info +%endif  %{_datadir}/pixmaps/tortoisehg/  %{_datadir}/pixmaps/%{name}_logo.svg  %{_datadir}/applications/%{name}.desktop
 
354
355
356
357
358
359
360
361
362
 
 
 
 
 
 
 
363
364
365
 
354
355
356
 
 
 
 
 
 
357
358
359
360
361
362
363
364
365
366
@@ -354,12 +354,13 @@
  assert self.currentThread() != qApp.thread()   self._threadid = self.currentThreadId()   try: - data = [] - for (fctx, line), _text in self._fctx.annotate(True, True): - data.append((fctx, line)) - self.data = data - except KeyboardInterrupt: - pass + try: + data = [] + for (fctx, line), _text in self._fctx.annotate(True, True): + data.append((fctx, line)) + self.data = data + except KeyboardInterrupt: + pass   finally:   self._threadid = None   del self._fctx
 
210
211
212
213
214
215
216
217
218
 
 
 
 
 
 
 
219
220
221
 
210
211
212
 
 
 
 
 
 
213
214
215
216
217
218
219
220
221
222
@@ -210,12 +210,13 @@
    def startSettings(self, parent):   try: - dlg = SettingsDialog(configrepo=True, focus='web.name', parent=parent, - root=self._root) - self.ensureRepoLoaded() - dlg.exec_() - except error.RepoError: - pass + try: + dlg = SettingsDialog(configrepo=True, focus='web.name', parent=parent, + root=self._root) + self.ensureRepoLoaded() + dlg.exec_() + except error.RepoError: + pass   finally:   dlg.deleteLater()  
 
397
398
399
400
401
402
403
404
405
 
 
 
 
 
 
 
406
407
408
 
397
398
399
 
 
 
 
 
 
400
401
402
403
404
405
406
407
408
409
@@ -397,12 +397,13 @@
  def excepthandler(self):   'Display exception info; run in main (GUI) thread'   try: - self._showexceptiondialog() - except: - # make sure to quit mainloop first, so that it never leave - # zombie process. - self._mainapp.exit(1) - self._printexception() + try: + self._showexceptiondialog() + except: + # make sure to quit mainloop first, so that it never leave + # zombie process. + self._mainapp.exit(1) + self._printexception()   finally:   self.errors = []  
 
133
134
135
136
137
138
139
140
 
 
 
 
 
 
141
142
143
 
133
134
135
 
 
 
 
 
136
137
138
139
140
141
142
143
144
@@ -133,11 +133,12 @@
  origtimeout = socket.getdefaulttimeout()   socket.setdefaulttimeout(TIMEOUT)   try: - conn.request('GET', '/') - res = conn.getresponse() - res.read() - except (socket.error, httplib.HTTPException): - pass + try: + conn.request('GET', '/') + res = conn.getresponse() + res.read() + except (socket.error, httplib.HTTPException): + pass   finally:   socket.setdefaulttimeout(origtimeout)   conn.close()
 
506
507
508
509
510
511
512
513
 
 
 
 
 
 
514
515
516
 
506
507
508
 
 
 
 
 
509
510
511
512
513
514
515
516
517
@@ -506,11 +506,12 @@
  if shell:   cwd = os.getcwd()   try: - os.chdir(folder) - QProcess.startDetached(shell) - except EnvironmentError, e: - qtlib.InfoMsgBox(_('Repository not found'), - hglib.tounicode(str(e))) + try: + os.chdir(folder) + QProcess.startDetached(shell) + except EnvironmentError, e: + qtlib.InfoMsgBox(_('Repository not found'), + hglib.tounicode(str(e)))   finally:   os.chdir(cwd)   else:
 
614
615
616
617
 
618
 
 
 
 
614
615
616
 
617
618
619
620
621
@@ -614,5 +614,8 @@
  for e in repotreemodel.iterRepoItemFromXml(f):   if e.basenode() == repoid:   yield e.rootpath(), e.shortname() - finally: + except:   f.close() + raise + else: + f.close()