diff tests/testlib/ext-sidedata.py @ 46114: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 f105c49e89cd
children 3d740058b467
line wrap: on
line diff
--- a/tests/testlib/ext-sidedata.py	Sun Dec 13 18:29:22 2020 -0800
+++ b/tests/testlib/ext-sidedata.py	Tue Dec 01 21:54:46 2020 +0100
@@ -10,9 +10,12 @@
 import hashlib
 import struct
 
+from mercurial.node import (
+    nullid,
+    nullrev,
+)
 from mercurial import (
     extensions,
-    node,
     requirements,
     revlog,
 )
@@ -41,7 +44,7 @@
     text = orig(self, nodeorrev, *args, **kwargs)
     if getattr(self, 'sidedatanocheck', False):
         return text
-    if nodeorrev != node.nullrev and nodeorrev != node.nullid:
+    if nodeorrev != nullrev and nodeorrev != nullid:
         sd = self.sidedata(nodeorrev)
         if len(text) != struct.unpack('>I', sd[sidedata.SD_TEST1])[0]:
             raise RuntimeError('text size mismatch')