changeset 19714:0e07c0b5fb1c

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.
author Siddharth Agarwal <sid0@fb.com>
date Sat, 07 Sep 2013 12:42:46 -0700
parents c2e27e57d250
children 1aab406be57c
files mercurial/revlog.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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):