[Updated] D8541: git: avoid looking-up parents for the null commit

rom1dep (Romain DEP.) phabricator at mercurial-scm.org
Mon May 18 01:27:26 UTC 2020


Closed by commit rHG8bfc6cc8e480: git: avoid looking-up parents for the null commit (authored by rom1dep).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8541?vs=21405&id=21412

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8541/new/

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

AFFECTED FILES
  hgext/git/gitlog.py

CHANGE DETAILS

diff --git a/hgext/git/gitlog.py b/hgext/git/gitlog.py
--- a/hgext/git/gitlog.py
+++ b/hgext/git/gitlog.py
@@ -270,7 +270,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)



To: rom1dep, durin42, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200518/ac712411/attachment-0002.html>


More information about the Mercurial-patches mailing list