comparison tests/test-ancestor.py @ 32861:20d70df64e93

py3: alias long to int and xrange to range in test-ancestor.py on Python 3
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 16 Jun 2017 01:24:31 +0530
parents bd872f64a8ba
children a8dfa35a4130
comparison
equal deleted inserted replaced
32860:f22f39d56bb5 32861:20d70df64e93
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 debugcommands, 14 debugcommands,
15 hg, 15 hg,
16 pycompat,
16 ui as uimod, 17 ui as uimod,
17 util, 18 util,
18 ) 19 )
20
21 if pycompat.ispy3:
22 long = int
23 xrange = range
19 24
20 def buildgraph(rng, nodes=100, rootprob=0.05, mergeprob=0.2, prevprob=0.7): 25 def buildgraph(rng, nodes=100, rootprob=0.05, mergeprob=0.2, prevprob=0.7):
21 '''nodes: total number of nodes in the graph 26 '''nodes: total number of nodes in the graph
22 rootprob: probability that a new node (not 0) will be a root 27 rootprob: probability that a new node (not 0) will be a root
23 mergeprob: probability that, excluding a root a node will be a merge 28 mergeprob: probability that, excluding a root a node will be a merge