Commit b08d1069 authored by Anton Shestakov's avatar Anton Shestakov
Browse files

obsdiscovery: import node as nodemod to free up the name

Let's be nice to people who want to use `node` as a variable name in the code
in this module.
parent e9d187e87678
......@@ -28,7 +28,7 @@ from mercurial import (
exchange,
extensions,
localrepo,
node,
node as nodemod,
obsolete,
scmutil,
store,
......@@ -195,7 +195,7 @@ def _queryrange(ui, repo, remote, allentries):
def debugobshashrange(ui, repo, **opts):
"""display the ::REVS set topologically sorted in a stable way
"""
s = node.short
s = nodemod.short
revs = scmutil.revrange(repo, opts['rev'])
# prewarm depth cache
if revs:
......@@ -218,7 +218,7 @@ def debugobshashrange(ui, repo, **opts):
r[1],
rangelength(repo, r),
depthrev(repo, r[0]),
node.short(_obshashrange(repo, r)))
s(_obshashrange(repo, r)))
ui.status(linetemplate % d)
repo.obsstore.rangeobshashcache.save(repo)
......@@ -230,7 +230,7 @@ def _obshashrange(repo, rangeid):
if obshash is not None:
return obshash
pieces = []
nullid = node.nullid
nullid = nodemod.nullid
if repo.stablerange.rangelength(repo, rangeid) == 1:
rangenode = cl.node(rangeid[0])
tmarkers = repo.obsstore.relevantmarkers([rangenode])
......@@ -249,7 +249,7 @@ def _obshashrange(repo, rangeid):
# note: if there is only one subrange with actual data, we'll just
# reuse the same hash.
if not pieces:
obshash = node.nullid
obshash = nodemod.nullid
elif len(pieces) != 1 or obshash is None:
sha = hashlib.sha1()
for p in pieces:
......@@ -669,7 +669,7 @@ def _obshashrange_v0(repo, ranges):
repo.obsstore.rangeobshashcache.update(repo)
for r in ranges:
if r[0] is None:
result.append(node.wdirid)
result.append(nodemod.wdirid)
else:
result.append(_obshashrange(repo, r))
repo.obsstore.rangeobshashcache.save(repo)
......@@ -843,13 +843,13 @@ def buildpullobsmarkersboundaries(pullop, bundle2=True):
revs = unfi.revs(b'::(%ln - null) - %ld', pullop.common, filteredrevs)
boundaries = {b'heads': pullop.pulledsubset}
if not revs: # nothing common
boundaries[b'common'] = [node.nullid]
boundaries[b'common'] = [nodemod.nullid]
return boundaries
if not usediscovery(repo):
# discovery disabled by users.
repo.ui.status(obsdiscovery_skip_message)
boundaries[b'common'] = [node.nullid]
boundaries[b'common'] = [nodemod.nullid]
return boundaries
if bundle2 and _canobshashrange(repo, remote):
......@@ -864,7 +864,7 @@ def buildpullobsmarkersboundaries(pullop, bundle2=True):
common = repo.set("heads(only(%ld, %ln))", revs, missing)
boundaries[b'common'] = [c.node() for c in common]
else:
boundaries[b'common'] = [node.nullid]
boundaries[b'common'] = [nodemod.nullid]
return boundaries
# merge later for outer layer wrapping
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment