Patchwork D7480: localrepo: also fastpath `nullrev` in __getitem__

login
register
mail settings
Submitter phabricator
Date Nov. 22, 2019, 9:20 a.m.
Message ID <differential-rev-PHID-DREV-pymmcq5jgyhsfcqwms5b-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43416/
State Superseded
Headers show

Comments

phabricator - Nov. 22, 2019, 9:20 a.m.
marmoute created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  As explained earlier, nullrev will exist in all repository, we do not need any
  special checking.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7480

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -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()