Mercurial > public > mercurial-scm > hg-stable
diff mercurial/revlog.py @ 43492:ec7ba79bf3db
revlog: move tiprev() from changelog up to revlog
This makes the changelog override simpler and it seems more
consistent.
Differential Revision: https://phab.mercurial-scm.org/D7250
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 05 Nov 2019 14:42:08 -0800 |
parents | 3de4d13f22be |
children | 9f70512ae2cf |
line wrap: on
line diff
--- a/mercurial/revlog.py Tue Nov 05 18:25:13 2019 -0500 +++ b/mercurial/revlog.py Tue Nov 05 14:42:08 2019 -0800 @@ -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)