revlog: update pure nodecache start lookup offset on insertion
authorGregory Szorc <gregory.szorc@gmail.com>
Fri, 12 Oct 2018 16:19:21 +0200
changeset 40180 ba70e3acf58a
parent 40179 b843356d4ae1
child 40181 958b4c506d3a
revlog: update pure nodecache start lookup offset on insertion test-storage.py is failing in pure builds because the population of the node cache isn't accounting for the new starting offset after a revlog insertion. This commit updates the node cache start offset to account for insertions. I'm not 100% convinced this is the ideal solution. But it works and seems correct. Differential Revision: https://phab.mercurial-scm.org/D4996
mercurial/revlog.py
--- a/mercurial/revlog.py	Wed Oct 03 13:57:42 2018 -0700
+++ b/mercurial/revlog.py	Fri Oct 12 16:19:21 2018 +0200
@@ -1937,6 +1937,11 @@
         self.index.append(e)
         self.nodemap[node] = curr
 
+        # Reset the pure node cache start lookup offset to account for new
+        # revision.
+        if self._nodepos is not None:
+            self._nodepos = curr
+
         entry = self._io.packentry(e, self.node, self.version, curr)
         self._writeentry(transaction, ifh, dfh, entry, deltainfo.data,
                          link, offset)