changelog: use 'tiprev()' in 'tip()'
authorBoris Feld <boris.feld@octobus.net>
Thu, 04 May 2017 02:24:04 +0200
changeset 35672 5a6e0eee7781
parent 35671 8810f0643fa1
child 35673 134ef400cb11
changelog: use 'tiprev()' in 'tip()' Since 'tip()' is just a node version of 'tiprev()' we should reuse the code.
mercurial/changelog.py
--- a/mercurial/changelog.py	Thu May 04 02:23:21 2017 +0200
+++ b/mercurial/changelog.py	Thu May 04 02:24:04 2017 +0200
@@ -302,9 +302,7 @@
 
     def tip(self):
         """filtered version of revlog.tip"""
-        for i in xrange(len(self) -1, -2, -1):
-            if i not in self.filteredrevs:
-                return self.node(i)
+        return self.node(self.tiprev())
 
     def __contains__(self, rev):
         """filtered version of revlog.__contains__"""