comparison mercurial/upgrade_utils/engine.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 67b5fafd3a46
children e2f7b2695ba1
comparison
equal deleted inserted replaced
46792:49fd21f32695 46793:6266d19556ad
34 """ 34 """
35 if path == b'00changelog.i': 35 if path == b'00changelog.i':
36 return changelog.changelog(repo.svfs) 36 return changelog.changelog(repo.svfs)
37 elif path.endswith(b'00manifest.i'): 37 elif path.endswith(b'00manifest.i'):
38 mandir = path[: -len(b'00manifest.i')] 38 mandir = path[: -len(b'00manifest.i')]
39 return manifest.manifestrevlog(repo.svfs, tree=mandir) 39 return manifest.manifestrevlog(
40 repo.nodeconstants, repo.svfs, tree=mandir
41 )
40 else: 42 else:
41 # reverse of "/".join(("data", path + ".i")) 43 # reverse of "/".join(("data", path + ".i"))
42 return filelog.filelog(repo.svfs, path[5:-2]) 44 return filelog.filelog(repo.svfs, path[5:-2])
43 45
44 46