comparison mercurial/loggingutil.py @ 49292: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 f4733654f144
comparison
equal deleted inserted replaced
49291:44b26349127b 49292:d44e3c45f0e4
9 9
10 import errno 10 import errno
11 11
12 from . import ( 12 from . import (
13 encoding, 13 encoding,
14 pycompat,
15 ) 14 )
16 15
17 from .utils import ( 16 from .utils import (
18 dateutil, 17 dateutil,
19 procutil, 18 procutil,
52 except OSError: 51 except OSError:
53 pass 52 pass
54 else: 53 else:
55 if st.st_size >= maxsize: 54 if st.st_size >= maxsize:
56 path = vfs.join(name) 55 path = vfs.join(name)
57 for i in pycompat.xrange(maxfiles - 1, 1, -1): 56 for i in range(maxfiles - 1, 1, -1):
58 rotate( 57 rotate(
59 oldpath=b'%s.%d' % (path, i - 1), 58 oldpath=b'%s.%d' % (path, i - 1),
60 newpath=b'%s.%d' % (path, i), 59 newpath=b'%s.%d' % (path, i),
61 ) 60 )
62 rotate(oldpath=path, newpath=maxfiles > 0 and path + b'.1') 61 rotate(oldpath=path, newpath=maxfiles > 0 and path + b'.1')