comparison tests/test-ancestor.py @ 28774:21a507f9a6cd

tests: alias ui as uimod in test-ancestor
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Apr 2016 19:48:47 +0900
parents 18e738038d78
children 945f8229b30d
comparison
equal deleted inserted replaced
28773:0023a6e1328f 28774:21a507f9a6cd
11 from mercurial.node import nullrev 11 from mercurial.node import nullrev
12 from mercurial import ( 12 from mercurial import (
13 ancestor, 13 ancestor,
14 commands, 14 commands,
15 hg, 15 hg,
16 ui, 16 ui as uimod,
17 util, 17 util,
18 ) 18 )
19 19
20 def buildgraph(rng, nodes=100, rootprob=0.05, mergeprob=0.2, prevprob=0.7): 20 def buildgraph(rng, nodes=100, rootprob=0.05, mergeprob=0.2, prevprob=0.7):
21 '''nodes: total number of nodes in the graph 21 '''nodes: total number of nodes in the graph
216 dagtests = [ 216 dagtests = [
217 '+2*2*2/*3/2', 217 '+2*2*2/*3/2',
218 '+3*3/*2*2/*4*4/*4/2*4/2*2', 218 '+3*3/*2*2/*4*4/*4/2*4/2*2',
219 ] 219 ]
220 def test_gca(): 220 def test_gca():
221 u = ui.ui() 221 u = uimod.ui()
222 for i, dag in enumerate(dagtests): 222 for i, dag in enumerate(dagtests):
223 repo = hg.repository(u, 'gca%d' % i, create=1) 223 repo = hg.repository(u, 'gca%d' % i, create=1)
224 cl = repo.changelog 224 cl = repo.changelog
225 if not util.safehasattr(cl.index, 'ancestors'): 225 if not util.safehasattr(cl.index, 'ancestors'):
226 # C version not available 226 # C version not available