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

hggtk/datamine: gracefully deal with unrevisioned input files

Changeset c19f15cb969c

Parent bea7aabf45bc

by Steve Borho

Changes to one file · Browse files at c19f15cb969c Showing diff from parent bea7aabf45bc Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​datamine.py Stacked
 
11
12
13
14
 
15
16
17
 
334
335
336
337
 
 
 
 
 
 
338
339
340
 
591
592
593
594
 
595
596
597
 
11
12
13
 
14
15
16
17
 
334
335
336
 
337
338
339
340
341
342
343
344
345
 
596
597
598
 
599
600
601
602
@@ -11,7 +11,7 @@
 import re  import threading  import time -from mercurial import hg, ui, util +from mercurial import hg, ui, util, revlog  from hglib import hgcmd_toq  from gdialog import *  from vis import treemodel @@ -334,7 +334,12 @@
  '''   if revid == '.':   ctx = self.repo.workingctx().parents()[0] - fctx = ctx.filectx(path) + try: + fctx = ctx.filectx(path) + except revlog.LookupError: + Prompt('File is unrevisioned', + 'Unable to annotate ' + path, self).run() + return   rev = fctx.filelog().linkrev(fctx.filenode())   revid = str(rev)   else: @@ -591,7 +596,7 @@
  dialog.display()   for f in cfiles:   dialog.add_annotate_page(f, '.') - if not cfiles: + if not dialog.notebook.get_n_pages():   dialog.add_search_page()     gtk.gdk.threads_init()