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

stable datamine: improve exception handling

Catch lookup errors from grep and annotate calls.
util.Abort is not exposed through hglib

Fixes #690

Changeset 56bf80bb3f08

Parent c0e47ead8ccb

by Steve Borho

Changes to one file · Browse files at 56bf80bb3f08 Showing diff from parent c0e47ead8ccb Diff from another changeset...

 
299
300
301
302
 
303
304
305
 
453
454
455
456
 
457
458
459
 
749
750
751
 
 
 
 
 
 
752
753
754
755
756
 
757
758
759
 
299
300
301
 
302
303
304
305
 
453
454
455
 
456
457
458
459
 
749
750
751
752
753
754
755
756
757
758
759
760
761
 
762
763
764
765
@@ -299,7 +299,7 @@
  try:   relpath = util.canonpath(self.repo.root, self.cwd, '.')   includes.set_text(relpath) - except hglib.Abort: + except util.Abort:   # Some paths inside root are invalid (.hg/*)   pass   excludes = gtk.Entry() @@ -453,7 +453,7 @@
  def threadfunc(q, *args):   try:   hglib.hgcmd_toq(q, *args) - except hglib.Abort, e: + except (util.Abort, hglib.LookupError), e:   self.stbar.set_status_text(_('Abort: %s') % str(e))     thread = thread2.Thread(target=threadfunc, args=args) @@ -749,11 +749,17 @@
  background thread to perform the annotation. Disable the select   button until this operation is complete.   ''' + def threadfunc(q, *args): + try: + hglib.hgcmd_toq(q, *args) + except (util.Abort, hglib.LookupError), e: + self.stbar.set_status_text(_('Abort: %s') % str(e)) +   (frame, treeview, origpath, graphview) = objs   q = Queue.Queue()   args = [q, 'annotate', '--follow', '--number',   '--rev', str(rev), 'path:'+path] - thread = thread2.Thread(target=hglib.hgcmd_toq, args=args) + thread = thread2.Thread(target=threadfunc, args=args)   thread.start()   frame._mythread = thread   self.stop_button.set_sensitive(True)