diff contrib/undumprevlog @ 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 c102b704edb5
children 4c041c71ec01
line wrap: on
line diff
--- a/contrib/undumprevlog	Sun Dec 13 18:29:22 2020 -0800
+++ b/contrib/undumprevlog	Tue Dec 01 21:54:46 2020 +0100
@@ -6,9 +6,9 @@
 from __future__ import absolute_import, print_function
 
 import sys
+from mercurial.node import bin
 from mercurial import (
     encoding,
-    node,
     revlog,
     transaction,
     vfs as vfsmod,
@@ -31,13 +31,13 @@
         r = revlog.revlog(opener, f)
         procutil.stdout.write(b'%s\n' % f)
     elif l.startswith("node:"):
-        n = node.bin(l[6:-1])
+        n = bin(l[6:-1])
     elif l.startswith("linkrev:"):
         lr = int(l[9:-1])
     elif l.startswith("parents:"):
         p = l[9:-1].split()
-        p1 = node.bin(p[0])
-        p2 = node.bin(p[1])
+        p1 = bin(p[0])
+        p2 = bin(p[1])
     elif l.startswith("length:"):
         length = int(l[8:-1])
         sys.stdin.readline()  # start marker