diff mercurial/changelog.py @ 35672:5a6e0eee7781

changelog: use 'tiprev()' in 'tip()' Since 'tip()' is just a node version of 'tiprev()' we should reuse the code.
author Boris Feld <boris.feld@octobus.net>
date Thu, 04 May 2017 02:24:04 +0200
parents 8810f0643fa1
children fa15a70f88de
line wrap: on
line diff
--- 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__"""