[Pkg-bazaar-commits] ./bzr-gtk/unstable r423: Merge 0 commits fix.

Gary van der Merwe garyvdm at gmail.com
Fri Apr 10 07:50:16 UTC 2009


------------------------------------------------------------
revno: 423
committer: Gary van der Merwe <garyvdm at gmail.com>
branch nick: gtk
timestamp: Sat 2007-12-22 14:51:41 +0200
message:
  Merge 0 commits fix.
modified:
  NEWS
  viz/linegraph.py
  viz/treemodel.py
    ------------------------------------------------------------
    revno: 421.1.1
    committer: Gary van der Merwe <garyvdm at garyvdm-desktop>
    branch nick: gtk
    timestamp: Fri 2007-12-21 01:43:57 +0200
    message:
      Make viz not throw errors when there are 0 commits.
    modified:
      NEWS
      viz/linegraph.py
      viz/treemodel.py
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2007-12-20 19:57:30 +0000
+++ b/NEWS	2007-12-20 23:43:57 +0000
@@ -5,6 +5,9 @@
   * Catch UnsupportedProtocol exception in the Nautilus extension. (#77965)
   
   * Make Nautilus extension work again. (#111826, Toshio Kuratomi)
+  
+  * Make viz not throw errors when there are 0 commits. (#173698, Gary van der
+    Merwe)
 
  INTERNALS
 

=== modified file 'viz/linegraph.py'
--- a/viz/linegraph.py	2007-10-31 02:18:28 +0000
+++ b/viz/linegraph.py	2007-12-20 23:43:57 +0000
@@ -46,10 +46,13 @@
     for revid in graph_parents.iterkeys():
         graph_children[revid] = []
 
-    merge_sorted_revisions = merge_sort(
-        graph_parents,
-        start,
-        generate_revno=True)
+    if len(graph_parents)>0:
+        merge_sorted_revisions = merge_sort(
+            graph_parents,
+            start,
+            generate_revno=True)
+    else:
+        merge_sorted_revisions = ()
     
     revid_index = {}
     revno_index = {}

=== modified file 'viz/treemodel.py'
--- a/viz/treemodel.py	2007-12-03 22:32:04 +0000
+++ b/viz/treemodel.py	2007-12-20 23:43:57 +0000
@@ -62,8 +62,13 @@
         return rowref
     
     def on_get_value(self, rowref, column):
-        (revid, node, lines, parents,
-         children, revno_sequence) = self.line_graph_data[rowref]
+        if len(self.line_graph_data) > 0:
+            (revid, node, lines, parents,
+             children, revno_sequence) = self.line_graph_data[rowref]
+        else:
+            (revid, node, lines, parents,
+             children, revno_sequence) = (None, (0, 0), (), (),
+                                          (), ())
         if column == REVID: return revid
         if column == NODE: return node
         if column == LINES: return lines
@@ -76,6 +81,8 @@
         if column == REVNO: return ".".join(["%d" % (revno)
                                       for revno in revno_sequence])
         
+        if revid is None:
+            return None
         if revid not in self.revisions:
             revision = self.repository.get_revisions([revid])[0]
             self.revisions[revid] = revision



More information about the Pkg-bazaar-commits mailing list