comparison mercurial/linelog.py @ 48946:642e31cb55f0

py3: use class X: instead of class X(object): The inheritance from object is implied in Python 3. So this should be equivalent. This change was generated via an automated search and replace. So there may have been some accidental changes. Differential Revision: https://phab.mercurial-scm.org/D12352
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 21 Feb 2022 13:08:28 -0700
parents 6000f5b25c9b
children d44e3c45f0e4
comparison
equal deleted inserted replaced
48945:55d132525155 48946:642e31cb55f0
31 class LineLogError(Exception): 31 class LineLogError(Exception):
32 """Error raised when something bad happens internally in linelog.""" 32 """Error raised when something bad happens internally in linelog."""
33 33
34 34
35 @attr.s 35 @attr.s
36 class lineinfo(object): 36 class lineinfo:
37 # Introducing revision of this line. 37 # Introducing revision of this line.
38 rev = attr.ib() 38 rev = attr.ib()
39 # Line number for this line in its introducing revision. 39 # Line number for this line in its introducing revision.
40 linenum = attr.ib() 40 linenum = attr.ib()
41 # Private. Offset in the linelog program of this line. Used internally. 41 # Private. Offset in the linelog program of this line. Used internally.
42 _offset = attr.ib() 42 _offset = attr.ib()
43 43
44 44
45 @attr.s 45 @attr.s
46 class annotateresult(object): 46 class annotateresult:
47 rev = attr.ib() 47 rev = attr.ib()
48 lines = attr.ib() 48 lines = attr.ib()
49 _eof = attr.ib() 49 _eof = attr.ib()
50 50
51 def __iter__(self): 51 def __iter__(self):
52 return iter(self.lines) 52 return iter(self.lines)
53 53
54 54
55 class _llinstruction(object): # pytype: disable=ignored-metaclass 55 class _llinstruction: # pytype: disable=ignored-metaclass
56 56
57 __metaclass__ = abc.ABCMeta 57 __metaclass__ = abc.ABCMeta
58 58
59 @abc.abstractmethod 59 @abc.abstractmethod
60 def __init__(self, op1, op2): 60 def __init__(self, op1, op2):
231 elif opcode == 2: 231 elif opcode == 2:
232 return _line(op1, op2) 232 return _line(op1, op2)
233 raise NotImplementedError(b'Unimplemented opcode %r' % opcode) 233 raise NotImplementedError(b'Unimplemented opcode %r' % opcode)
234 234
235 235
236 class linelog(object): 236 class linelog:
237 """Efficient cache for per-line history information.""" 237 """Efficient cache for per-line history information."""
238 238
239 def __init__(self, program=None, maxrev=0): 239 def __init__(self, program=None, maxrev=0):
240 if program is None: 240 if program is None:
241 # We pad the program with an extra leading EOF so that our 241 # We pad the program with an extra leading EOF so that our