Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/unionrepo.py @ 46793:6266d19556ad
node: introduce nodeconstants class
In preparing for moving from SHA1 hashes to a modern hash function,
place nullid and other constant magic vules in a class. Provide the
active set of constants in the repository and push it down. Provide
nullid directly in strategic places like the repository as it is
accessed very often. This changeset introduces the API change, but not
the mechanical replacement of the node.py attributes itself.
Differential Revision: https://phab.mercurial-scm.org/D9750
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Wed, 13 Jan 2021 16:14:58 +0100 |
parents | 711ba0f1057e |
children | 4c041c71ec01 |
comparison
equal
deleted
inserted
replaced
46792:49fd21f32695 | 46793:6266d19556ad |
---|---|
151 self, opener, self.indexfile, changelog2, linkmapper | 151 self, opener, self.indexfile, changelog2, linkmapper |
152 ) | 152 ) |
153 | 153 |
154 | 154 |
155 class unionmanifest(unionrevlog, manifest.manifestrevlog): | 155 class unionmanifest(unionrevlog, manifest.manifestrevlog): |
156 def __init__(self, opener, opener2, linkmapper): | 156 def __init__(self, nodeconstants, opener, opener2, linkmapper): |
157 manifest.manifestrevlog.__init__(self, opener) | 157 manifest.manifestrevlog.__init__(self, nodeconstants, opener) |
158 manifest2 = manifest.manifestrevlog(opener2) | 158 manifest2 = manifest.manifestrevlog(nodeconstants, opener2) |
159 unionrevlog.__init__( | 159 unionrevlog.__init__( |
160 self, opener, self.indexfile, manifest2, linkmapper | 160 self, opener, self.indexfile, manifest2, linkmapper |
161 ) | 161 ) |
162 | 162 |
163 | 163 |
203 return unionchangelog(self.svfs, self.repo2.svfs) | 203 return unionchangelog(self.svfs, self.repo2.svfs) |
204 | 204 |
205 @localrepo.unfilteredpropertycache | 205 @localrepo.unfilteredpropertycache |
206 def manifestlog(self): | 206 def manifestlog(self): |
207 rootstore = unionmanifest( | 207 rootstore = unionmanifest( |
208 self.svfs, self.repo2.svfs, self.unfiltered()._clrev | 208 self.nodeconstants, |
209 self.svfs, | |
210 self.repo2.svfs, | |
211 self.unfiltered()._clrev, | |
209 ) | 212 ) |
210 return manifest.manifestlog( | 213 return manifest.manifestlog( |
211 self.svfs, self, rootstore, self.narrowmatch() | 214 self.svfs, self, rootstore, self.narrowmatch() |
212 ) | 215 ) |
213 | 216 |