/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to viz/treemodel.py

  • Committer: Gary van der Merwe
  • Date: 2007-12-20 23:43:57 UTC
  • mto: This revision was merged to the branch mainline in revision 423.
  • Revision ID: garyvdm@garyvdm-desktop-20071220234357-kfefk2638n1ylfcx
Make viz not throw errors when there are 0 commits.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
        return rowref
63
63
    
64
64
    def on_get_value(self, rowref, column):
65
 
        (revid, node, lines, parents,
66
 
         children, revno_sequence) = self.line_graph_data[rowref]
 
65
        if len(self.line_graph_data) > 0:
 
66
            (revid, node, lines, parents,
 
67
             children, revno_sequence) = self.line_graph_data[rowref]
 
68
        else:
 
69
            (revid, node, lines, parents,
 
70
             children, revno_sequence) = (None, (0, 0), (), (),
 
71
                                          (), ())
67
72
        if column == REVID: return revid
68
73
        if column == NODE: return node
69
74
        if column == LINES: return lines
76
81
        if column == REVNO: return ".".join(["%d" % (revno)
77
82
                                      for revno in revno_sequence])
78
83
        
 
84
        if revid is None:
 
85
            return None
79
86
        if revid not in self.revisions:
80
87
            revision = self.repository.get_revisions([revid])[0]
81
88
            self.revisions[revid] = revision