Mercurial > public > mercurial-scm > hg
comparison mercurial/changelog.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 | 13815c9decd4 |
children |
comparison
equal
deleted
inserted
replaced
52642:73ab542565e0 | 52643:5cc8deb96b48 |
---|---|
134 | 134 |
135 def __new__(cls, cl, text, sidedata, cpsd): | 135 def __new__(cls, cl, text, sidedata, cpsd): |
136 if not text: | 136 if not text: |
137 return _changelogrevision(extra=_defaultextra, manifest=cl.nullid) | 137 return _changelogrevision(extra=_defaultextra, manifest=cl.nullid) |
138 | 138 |
139 self = super(changelogrevision, cls).__new__(cls) | 139 self = super().__new__(cls) |
140 # We could return here and implement the following as an __init__. | 140 # We could return here and implement the following as an __init__. |
141 # But doing it here is equivalent and saves an extra function call. | 141 # But doing it here is equivalent and saves an extra function call. |
142 | 142 |
143 # format used: | 143 # format used: |
144 # nodeid\n : manifest node in ascii | 144 # nodeid\n : manifest node in ascii |
350 self._filteredrevs = val | 350 self._filteredrevs = val |
351 self._filteredrevs_hashcache = {} | 351 self._filteredrevs_hashcache = {} |
352 | 352 |
353 def _write_docket(self, tr): | 353 def _write_docket(self, tr): |
354 if not self._v2_delayed: | 354 if not self._v2_delayed: |
355 super(changelog, self)._write_docket(tr) | 355 super()._write_docket(tr) |
356 | 356 |
357 def delayupdate(self, tr): | 357 def delayupdate(self, tr): |
358 """delay visibility of index updates to other readers""" | 358 """delay visibility of index updates to other readers""" |
359 assert not self._inner.is_open | 359 assert not self._inner.is_open |
360 assert not self._may_inline | 360 assert not self._may_inline |