[Pkg-bazaar-commits] ./bzr-gtk/unstable r36: patch from Aaron Bentley to lock the repository to boost performance getting single revisions

Jamie Wilkinson jaq at spacepants.org
Fri Apr 10 07:15:49 UTC 2009


------------------------------------------------------------
revno: 36
committer: Jamie Wilkinson <jaq at spacepants.org>
branch nick: bzrk.jaq
timestamp: Fri 2006-03-10 16:08:53 +1100
message:
  patch from Aaron Bentley to lock the repository to boost performance getting single revisions
modified:
  __init__.py
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2005-12-03 13:13:08 +0000
+++ b/__init__.py	2006-03-10 05:08:53 +0000
@@ -48,17 +48,23 @@
     def run(self, location=".", revision=None, robust=False, accurate=False,
             maxnum=None):
         (branch, path) = Branch.open_containing(location)
-        if revision is None:
-            revid = branch.last_revision()
-            if revid is None:
-                return
-        else:
-            (revno, revid) = revision[0].in_history(branch)
-
-        from bzrkapp import BzrkApp
-
-        app = BzrkApp()
-        app.show(branch, revid, robust, accurate, maxnum)
+        branch.lock_read()
+        branch.repository.lock_read()
+        try:
+            if revision is None:
+                revid = branch.last_revision()
+                if revid is None:
+                    return
+            else:
+                (revno, revid) = revision[0].in_history(branch)
+
+            from bzrkapp import BzrkApp
+                
+            app = BzrkApp()
+            app.show(branch, revid, robust, accurate, maxnum)
+        finally:
+            branch.repository.unlock()
+            branch.unlock()
         app.main()
 
 



More information about the Pkg-bazaar-commits mailing list