comparison mercurial/unionrepo.py @ 48499: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 2b69555e4875
children 6000f5b25c9b
comparison
equal deleted inserted replaced
48498:d5137c00ab17 48499:52034c42c09d
69 node, 69 node,
70 _sdo, 70 _sdo,
71 _sds, 71 _sds,
72 _dcm, 72 _dcm,
73 _sdcm, 73 _sdcm,
74 rank,
74 ) = rev 75 ) = rev
75 flags = _start & 0xFFFF 76 flags = _start & 0xFFFF
76 77
77 if linkmapper is None: # link is to same revlog 78 if linkmapper is None: # link is to same revlog
78 assert linkrev == rev2 # we never link back 79 assert linkrev == rev2 # we never link back
105 node, 106 node,
106 0, # sidedata offset 107 0, # sidedata offset
107 0, # sidedata size 108 0, # sidedata size
108 revlog_constants.COMP_MODE_INLINE, 109 revlog_constants.COMP_MODE_INLINE,
109 revlog_constants.COMP_MODE_INLINE, 110 revlog_constants.COMP_MODE_INLINE,
111 rank,
110 ) 112 )
111 self.index.append(e) 113 self.index.append(e)
112 self.bundlerevs.add(n) 114 self.bundlerevs.add(n)
113 n += 1 115 n += 1
114 116