locarepo: also fastpath `nullid` lookup in __getitem__
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sat, 23 Nov 2019 16:49:34 -0800
changeset 43783 3fd6ec54704c
parent 43782 f1c49bc79b4d
child 43784 f9068413bd0c
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
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Sat Nov 23 13:59:17 2019 +0100
+++ b/mercurial/localrepo.py	Sat Nov 23 16:49:34 2019 -0800
@@ -1531,7 +1531,7 @@
             ]
 
         # dealing with some special values
-        if changeid == b'null' or changeid == nullrev:
+        if changeid == b'null' or changeid == nullrev or changeid == nullid:
             return context.changectx(self, nullrev, nullid, maybe_filtered=False)
         if changeid == b'tip':
             node = self.changelog.tip()