Commit 11261766 authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

nodemap: refresh the persistent data on nodemap creation

The logic to read the data and validate the docket are still in python, so we
need to "help" whatever compiled code live in the index to refresh it.

Otherwise clearing the cache could lead to an expensive full recomputation and
disk update even when the persisted data are still valid.

Differential Revision: https://phab.mercurial-scm.org/D8174
parent 283fd803afa5
Pipeline #4002 passed with stage
in 25 minutes and 43 seconds
......@@ -760,4 +760,5 @@
self._chainbasecache.clear()
self._chunkcache = (0, b'')
self._pcache = {}
self._nodemap_docket = None
self.index.clearcaches()
......@@ -763,4 +764,16 @@
self.index.clearcaches()
# The python code is the one responsible for validating the docket, we
# end up having to refresh it here.
use_nodemap = (
not self._inline
and self.nodemap_file is not None
and util.safehasattr(self.index, 'update_nodemap_data')
)
if use_nodemap:
nodemap_data = nodemaputil.persisted_data(self)
if nodemap_data is not None:
self._nodemap_docket = nodemap_data[0]
self.index.update_nodemap_data(*nodemap_data)
def rev(self, node):
try:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment