Mercurial > hg
changeset 43444:c470e699cd00
repoview: move changelog.__contains__() override to filteredchangelog
Differential Revision: https://phab.mercurial-scm.org/D7238
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 05 Nov 2019 14:11:30 -0800 |
parents | 7bc8e49a7c35 |
children | c093fb81404f |
files | mercurial/changelog.py mercurial/repoview.py |
diffstat | 2 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/changelog.py Tue Nov 05 14:07:08 2019 -0800 +++ b/mercurial/changelog.py Tue Nov 05 14:11:30 2019 -0800 @@ -405,10 +405,6 @@ self.filteredrevs = frozenset() self._copiesstorage = opener.options.get(b'copies-storage') - def __contains__(self, rev): - """filtered version of revlog.__contains__""" - return 0 <= rev < len(self) and rev not in self.filteredrevs - def __iter__(self): """filtered version of revlog.__iter__""" if len(self.filteredrevs) == 0:
--- a/mercurial/repoview.py Tue Nov 05 14:07:08 2019 -0800 +++ b/mercurial/repoview.py Tue Nov 05 14:11:30 2019 -0800 @@ -229,6 +229,10 @@ if i not in self.filteredrevs: return i + def __contains__(self, rev): + """filtered version of revlog.__contains__""" + return 0 <= rev < len(self) and rev not in self.filteredrevs + cl.__class__ = filteredchangelog return cl