changeset 40180:ba70e3acf58a

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
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 12 Oct 2018 16:19:21 +0200
parents b843356d4ae1
children 958b4c506d3a
files mercurial/revlog.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)