Commits

Steve Borho committed cd125e7

treeview: improve error handling with empty repositories

If the user happens to trigger a refresh or batch request with an empty
repository, the UI should respond gracefully with an empty log view and
greyed out 'next batch' buttons.

Refs #808

Comments (0)

Files changed (1)

tortoisehg/hgtk/logview/treeview.py

         self.repo = repo
         self.currevid = None
         self.pbar = pbar
+        self.grapher = None
+        self.graphdata = []
         self.index = {}
         self.opts = { 'outgoing':[], 'orig-tip':None, 'npreviews':0,
                       'branch-color':False, 'show-graph':True }
             return None
 
     def next_revision_batch(self, size):
+        if not self.grapher:
+            self.emit('revisions-loaded')
+            return
         self.batchsize = size
         self.limit += self.batchsize
         if self.pbar is not None:
         gobject.idle_add(self.populate)
 
     def load_all_revisions(self):
+        if not self.grapher:
+            self.emit('revisions-loaded')
+            return
         self.limit = None
         if self.pbar is not None:
             self.pbar.begin()
         cell = gtk.CellRendererText()
         cell.set_property("width-chars", 8)
         cell.set_property("ellipsize", pango.ELLIPSIZE_END)
+        cell.set_property("xalign", 1.0)
         col = self.tvcolumns['rev'] = gtk.TreeViewColumn(_('Rev'))
         col.set_visible(False)
         col.set_resizable(True)