comparison mercurial/pure/parsers.py @ 44336:8374b69aef75

nodemap: track the total and unused amount of data in the rawdata file We need to keep that information around: * total data will allow transaction to start appending new information without confusing other reader. * unused data will allow to detect when we should regenerate new rawdata file. Differential Revision: https://phab.mercurial-scm.org/D7889
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 15 Jan 2020 15:50:24 +0100
parents e41a164db7a9
children 1d2b37def017
comparison
equal deleted inserted replaced
44335:e41a164db7a9 44336:8374b69aef75
162 This containst the data for an append-only update of the data provided 162 This containst the data for an append-only update of the data provided
163 in the last call to `update_nodemap_data`. 163 in the last call to `update_nodemap_data`.
164 """ 164 """
165 if self._nm_root is None: 165 if self._nm_root is None:
166 return None 166 return None
167 data = nodemaputil.update_persistent_data( 167 changed, data = nodemaputil.update_persistent_data(
168 self, self._nm_root, self._nm_max_idx, self._nm_rev 168 self, self._nm_root, self._nm_max_idx, self._nm_rev
169 ) 169 )
170 self._nm_root = self._nm_max_idx = self._nm_rev = None 170 self._nm_root = self._nm_max_idx = self._nm_rev = None
171 return data 171 return changed, data
172 172
173 def update_nodemap_data(self, docket, nm_data): 173 def update_nodemap_data(self, docket, nm_data):
174 """provide full block of persisted binary data for a nodemap 174 """provide full block of persisted binary data for a nodemap
175 175
176 The data are expected to come from disk. See `nodemap_data_all` for a 176 The data are expected to come from disk. See `nodemap_data_all` for a