changeset 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 3082ef682bc2
children 09409a3fc3cc
files mercurial/localrepo.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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()