From patchwork Sun May 17 17:41:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D8541: git: avoid looking-up parents for the null commit From: phabricator X-Patchwork-Id: 46329 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Sun, 17 May 2020 17:41:45 +0000 rom1dep created this revision. Herald added a reviewer: durin42. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D8541 AFFECTED FILES hgext/git/gitlog.py CHANGE DETAILS To: rom1dep, durin42, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/hgext/git/gitlog.py b/hgext/git/gitlog.py --- a/hgext/git/gitlog.py +++ b/hgext/git/gitlog.py @@ -324,7 +324,10 @@ def parentrevs(self, rev): n = self.node(rev) hn = gitutil.togitnode(n) - c = self.gitrepo[hn] + if hn != gitutil.nullgit: + c = self.gitrepo[hn] + else: + return nodemod.nullrev, nodemod.nullrev p1 = p2 = nodemod.nullrev if c.parents: p1 = self.rev(c.parents[0].id.raw)