comparison mercurial/context.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 e971d6eb4770
children e411774a2e0f
comparison
equal deleted inserted replaced
38822:7eba8f83129b 38823:e7aa113b14f7
1894 self.p1().rev())) 1894 self.p1().rev()))
1895 1895
1896 # Test that each new directory to be created to write this path from p2 1896 # Test that each new directory to be created to write this path from p2
1897 # is not a file in p1. 1897 # is not a file in p1.
1898 components = path.split('/') 1898 components = path.split('/')
1899 for i in xrange(len(components)): 1899 for i in pycompat.xrange(len(components)):
1900 component = "/".join(components[0:i]) 1900 component = "/".join(components[0:i])
1901 if component in self.p1(): 1901 if component in self.p1():
1902 fail(path, component) 1902 fail(path, component)
1903 1903
1904 # Test the other direction -- that this path from p2 isn't a directory 1904 # Test the other direction -- that this path from p2 isn't a directory