comparison hgext/win32text.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 f0b6fbea00cf
children 2372284d9457
comparison
equal deleted inserted replaced
38782:7eba8f83129b 38783:e7aa113b14f7
47 from mercurial.i18n import _ 47 from mercurial.i18n import _
48 from mercurial.node import ( 48 from mercurial.node import (
49 short, 49 short,
50 ) 50 )
51 from mercurial import ( 51 from mercurial import (
52 pycompat,
52 registrar, 53 registrar,
53 ) 54 )
54 from mercurial.utils import ( 55 from mercurial.utils import (
55 stringutil, 56 stringutil,
56 ) 57 )
139 # oldest, so that if we see a file multiple times, we take the 140 # oldest, so that if we see a file multiple times, we take the
140 # newest version as canonical. this prevents us from blocking a 141 # newest version as canonical. this prevents us from blocking a
141 # changegroup that contains an unacceptable commit followed later 142 # changegroup that contains an unacceptable commit followed later
142 # by a commit that fixes the problem. 143 # by a commit that fixes the problem.
143 tip = repo['tip'] 144 tip = repo['tip']
144 for rev in xrange(repo.changelog.tiprev(), repo[node].rev() - 1, -1): 145 for rev in pycompat.xrange(repo.changelog.tiprev(),
146 repo[node].rev() - 1, -1):
145 c = repo[rev] 147 c = repo[rev]
146 for f in c.files(): 148 for f in c.files():
147 if f in seen or f not in tip or f not in c: 149 if f in seen or f not in tip or f not in c:
148 continue 150 continue
149 seen.add(f) 151 seen.add(f)