revlog.revision: fix cache preload for inline revlogs
authorSiddharth Agarwal <sid0@fb.com>
Sat, 07 Sep 2013 12:42:46 -0700
changeset 19714 0e07c0b5fb1c
parent 19713 c2e27e57d250
child 19715 1aab406be57c
revlog.revision: fix cache preload for inline revlogs Previously the length of data preloaded did not account for the interleaved io contents. This meant that we'd sometimes have cache misses in _chunks despite the preloading. Having a correctly filled out cache will become essential in an upcoming patch.
mercurial/revlog.py
--- a/mercurial/revlog.py	Fri Sep 06 16:31:35 2013 -0700
+++ b/mercurial/revlog.py	Sat Sep 07 12:42:46 2013 -0700
@@ -845,9 +845,11 @@
 
     def _chunkraw(self, startrev, endrev):
         start = self.start(startrev)
-        length = self.end(endrev) - start
+        end = self.end(endrev)
         if self._inline:
             start += (startrev + 1) * self._io.size
+            end += (endrev + 1) * self._io.size
+        length = end - start
         return self._getchunk(start, length)
 
     def _chunk(self, rev):