comparison 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
comparison
equal deleted inserted replaced
35671:8810f0643fa1 35672:5a6e0eee7781
300 if i not in self.filteredrevs: 300 if i not in self.filteredrevs:
301 return i 301 return i
302 302
303 def tip(self): 303 def tip(self):
304 """filtered version of revlog.tip""" 304 """filtered version of revlog.tip"""
305 for i in xrange(len(self) -1, -2, -1): 305 return self.node(self.tiprev())
306 if i not in self.filteredrevs:
307 return self.node(i)
308 306
309 def __contains__(self, rev): 307 def __contains__(self, rev):
310 """filtered version of revlog.__contains__""" 308 """filtered version of revlog.__contains__"""
311 return (0 <= rev < len(self) 309 return (0 <= rev < len(self)
312 and rev not in self.filteredrevs) 310 and rev not in self.filteredrevs)