Mercurial > hg
comparison mercurial/localrepo.py @ 43763:3fd6ec54704c
locarepo: also fastpath `nullid` lookup in __getitem__
We already use that fastpath for `"null"` and `nullrev`, using it for `nullid`
is similar.
Differential Revision: https://phab.mercurial-scm.org/D7486
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 23 Nov 2019 16:49:34 -0800 |
parents | b38cd2e6e12d |
children | e89e3275f658 |
comparison
equal
deleted
inserted
replaced
43762:f1c49bc79b4d | 43763:3fd6ec54704c |
---|---|
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' or changeid == nullrev: | 1534 if changeid == b'null' or changeid == nullrev or changeid == nullid: |
1535 return context.changectx(self, nullrev, nullid, maybe_filtered=False) | 1535 return context.changectx(self, nullrev, nullid, maybe_filtered=False) |
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) |