Mercurial > hg
diff hgext/git/gitlog.py @ 46780: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 | 59fa3890d40a |
children | 048beb0167a7 |
line wrap: on
line diff
--- a/hgext/git/gitlog.py Wed Mar 10 18:09:21 2021 +0100 +++ b/hgext/git/gitlog.py Wed Jan 13 16:14:58 2021 +0100 @@ -8,6 +8,7 @@ nullhex, nullid, nullrev, + sha1nodeconstants, wdirhex, ) from mercurial import ( @@ -422,6 +423,8 @@ class manifestlog(baselog): + nodeconstants = sha1nodeconstants + def __getitem__(self, node): return self.get(b'', node)