Mercurial > public > mercurial-scm > hg-stable
diff mercurial/revlogutils/__init__.py @ 48536:52034c42c09d
rank: add a "rank" value to the revlog-entry tuple
The rank of a revision is the size of sub-graph it defines as a head. In other
words, the rank of X is the size of `ancestors(X)` (X included).
This is a property that can help various algorithm and we intend to store it in
changelog-v2. We start with adding this new information to the "entry tuple",
with a default value. We will start to compute and persist the rank later.
Differential Revision: https://phab.mercurial-scm.org/D11936
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 14 Dec 2021 23:56:38 +0100 |
parents | 34cc102c73f5 |
children | 6000f5b25c9b |
line wrap: on
line diff
--- a/mercurial/revlogutils/__init__.py Wed Dec 15 14:50:07 2021 +0100 +++ b/mercurial/revlogutils/__init__.py Tue Dec 14 23:56:38 2021 +0100 @@ -12,6 +12,7 @@ # See mercurial.revlogutils.constants for doc COMP_MODE_INLINE = 2 +RANK_UNKNOWN = -1 def offset_type(offset, type): @@ -34,6 +35,7 @@ sidedata_offset=0, sidedata_compressed_length=0, sidedata_compression_mode=COMP_MODE_INLINE, + rank=RANK_UNKNOWN, ): """Build one entry from symbolic name @@ -56,6 +58,7 @@ sidedata_compressed_length, data_compression_mode, sidedata_compression_mode, + rank, )