mercurial/encoding.py
changeset 49284 d44e3c45f0e4
parent 48946 642e31cb55f0
child 50319 95acba2c29f6
equal deleted inserted replaced
49283:44b26349127b 49284:d44e3c45f0e4
   399 
   399 
   400 def getcols(s, start, c):
   400 def getcols(s, start, c):
   401     # type: (bytes, int, int) -> bytes
   401     # type: (bytes, int, int) -> bytes
   402     """Use colwidth to find a c-column substring of s starting at byte
   402     """Use colwidth to find a c-column substring of s starting at byte
   403     index start"""
   403     index start"""
   404     for x in pycompat.xrange(start + c, len(s)):
   404     for x in range(start + c, len(s)):
   405         t = s[start:x]
   405         t = s[start:x]
   406         if colwidth(t) == c:
   406         if colwidth(t) == c:
   407             return t
   407             return t
   408     raise ValueError('substring not found')
   408     raise ValueError('substring not found')
   409 
   409