comparison mercurial/filelog.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 45f0d5297698
children d4ba4d51f85f
comparison
equal deleted inserted replaced
46792:49fd21f32695 46793:6266d19556ad
31 ) 31 )
32 # Full name of the user visible file, relative to the repository root. 32 # Full name of the user visible file, relative to the repository root.
33 # Used by LFS. 33 # Used by LFS.
34 self._revlog.filename = path 34 self._revlog.filename = path
35 self._revlog.revlog_kind = b'filelog' 35 self._revlog.revlog_kind = b'filelog'
36 self.nullid = self._revlog.nullid
36 37
37 def __len__(self): 38 def __len__(self):
38 return len(self._revlog) 39 return len(self._revlog)
39 40
40 def __iter__(self): 41 def __iter__(self):