Mercurial > public > mercurial-scm > hg
comparison mercurial/bundle2.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 | f016eac2a466 |
children | b10d145837bc |
comparison
equal
deleted
inserted
replaced
38782:7eba8f83129b | 38783:e7aa113b14f7 |
---|---|
2221 while rawheader: | 2221 while rawheader: |
2222 header = rbcstruct.unpack(rawheader) | 2222 header = rbcstruct.unpack(rawheader) |
2223 total += header[1] + header[2] | 2223 total += header[1] + header[2] |
2224 utf8branch = inpart.read(header[0]) | 2224 utf8branch = inpart.read(header[0]) |
2225 branch = encoding.tolocal(utf8branch) | 2225 branch = encoding.tolocal(utf8branch) |
2226 for x in xrange(header[1]): | 2226 for x in pycompat.xrange(header[1]): |
2227 node = inpart.read(20) | 2227 node = inpart.read(20) |
2228 rev = cl.rev(node) | 2228 rev = cl.rev(node) |
2229 cache.setdata(branch, rev, node, False) | 2229 cache.setdata(branch, rev, node, False) |
2230 for x in xrange(header[2]): | 2230 for x in pycompat.xrange(header[2]): |
2231 node = inpart.read(20) | 2231 node = inpart.read(20) |
2232 rev = cl.rev(node) | 2232 rev = cl.rev(node) |
2233 cache.setdata(branch, rev, node, True) | 2233 cache.setdata(branch, rev, node, True) |
2234 rawheader = inpart.read(rbcstruct.size) | 2234 rawheader = inpart.read(rbcstruct.size) |
2235 cache.write() | 2235 cache.write() |