Mercurial > public > mercurial-scm > hg-stable
diff mercurial/filelog.py @ 52668: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 | ba8f03ad8906 |
children |
line wrap: on
line diff
--- a/mercurial/filelog.py Sun Jan 05 22:12:02 2025 -0500 +++ b/mercurial/filelog.py Sun Jan 05 22:23:31 2025 -0500 @@ -274,11 +274,11 @@ """Filelog variation to be used with narrow stores.""" def __init__(self, opener, path, narrowmatch, try_split=False): - super(narrowfilelog, self).__init__(opener, path, try_split=try_split) + super().__init__(opener, path, try_split=try_split) self._narrowmatch = narrowmatch def renamed(self, node): - res = super(narrowfilelog, self).renamed(node) + res = super().renamed(node) # Renames that come from outside the narrowspec are problematic # because we may lack the base text for the rename. This can result @@ -303,10 +303,10 @@ # Because we have a custom renamed() that may lie, we need to call # the base renamed() to report accurate results. node = self.node(rev) - if super(narrowfilelog, self).renamed(node): + if super().renamed(node): return len(self.read(node)) else: - return super(narrowfilelog, self).size(rev) + return super().size(rev) def cmp(self, node, text): # We don't call `super` because narrow parents can be buggy in case of a