From patchwork Wed Nov 6 03:38:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D7238: repoview: move changelog.__contains__() override to filteredchangelog From: phabricator X-Patchwork-Id: 42783 Message-Id: <306476ab00059ca5da4ae3d6de7d9ef8@localhost.localdomain> To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 6 Nov 2019 03:38:20 +0000 Closed by commit rHG6b437346b33f: repoview: move changelog.__contains__() override to filteredchangelog (authored by martinvonz). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7238?vs=17568&id=17588 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7238/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7238 AFFECTED FILES mercurial/changelog.py mercurial/repoview.py CHANGE DETAILS To: martinvonz, #hg-reviewers, indygreg Cc: mercurial-devel diff --git a/mercurial/repoview.py b/mercurial/repoview.py --- a/mercurial/repoview.py +++ b/mercurial/repoview.py @@ -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 diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -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: