Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 38823: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 | 5faaa31a6082 |
children | 08b2ae9fc030 |
comparison
equal
deleted
inserted
replaced
38822:7eba8f83129b | 38823:e7aa113b14f7 |
---|---|
213 lower = encoding.lower | 213 lower = encoding.lower |
214 qw = lower(query).split() | 214 qw = lower(query).split() |
215 | 215 |
216 def revgen(): | 216 def revgen(): |
217 cl = web.repo.changelog | 217 cl = web.repo.changelog |
218 for i in xrange(len(web.repo) - 1, 0, -100): | 218 for i in pycompat.xrange(len(web.repo) - 1, 0, -100): |
219 l = [] | 219 l = [] |
220 for j in cl.revs(max(0, i - 99), i): | 220 for j in cl.revs(max(0, i - 99), i): |
221 ctx = web.repo[j] | 221 ctx = web.repo[j] |
222 l.append(ctx) | 222 l.append(ctx) |
223 l.reverse() | 223 l.reverse() |