Patchwork D8182: nodemap: document the docket attributes

login
register
mail settings
Submitter phabricator
Date March 10, 2020, 8:48 p.m.
Message ID <b8175164d54897ed137619fb59d92f89@localhost.localdomain>
Download mbox | patch
Permalink /patch/45677/
State Not Applicable
Headers show

Comments

phabricator - March 10, 2020, 8:48 p.m.
Closed by commit rHG283fd803afa5: nodemap: document the docket attributes (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8182?vs=20385&id=20673

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8182/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8182

AFFECTED FILES
  mercurial/revlogutils/nodemap.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/revlogutils/nodemap.py b/mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py
+++ b/mercurial/revlogutils/nodemap.py
@@ -226,9 +226,20 @@ 
     def __init__(self, uid=None):
         if uid is None:
             uid = _make_uid()
+        # a unique identifier for the data file:
+        #   - When new data are appended, it is preserved.
+        #   - When a new data file is created, a new identifier is generated.
         self.uid = uid
+        # the tipmost revision stored in the data file. This revision and all
+        # revision before it are expected to be encoded in the data file.
         self.tip_rev = None
+        # the size (in bytes) of the persisted data to encode the nodemap valid
+        # for `tip_rev`.
+        #   - data file shorter than this are corrupted,
+        #   - any extra data should be ignored.
         self.data_length = None
+        # the amount (in bytes) of "dead" data, still in the data file but no
+        # longer used for the nodemap.
         self.data_unused = 0
 
     def copy(self):