diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -406,14 +406,11 @@ self._copiesstorage = opener.options.get(b'copies-storage') def tiprev(self): + """filtered version of revlog.tiprev""" for i in pycompat.xrange(len(self) - 1, -2, -1): if i not in self.filteredrevs: return i - def tip(self): - """filtered version of revlog.tip""" - return self.node(self.tiprev()) - def __contains__(self, rev): """filtered version of revlog.__contains__""" return 0 <= rev < len(self) and rev not in self.filteredrevs diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -593,8 +593,11 @@ with func() as fp: yield fp + def tiprev(self): + return len(self.index) - 1 + def tip(self): - return self.node(len(self.index) - 1) + return self.node(self.tiprev()) def __contains__(self, rev): return 0 <= rev < len(self)