# HG changeset patch # User Pierre-Yves David # Date 1582049474 -3600 # Node ID 87b327de772c779c8cf9ade19ca2fa105e6805c0 # Parent aa0e1341457b04d684aa09912d35137103b1e510 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 diff -r aa0e1341457b -r 87b327de772c mercurial/revlog.py --- a/mercurial/revlog.py Wed Mar 11 05:41:02 2020 +0100 +++ b/mercurial/revlog.py Tue Feb 18 19:11:14 2020 +0100 @@ -760,7 +760,20 @@ self._chainbasecache.clear() self._chunkcache = (0, b'') self._pcache = {} + self._nodemap_docket = None 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: