diff --git a/mercurial/pure/parsers.py b/mercurial/pure/parsers.py --- a/mercurial/pure/parsers.py +++ b/mercurial/pure/parsers.py @@ -156,6 +156,14 @@ index.""" return nodemaputil.persistent_data(self) + def update_nodemap_data(self, nm_data): + """provide full blokc of persisted binary data for a nodemap + + The data are expected to come from disk. See `nodemap_data_all` for a + produceur of such data.""" + if nm_data is not None: + nodemaputil.parse_data(nm_data) + class InlinedIndexObject(BaseIndexObject): def __init__(self, data, inline=0): diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -626,6 +626,16 @@ self._io = rustrevlogio() try: d = self._io.parseindex(indexdata, self._inline) + index, _chunkcache = d + use_nodemap = ( + not self._inline + and self.nodemap_file is not None + and util.safehasattr(index, 'update_nodemap_data') + ) + if use_nodemap: + nodemap_data = nodemaputil.persisted_data(self) + if nodemap_data is not None: + index.update_nodemap_data(nodemap_data) except (ValueError, IndexError): raise error.RevlogError( _(b"index %s is corrupted") % self.indexfile