localrepo: also fastpath `nullrev` in __getitem__
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 17 Nov 2019 06:36:50 +0100
changeset 43757 998dd6a8fd98
parent 43756 3082ef682bc2
child 43758 09409a3fc3cc
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
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Sun Nov 17 07:11:06 2019 +0100
+++ b/mercurial/localrepo.py	Sun Nov 17 06:36:50 2019 +0100
@@ -1531,7 +1531,7 @@
             ]
 
         # dealing with some special values
-        if changeid == b'null':
+        if changeid == b'null' or changeid == nullrev:
             return context.changectx(self, nullrev, nullid)
         if changeid == b'tip':
             node = self.changelog.tip()