comparison mercurial/revlogutils/revlogv0.py @ 52643:5cc8deb96b48

pyupgrade: modernize calls to superclass methods This is the `legacy` fixer in `pyupgrade`, with the loop yielding the offset of `yield` statements commented out.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 05 Jan 2025 22:23:31 -0500
parents 609700e5d8df
children 8de68446a5bd
comparison
equal deleted inserted replaced
52642:73ab542565e0 52643:5cc8deb96b48
70 If the node is unknown, return None""" 70 If the node is unknown, return None"""
71 return self._nodemap.get(node) 71 return self._nodemap.get(node)
72 72
73 def append(self, tup): 73 def append(self, tup):
74 self._nodemap[tup[7]] = len(self) 74 self._nodemap[tup[7]] = len(self)
75 super(revlogoldindex, self).append(tup) 75 super().append(tup)
76 76
77 def __delitem__(self, i): 77 def __delitem__(self, i):
78 if not isinstance(i, slice) or not i.stop == -1 or i.step is not None: 78 if not isinstance(i, slice) or not i.stop == -1 or i.step is not None:
79 raise ValueError(b"deleting slices only supports a:-1 with step 1") 79 raise ValueError(b"deleting slices only supports a:-1 with step 1")
80 for r in range(i.start, len(self)): 80 for r in range(i.start, len(self)):
81 del self._nodemap[self[r][7]] 81 del self._nodemap[self[r][7]]
82 super(revlogoldindex, self).__delitem__(i) 82 super().__delitem__(i)
83 83
84 def clearcaches(self): 84 def clearcaches(self):
85 self.__dict__.pop('_nodemap', None) 85 self.__dict__.pop('_nodemap', None)
86 86
87 def __getitem__(self, i): 87 def __getitem__(self, i):