diff hgext/remotefilelog/debugcommands.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 d55b71393907
line wrap: on
line diff
--- a/hgext/remotefilelog/debugcommands.py	Sun Dec 13 18:29:22 2020 -0800
+++ b/hgext/remotefilelog/debugcommands.py	Tue Dec 01 21:54:46 2020 +0100
@@ -9,14 +9,18 @@
 import os
 import zlib
 
-from mercurial.node import bin, hex, nullid, short
+from mercurial.node import (
+    bin,
+    hex,
+    nullid,
+    short,
+)
 from mercurial.i18n import _
 from mercurial.pycompat import open
 from mercurial import (
     error,
     filelog,
     lock as lockmod,
-    node as nodemod,
     pycompat,
     revlog,
 )
@@ -61,7 +65,7 @@
 
 def buildtemprevlog(repo, file):
     # get filename key
-    filekey = nodemod.hex(hashutil.sha1(file).digest())
+    filekey = hex(hashutil.sha1(file).digest())
     filedir = os.path.join(repo.path, b'store/data', filekey)
 
     # sort all entries based on linkrev
@@ -421,7 +425,7 @@
             % (
                 hashformatter(node),
                 hashformatter(deltabasenode),
-                nodemod.hex(hashutil.sha1(delta).digest()),
+                hex(hashutil.sha1(delta).digest()),
                 len(delta),
             )
         )