comparison mercurial/localrepo.py @ 43757:998dd6a8fd98

localrepo: also fastpath `nullrev` in __getitem__ As explained earlier, nullrev will exist in all repository, we do not need any special checking. Differential Revision: https://phab.mercurial-scm.org/D7480
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 17 Nov 2019 06:36:50 +0100
parents 657bdb724b47
children 09409a3fc3cc
comparison
equal deleted inserted replaced
43756:3082ef682bc2 43757:998dd6a8fd98
1529 for i in pycompat.xrange(*changeid.indices(len(self))) 1529 for i in pycompat.xrange(*changeid.indices(len(self)))
1530 if i not in self.changelog.filteredrevs 1530 if i not in self.changelog.filteredrevs
1531 ] 1531 ]
1532 1532
1533 # dealing with some special values 1533 # dealing with some special values
1534 if changeid == b'null': 1534 if changeid == b'null' or changeid == nullrev:
1535 return context.changectx(self, nullrev, nullid) 1535 return context.changectx(self, nullrev, nullid)
1536 if changeid == b'tip': 1536 if changeid == b'tip':
1537 node = self.changelog.tip() 1537 node = self.changelog.tip()
1538 rev = self.changelog.rev(node) 1538 rev = self.changelog.rev(node)
1539 return context.changectx(self, rev, node) 1539 return context.changectx(self, rev, node)