Commits

Steve Borho committed ab07c9b

treeview: stop changeset search when log generator exits

It was possible to crash hgtk by clicking on a changeset hash that was not
reachable in the given a filtered log generator.

Also made one bug-fix string translatable.

  • Participants
  • Parent commits e7a6c96
  • Branches stable

Comments (0)

Files changed (1)

tortoisehg/hgtk/logview/treeview.py

             self.treeview.set_cursor(row)
             self.treeview.grab_focus()
         elif load:
-            handler = None
+            handler, stophandler = None, None
 
             def loaded(dummy):
                 if revid in self.index:
                     if handler is not None:
                         self.disconnect(handler)
+                        handler = None
                     self.set_revision_id(revid)
                     self.scroll_to_revision(revid)
                 else:
                     self.next_revision_batch(self.batchsize)
+            def stopped(dummy):
+                if handler is not None:
+                    self.disconnect(handler)
+                    handler = None
+                if stophandler is not None:
+                    self.disconnect(stophandler)
+                    stophandler = None
+                self.stbar.set_text(_('Changeset not found in current view'))
 
             try:
                 ctx = self.repo[revid]
                 if ctx.rev() == -1:
-                    self.stbar.set_text('Null changeset is not viewable')
+                    self.stbar.set_text(_('Null changeset is not viewable'))
                     return
             except Exception, e:
                 self.stbar.set_text(str(e))
                 return
             handler = self.connect('batch-loaded', loaded)
+            stophandler = self.connect('revisions-loaded', stopped)
             self.next_revision_batch(self.batchsize)
 
     def refresh(self, graphcol, pats, opts):