Mercurial > hg
comparison mercurial/revlogutils/nodemap.py @ 44494:283fd803afa5
nodemap: document the docket attributes
More documentation rarely hurts.
Differential Revision: https://phab.mercurial-scm.org/D8182
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 27 Feb 2020 16:09:17 +0100 |
parents | 6aee0647e026 |
children | 3265c92f7d13 |
comparison
equal
deleted
inserted
replaced
44493:02c47b74366c | 44494:283fd803afa5 |
---|---|
224 """ | 224 """ |
225 | 225 |
226 def __init__(self, uid=None): | 226 def __init__(self, uid=None): |
227 if uid is None: | 227 if uid is None: |
228 uid = _make_uid() | 228 uid = _make_uid() |
229 # a unique identifier for the data file: | |
230 # - When new data are appended, it is preserved. | |
231 # - When a new data file is created, a new identifier is generated. | |
229 self.uid = uid | 232 self.uid = uid |
233 # the tipmost revision stored in the data file. This revision and all | |
234 # revision before it are expected to be encoded in the data file. | |
230 self.tip_rev = None | 235 self.tip_rev = None |
236 # the size (in bytes) of the persisted data to encode the nodemap valid | |
237 # for `tip_rev`. | |
238 # - data file shorter than this are corrupted, | |
239 # - any extra data should be ignored. | |
231 self.data_length = None | 240 self.data_length = None |
241 # the amount (in bytes) of "dead" data, still in the data file but no | |
242 # longer used for the nodemap. | |
232 self.data_unused = 0 | 243 self.data_unused = 0 |
233 | 244 |
234 def copy(self): | 245 def copy(self): |
235 new = NodeMapDocket(uid=self.uid) | 246 new = NodeMapDocket(uid=self.uid) |
236 new.tip_rev = self.tip_rev | 247 new.tip_rev = self.tip_rev |