Mercurial > public > mercurial-scm > hg
diff mercurial/graphmod.py @ 38783:e7aa113b14f7
global: use pycompat.xrange()
On Python 3, our module importer automatically rewrites xrange()
to pycompat.xrange().
We want to move away from the custom importer on Python 3.
This commit converts all instances of xrange() to use
pycompat.xrange().
Differential Revision: https://phab.mercurial-scm.org/D4032
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 01 Aug 2018 13:00:45 -0700 |
parents | 24e517600b29 |
children | 3c4b2e880273 |
line wrap: on
line diff
--- a/mercurial/graphmod.py Wed Aug 01 12:57:15 2018 -0700 +++ b/mercurial/graphmod.py Wed Aug 01 13:00:45 2018 -0700 @@ -22,6 +22,7 @@ from .node import nullrev from . import ( dagop, + pycompat, smartset, util, ) @@ -426,16 +427,16 @@ # shift_interline is the line containing the non-vertical # edges between this entry and the next shift_interline = echars[:idx * 2] - for i in xrange(2 + coldiff): + for i in pycompat.xrange(2 + coldiff): shift_interline.append(' ') count = ncols - idx - 1 if coldiff == -1: - for i in xrange(count): + for i in pycompat.xrange(count): shift_interline.extend(['/', ' ']) elif coldiff == 0: shift_interline.extend(echars[(idx + 1) * 2:ncols * 2]) else: - for i in xrange(count): + for i in pycompat.xrange(count): shift_interline.extend(['\\', ' ']) # draw edges from the current node to its parents