Rev 2923: Reset the dirstate cache pointer for the entry on lookup of a new block, suggested by John. in http://people.ubuntu.com/~robertc/baz2.0/dirstate.cache

Robert Collins robertc at robertcollins.net
Mon Oct 22 20:33:04 BST 2007


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

------------------------------------------------------------
revno: 2923
revision-id:robertc at robertcollins.net-20071022193257-4sa1111h0d0b01zg
parent: robertc at robertcollins.net-20071022043300-c8sdvyizlgoy3i97
committer: Robert Collins <robertc at robertcollins.net>
branch nick: dirstate.cache
timestamp: Tue 2007-10-23 05:32:57 +1000
message:
  Reset the dirstate cache pointer for the entry on lookup of a new block, suggested by John.
modified:
  bzrlib/dirstate.py             dirstate.py-20060728012006-d6mvoihjb3je9peu-1
=== modified file 'bzrlib/dirstate.py'
--- a/bzrlib/dirstate.py	2007-10-22 04:33:00 +0000
+++ b/bzrlib/dirstate.py	2007-10-22 19:32:57 +0000
@@ -1061,6 +1061,7 @@
         present = (block_index < len(self._dirblocks) and
             self._dirblocks[block_index][0] == key[0])
         self._last_block_index = block_index
+        self._last_entry_index = -1
         return block_index, present
 
     def _find_entry_index(self, key, block):
@@ -1075,7 +1076,7 @@
                 entry_index = self._last_entry_index + 1
                 # A hit is when the key is after the last slot, and before or
                 # equal to the next slot.
-                if (block[entry_index - 1][0] < key and
+                if ((entry_index > 0 and block[entry_index - 1][0] < key) and
                     key <= block[entry_index][0]):
                     self._last_entry_index = entry_index
                     present = block[entry_index][0] == key



More information about the bazaar-commits mailing list