comparison tests/test-rust-ancestor.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 8a8305f557d0
children 6000f5b25c9b
comparison
equal deleted inserted replaced
46112:d6afa9c149c3 46113:59fa3890d40a
1 from __future__ import absolute_import 1 from __future__ import absolute_import
2 import sys 2 import sys
3 import unittest 3 import unittest
4 4
5 from mercurial import ( 5 from mercurial.node import wdirrev
6 error, 6 from mercurial import error
7 node,
8 )
9 7
10 from mercurial.testing import revlog as revlogtesting 8 from mercurial.testing import revlog as revlogtesting
11 9
12 try: 10 try:
13 from mercurial import rustext 11 from mercurial import rustext
148 def testwdirunsupported(self): 146 def testwdirunsupported(self):
149 # trying to access ancestors of the working directory raises 147 # trying to access ancestors of the working directory raises
150 # WdirUnsupported directly 148 # WdirUnsupported directly
151 idx = self.parseindex() 149 idx = self.parseindex()
152 with self.assertRaises(error.WdirUnsupported): 150 with self.assertRaises(error.WdirUnsupported):
153 list(AncestorsIterator(idx, [node.wdirrev], -1, False)) 151 list(AncestorsIterator(idx, [wdirrev], -1, False))
154 152
155 def testheadrevs(self): 153 def testheadrevs(self):
156 idx = self.parseindex() 154 idx = self.parseindex()
157 self.assertEqual(dagop.headrevs(idx, [1, 2, 3]), {3}) 155 self.assertEqual(dagop.headrevs(idx, [1, 2, 3]), {3})
158 156