Rev 2952: (robertc) Fix data-refresh logic for packs not to refresh mid-transaction when a names write lock is held. (Robert Collins) in http://people.ubuntu.com/~robertc/baz2.0/pack

Robert Collins robertc at robertcollins.net
Wed Oct 31 16:54:42 GMT 2007


At http://people.ubuntu.com/~robertc/baz2.0/pack

------------------------------------------------------------
revno: 2952
revision-id:robertc at robertcollins.net-20071031165438-lc0o11v5vaf3p1ta
parent: pqm at pqm.ubuntu.com-20071030214613-c0ojrpmnm21da068
committer: Robert Collins <robertc at robertcollins.net>
branch nick: pack
timestamp: Thu 2007-11-01 03:54:38 +1100
message:
  (robertc) Fix data-refresh logic for packs not to refresh mid-transaction when a names write lock is held. (Robert Collins)
modified:
  bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2007-10-30 17:39:11 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2007-10-31 16:54:38 +0000
@@ -1295,6 +1295,7 @@
                 self._save_pack_names()
         else:
             self._new_pack.abort()
+            self._new_pack = None
         self.repo._text_knit = None
 
 
@@ -1514,7 +1515,9 @@
         return self
 
     def _refresh_data(self):
-        if self._write_lock_count == 1 or self.control_files._lock_count == 1:
+        if self._write_lock_count == 1 or (
+            self.control_files._lock_count == 1 and
+            self.control_files._lock_mode == 'r'):
             # forget what names there are
             self._pack_collection.reset()
             # XXX: Better to do an in-memory merge when acquiring a new lock -



More information about the bazaar-commits mailing list