comparison hgext/git/gitlog.py @ 49284:d44e3c45f0e4

py3: replace `pycompat.xrange` by `range`
author Manuel Jacob <me@manueljacob.de>
date Sun, 29 May 2022 15:17:27 +0200
parents 642e31cb55f0
children ef5f5f1cbd90
comparison
equal deleted inserted replaced
49283:44b26349127b 49284:d44e3c45f0e4
110 return True 110 return True
111 except error.LookupError: 111 except error.LookupError:
112 return False 112 return False
113 113
114 def __iter__(self): 114 def __iter__(self):
115 return iter(pycompat.xrange(len(self))) 115 return iter(range(len(self)))
116 116
117 @property 117 @property
118 def filteredrevs(self): 118 def filteredrevs(self):
119 # TODO: we should probably add a refs/hg/ namespace for hidden 119 # TODO: we should probably add a refs/hg/ namespace for hidden
120 # heads etc, but that's an idea for later. 120 # heads etc, but that's an idea for later.
184 def flags(self, rev): 184 def flags(self, rev):
185 return 0 185 return 0
186 186
187 def shortest(self, node, minlength=1): 187 def shortest(self, node, minlength=1):
188 nodehex = hex(node) 188 nodehex = hex(node)
189 for attempt in pycompat.xrange(minlength, len(nodehex) + 1): 189 for attempt in range(minlength, len(nodehex) + 1):
190 candidate = nodehex[:attempt] 190 candidate = nodehex[:attempt]
191 matches = int( 191 matches = int(
192 self._db.execute( 192 self._db.execute(
193 'SELECT COUNT(*) FROM changelog WHERE node LIKE ?', 193 'SELECT COUNT(*) FROM changelog WHERE node LIKE ?',
194 (pycompat.sysstr(candidate + b'%'),), 194 (pycompat.sysstr(candidate + b'%'),),