diff mercurial/util.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 89a2afe31e82
children ebc6d3484fdd 7711853110b9
line wrap: on
line diff
--- a/mercurial/util.py	Sun Dec 13 18:29:22 2020 -0800
+++ b/mercurial/util.py	Tue Dec 01 21:54:46 2020 +0100
@@ -42,12 +42,12 @@
     open,
     setattr,
 )
+from .node import hex
 from hgdemandimport import tracing
 from . import (
     encoding,
     error,
     i18n,
-    node as nodemod,
     policy,
     pycompat,
     urllibcompat,
@@ -254,7 +254,7 @@
     def __getitem__(self, key):
         if key not in DIGESTS:
             raise error.Abort(_(b'unknown digest type: %s') % k)
-        return nodemod.hex(self._hashes[key].digest())
+        return hex(self._hashes[key].digest())
 
     def __iter__(self):
         return iter(self._hashes)