Rev 22: Lock (matters /a lot/) in file:///home/jelmer/bzr/bzrsvnserve/

Jelmer Vernooij jelmer at samba.org
Mon Jan 22 16:21:07 GMT 2007


------------------------------------------------------------
revno: 22
revision-id: jelmer at samba.org-20070122162053-ut129mvs7joysh8s
parent: jelmer at samba.org-20070122161906-lcam7eccas1zq1po
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: bzrsvnserve
timestamp: Mon 2007-01-22 17:20:53 +0100
message:
  Lock (matters /a lot/)
modified:
  svnserver.py                   svnserver.py-20061015150253-0jjovnw1ax00rjlb-1
=== modified file 'svnserver.py'
--- a/svnserver.py	2007-01-22 15:57:32 +0000
+++ b/svnserver.py	2007-01-22 16:20:53 +0000
@@ -65,17 +65,21 @@
         self.send_success([], "")
         revno = start_rev[0]
         i = 0
-        # FIXME: check whether start_rev and end_rev actually exist
-        while revno != end_rev[0]:
-            #TODO: Honor target_path, strict_node, changed_paths
-            if end_rev[0] > revno:
-                revno+=1
-            else:
-                revno-=1
-            if limit != 0 and i == limit:
-                break
-            if revno != 0:
-                send_revision(revno, self.branch.repository.get_revision(self.branch.get_rev_id(revno)))
+        self.branch.repository.lock_read()
+        try:
+            # FIXME: check whether start_rev and end_rev actually exist
+            while revno != end_rev[0]:
+                #TODO: Honor target_path, strict_node, changed_paths
+                if end_rev[0] > revno:
+                    revno+=1
+                else:
+                    revno-=1
+                if limit != 0 and i == limit:
+                    break
+                if revno != 0:
+                    send_revision(revno, self.branch.repository.get_revision(self.branch.get_rev_id(revno)))
+        finally:
+            self.branch.repository.unlock()
 
         self.send_msg(literal("done"))
         self.send_success()




More information about the bazaar-commits mailing list