diff -r 96cb63a86ee5 -r 6454c117c6a4 mercurial/changelog.py --- a/mercurial/changelog.py Thu Jun 13 09:52:39 2024 +0200 +++ b/mercurial/changelog.py Mon Jun 24 12:05:31 2024 +0200 @@ -327,6 +327,9 @@ self._filteredrevs_hashcache = {} self._copiesstorage = opener.options.get(b'copies-storage') + def __contains__(self, rev): + return (0 <= rev < len(self)) and rev not in self._filteredrevs + @property def filteredrevs(self): return self._filteredrevs