[PATCH 3 of 9] py3: alias long to int and xrange to range in test-ancestor.py on Python 3

Pulkit Goyal 7895pulkit at gmail.com
Thu Jun 15 17:34:45 EDT 2017


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1497556471 -19800
#      Fri Jun 16 01:24:31 2017 +0530
# Node ID b48856aec0e1eaf2b2f18e7b1b2aec2ae051d097
# Parent  8a4aa371b00bd7a7533459ee6ac8a3a07f0fa98e
py3: alias long to int and xrange to range in test-ancestor.py on Python 3

diff --git a/tests/test-ancestor.py b/tests/test-ancestor.py
--- a/tests/test-ancestor.py
+++ b/tests/test-ancestor.py
@@ -13,10 +13,15 @@
     ancestor,
     debugcommands,
     hg,
+    pycompat,
     ui as uimod,
     util,
 )
 
+if pycompat.ispy3:
+    long = int
+    xrange = range
+
 def buildgraph(rng, nodes=100, rootprob=0.05, mergeprob=0.2, prevprob=0.7):
     '''nodes: total number of nodes in the graph
     rootprob: probability that a new node (not 0) will be a root


More information about the Mercurial-devel mailing list