Mercurial > hg
diff mercurial/pure/parsers.py @ 44337:1d2b37def017
nodemap: double check the source docket when doing incremental update
In theory, the index will have the information we expect it to have. However by
security, it seems safer to double check that the incremental data are generated
from the data currently on disk.
Differential Revision: https://phab.mercurial-scm.org/D7890
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 15 Jan 2020 15:50:33 +0100 |
parents | 8374b69aef75 |
children | 7baf5f798ba9 |
line wrap: on
line diff
--- a/mercurial/pure/parsers.py Wed Jan 15 15:50:24 2020 +0100 +++ b/mercurial/pure/parsers.py Wed Jan 15 15:50:33 2020 +0100 @@ -164,11 +164,13 @@ """ if self._nm_root is None: return None + docket = self._nm_docket changed, data = nodemaputil.update_persistent_data( - self, self._nm_root, self._nm_max_idx, self._nm_rev + self, self._nm_root, self._nm_max_idx, self._nm_docket.tip_rev ) - self._nm_root = self._nm_max_idx = self._nm_rev = None - return changed, data + + self._nm_root = self._nm_max_idx = self._nm_docket = None + return docket, changed, data def update_nodemap_data(self, docket, nm_data): """provide full block of persisted binary data for a nodemap @@ -178,9 +180,9 @@ if nm_data is not None: self._nm_root, self._nm_max_idx = nodemaputil.parse_data(nm_data) if self._nm_root: - self._nm_rev = docket.tip_rev + self._nm_docket = docket else: - self._nm_root = self._nm_max_idx = self._nm_rev = None + self._nm_root = self._nm_max_idx = self._nm_docket = None class InlinedIndexObject(BaseIndexObject):