Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.4rc1, 0.4rc2, and 0.4rc3

hggtk/hgcmd: fix potential lockup when called by other apps

when the calling apps has other threads running before calling hgcmd.
This partially contributes to SF bug# 1902446, where the commit
operation cannot be completed until the visual diff tool is closed.

Changeset fb5b3786bf3f

Parent 5619cc29cef8

by TK Soh

Changes to one file · Browse files at fb5b3786bf3f Showing diff from parent 5619cc29cef8 Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​hgcmd.py Stacked
 
86
87
88
89
 
90
91
92
 
117
118
119
120
 
121
122
123
 
128
129
130
131
 
132
133
134
 
86
87
88
 
89
90
91
92
 
117
118
119
 
120
121
122
123
 
128
129
130
 
131
132
133
134
@@ -86,7 +86,7 @@
  return True     def _response(self, widget, response_id): - if threading.activeCount() > 1: + if self.hgthread.isAlive():   widget.emit_stop_by_name('response')     def _on_window_map_event(self, event, param): @@ -117,7 +117,7 @@
  except Queue.Empty:   pass   self.update_progress() - if threading.activeCount() == 1: + if not self.hgthread.isAlive():   self._button_ok.set_sensitive(True)   self.returncode = self.hgthread.return_code()   return False # Stop polling this function @@ -128,7 +128,7 @@
  if not self.pbar:   return # progress bar not enabled   - if threading.activeCount() == 1: + if not self.hgthread.isAlive():   self.pbar.unmap()   else:   # pulse the progress bar every ~100ms