Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.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 | 0a57945aaf7f |
children | a232e6744ba3 |
comparison
equal
deleted
inserted
replaced
38822:7eba8f83129b | 38823:e7aa113b14f7 |
---|---|
848 if isinstance(changeid, context.basectx): | 848 if isinstance(changeid, context.basectx): |
849 return changeid | 849 return changeid |
850 if isinstance(changeid, slice): | 850 if isinstance(changeid, slice): |
851 # wdirrev isn't contiguous so the slice shouldn't include it | 851 # wdirrev isn't contiguous so the slice shouldn't include it |
852 return [context.changectx(self, i) | 852 return [context.changectx(self, i) |
853 for i in xrange(*changeid.indices(len(self))) | 853 for i in pycompat.xrange(*changeid.indices(len(self))) |
854 if i not in self.changelog.filteredrevs] | 854 if i not in self.changelog.filteredrevs] |
855 try: | 855 try: |
856 return context.changectx(self, changeid) | 856 return context.changectx(self, changeid) |
857 except error.WdirUnsupported: | 857 except error.WdirUnsupported: |
858 return context.workingctx(self) | 858 return context.workingctx(self) |
1383 self.store.createmode, | 1383 self.store.createmode, |
1384 validator=validate, | 1384 validator=validate, |
1385 releasefn=releasefn, | 1385 releasefn=releasefn, |
1386 checkambigfiles=_cachedfiles, | 1386 checkambigfiles=_cachedfiles, |
1387 name=desc) | 1387 name=desc) |
1388 tr.changes['revs'] = xrange(0, 0) | 1388 tr.changes['revs'] = pycompat.xrange(0, 0) |
1389 tr.changes['obsmarkers'] = set() | 1389 tr.changes['obsmarkers'] = set() |
1390 tr.changes['phases'] = {} | 1390 tr.changes['phases'] = {} |
1391 tr.changes['bookmarks'] = {} | 1391 tr.changes['bookmarks'] = {} |
1392 | 1392 |
1393 tr.hookargs['txnid'] = txnid | 1393 tr.hookargs['txnid'] = txnid |