diff hgext/lfs/__init__.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 5ced12cfa41b
line wrap: on
line diff
--- a/hgext/lfs/__init__.py	Sun Dec 13 18:29:22 2020 -0800
+++ b/hgext/lfs/__init__.py	Tue Dec 01 21:54:46 2020 +0100
@@ -125,6 +125,7 @@
 import sys
 
 from mercurial.i18n import _
+from mercurial.node import bin
 
 from mercurial import (
     bundlecaches,
@@ -137,7 +138,6 @@
     filesetlang,
     localrepo,
     minifileset,
-    node,
     pycompat,
     revlog,
     scmutil,
@@ -260,11 +260,10 @@
                 return 0
 
             last = kwargs.get('node_last')
-            _bin = node.bin
             if last:
-                s = repo.set(b'%n:%n', _bin(kwargs['node']), _bin(last))
+                s = repo.set(b'%n:%n', bin(kwargs['node']), bin(last))
             else:
-                s = repo.set(b'%n', _bin(kwargs['node']))
+                s = repo.set(b'%n', bin(kwargs['node']))
             match = repo._storenarrowmatch
             for ctx in s:
                 # TODO: is there a way to just walk the files in the commit?