# HG changeset patch # User Anton Shestakov # Date 1591443135 -28800 # Node ID f06c76832c81f3d0e2f3d390b07bbbae123f05b1 # Parent e9d187e87678a6a1039034f5dc450e3a82f16390 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. diff -r e9d187e87678 -r f06c76832c81 hgext3rd/evolve/obsdiscovery.py --- a/hgext3rd/evolve/obsdiscovery.py Sun May 31 14:09:17 2020 +0800 +++ b/hgext3rd/evolve/obsdiscovery.py Sat Jun 06 19:32:15 2020 +0800 @@ -28,7 +28,7 @@ exchange, extensions, localrepo, - node, + node as nodemod, obsolete, scmutil, store, @@ -195,7 +195,7 @@ 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 @@ 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 @@ 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 @@ # 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 @@ 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 @@ 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 @@ 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