diff mercurial/obsutil.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 d35063ebd761
line wrap: on
line diff
--- a/mercurial/obsutil.py	Sun Dec 13 18:29:22 2020 -0800
+++ b/mercurial/obsutil.py	Tue Dec 01 21:54:46 2020 +0100
@@ -10,11 +10,14 @@
 import re
 
 from .i18n import _
+from .node import (
+    hex,
+    short,
+)
 from . import (
     diffutil,
     encoding,
     error,
-    node as nodemod,
     phases,
     pycompat,
     util,
@@ -957,13 +960,13 @@
     elif fate == b'diverged':
         return filteredmsgtable[b'diverged'] % changeid
     elif fate == b'superseded':
-        single_successor = nodemod.short(successors[0][0])
+        single_successor = short(successors[0][0])
         return filteredmsgtable[b'superseded'] % (changeid, single_successor)
     elif fate == b'superseded_split':
 
         succs = []
         for node_id in successors[0]:
-            succs.append(nodemod.short(node_id))
+            succs.append(short(node_id))
 
         if len(succs) <= 2:
             fmtsuccs = b', '.join(succs)
@@ -1040,7 +1043,7 @@
                     b'instability': b'content-divergent',
                     b'divergentnodes': divnodes,
                     b'reason': b'predecessor',
-                    b'node': nodemod.hex(dset[b'commonpredecessor']),
+                    b'node': hex(dset[b'commonpredecessor']),
                 }
             )
     return result