[Pkg-bazaar-commits] ./bzr-gtk/unstable r392: Fixed performance issue by only releasing the branch lock when the treeview is destroyed. This will surely fuck up the tagging code.

Daniel Schierbeck daniel.schierbeck at gmail.com
Fri Apr 10 07:45:05 UTC 2009


------------------------------------------------------------
revno: 392
committer: Daniel Schierbeck <daniel.schierbeck at gmail.com>
branch nick: menubar
timestamp: Fri 2007-11-09 18:53:26 +0100
message:
  Fixed performance issue by only releasing the branch lock when the treeview is destroyed. This will surely fuck up the tagging code.
modified:
  viz/treeview.py
-------------- next part --------------
=== modified file 'viz/treeview.py'
--- a/viz/treeview.py	2007-11-09 17:46:39 +0000
+++ b/viz/treeview.py	2007-11-09 17:53:26 +0000
@@ -81,6 +81,8 @@
         self.children = None
         self.parents  = None
 
+        self.connect("destroy", lambda x: self.branch.unlock())
+
     def do_get_property(self, property):
         if property.name == 'revno-column-visible':
             return self.revno_column.get_visible()
@@ -176,25 +178,21 @@
         :param broken_line_length: After how much lines branches \
                        should be broken.
         """
-        try:
-            self.branch.lock_read()
-            (linegraphdata, index, columns_len) = linegraph(self.branch.repository,
-                                                            start,
-                                                            maxnum, 
-                                                            broken_line_length)
-
-            self.model = TreeModel(self.branch.repository, linegraphdata)
-            self.graph_cell.columns_len = columns_len
-            width = self.graph_cell.get_size(self.treeview)[2]
-            self.graph_column.set_fixed_width(width)
-            self.graph_column.set_max_width(width)
-            self.index = index
-            self.treeview.set_model(self.model)
-            self.treeview.set_cursor(0)
-            self.emit('revisions-loaded')
-
-        finally:
-            self.branch.unlock()
+        self.branch.lock_read()
+        (linegraphdata, index, columns_len) = linegraph(self.branch.repository,
+                                                        start,
+                                                        maxnum, 
+                                                        broken_line_length)
+
+        self.model = TreeModel(self.branch.repository, linegraphdata)
+        self.graph_cell.columns_len = columns_len
+        width = self.graph_cell.get_size(self.treeview)[2]
+        self.graph_column.set_fixed_width(width)
+        self.graph_column.set_max_width(width)
+        self.index = index
+        self.treeview.set_model(self.model)
+        self.treeview.set_cursor(0)
+        self.emit('revisions-loaded')
 
         return False
 



More information about the Pkg-bazaar-commits mailing list