diff tests/drawdag.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 dda2341d6664
children d55b71393907
line wrap: on
line diff
--- a/tests/drawdag.py	Sun Dec 13 18:29:22 2020 -0800
+++ b/tests/drawdag.py	Tue Dec 01 21:54:46 2020 +0100
@@ -86,11 +86,11 @@
 import itertools
 import re
 
+from mercurial.node import nullid
 from mercurial.i18n import _
 from mercurial import (
     context,
     error,
-    node,
     obsolete,
     pycompat,
     registrar,
@@ -299,7 +299,7 @@
         self._added = added
         self._parents = parentctxs
         while len(self._parents) < 2:
-            self._parents.append(repo[node.nullid])
+            self._parents.append(repo[nullid])
 
     def filectx(self, key):
         return simplefilectx(key, self._added[key])
@@ -388,7 +388,7 @@
         content = content.replace(br'\n', b'\n').replace(br'\1', b'\1')
         files[name][path] = content
 
-    committed = {None: node.nullid}  # {name: node}
+    committed = {None: nullid}  # {name: node}
 
     # for leaf nodes, try to find existing nodes in repo
     for name, parents in edges.items():