diff hgext/remotefilelog/shallowutil.py @ 46113:59fa3890d40a

node: import symbols explicitly There is no point in lazy importing mercurial.node, it is used all over the place anyway. So consistently import the used symbols directly. Fix one file using symbols indirectly via mercurial.revlog. Differential Revision: https://phab.mercurial-scm.org/D9480
author Joerg Sonnenberger <joerg@bec.de>
date Tue, 01 Dec 2020 21:54:46 +0100
parents 2d49482d0dd4
children e972077600e5
line wrap: on
line diff
--- a/hgext/remotefilelog/shallowutil.py	Sun Dec 13 18:29:22 2020 -0800
+++ b/hgext/remotefilelog/shallowutil.py	Tue Dec 01 21:54:46 2020 +0100
@@ -15,9 +15,9 @@
 
 from mercurial.i18n import _
 from mercurial.pycompat import open
+from mercurial.node import hex
 from mercurial import (
     error,
-    node,
     pycompat,
     revlog,
     util,
@@ -39,12 +39,12 @@
 
 
 def getcachekey(reponame, file, id):
-    pathhash = node.hex(hashutil.sha1(file).digest())
+    pathhash = hex(hashutil.sha1(file).digest())
     return os.path.join(reponame, pathhash[:2], pathhash[2:], id)
 
 
 def getlocalkey(file, id):
-    pathhash = node.hex(hashutil.sha1(file).digest())
+    pathhash = hex(hashutil.sha1(file).digest())
     return os.path.join(pathhash, id)