comparison mercurial/wireprotov2server.py @ 47012:d55b71393907

node: replace nullid and friends with nodeconstants class The introduction of 256bit hashes require changes to nullid and other constant magic values. Start pushing them down from repository and revlog where sensible. Differential Revision: https://phab.mercurial-scm.org/D9465
author Joerg Sonnenberger <joerg@bec.de>
date Mon, 29 Mar 2021 01:52:06 +0200
parents 6085b7f1536d
children 2174f54aab18
comparison
equal deleted inserted replaced
46992:5fa019ceb499 47012:d55b71393907
8 8
9 import collections 9 import collections
10 import contextlib 10 import contextlib
11 11
12 from .i18n import _ 12 from .i18n import _
13 from .node import ( 13 from .node import hex
14 hex,
15 nullid,
16 )
17 from . import ( 14 from . import (
18 discovery, 15 discovery,
19 encoding, 16 encoding,
20 error, 17 error,
21 match as matchmod, 18 match as matchmod,
948 ) 945 )
949 946
950 if spec[b'roots']: 947 if spec[b'roots']:
951 common = [n for n in spec[b'roots'] if clhasnode(n)] 948 common = [n for n in spec[b'roots'] if clhasnode(n)]
952 else: 949 else:
953 common = [nullid] 950 common = [repo.nullid]
954 951
955 for n in discovery.outgoing(repo, common, spec[b'heads']).missing: 952 for n in discovery.outgoing(repo, common, spec[b'heads']).missing:
956 if n not in seen: 953 if n not in seen:
957 nodes.append(n) 954 nodes.append(n)
958 seen.add(n) 955 seen.add(n)