changeset 5363:9a1c3a6af656 stable

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.
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 06 Jun 2020 19:32:15 +0800
parents 398c7031177a
children 54bf9ec2f81d
files hgext3rd/evolve/obsdiscovery.py
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/obsdiscovery.py	Sun May 24 13:20:45 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