Mercurial > public > mercurial-scm > hg
comparison hgext/git/gitlog.py @ 44844:8bfc6cc8e480
git: avoid looking-up parents for the null commit
Differential Revision: https://phab.mercurial-scm.org/D8541
author | Romain DEP. <rom1dep@gmail.com> |
---|---|
date | Mon, 11 May 2020 21:56:11 +0200 |
parents | ec54b3d2af0b |
children | 3e09d22a0bf5 |
comparison
equal
deleted
inserted
replaced
44843:288328c6711b | 44844:8bfc6cc8e480 |
---|---|
268 return bool(self.reachableroots(a, [b], [a], includepath=False)) | 268 return bool(self.reachableroots(a, [b], [a], includepath=False)) |
269 | 269 |
270 def parentrevs(self, rev): | 270 def parentrevs(self, rev): |
271 n = self.node(rev) | 271 n = self.node(rev) |
272 hn = gitutil.togitnode(n) | 272 hn = gitutil.togitnode(n) |
273 c = self.gitrepo[hn] | 273 if hn != gitutil.nullgit: |
274 c = self.gitrepo[hn] | |
275 else: | |
276 return nodemod.nullrev, nodemod.nullrev | |
274 p1 = p2 = nodemod.nullrev | 277 p1 = p2 = nodemod.nullrev |
275 if c.parents: | 278 if c.parents: |
276 p1 = self.rev(c.parents[0].id.raw) | 279 p1 = self.rev(c.parents[0].id.raw) |
277 if len(c.parents) > 2: | 280 if len(c.parents) > 2: |
278 raise error.Abort(b'TODO octopus merge handling') | 281 raise error.Abort(b'TODO octopus merge handling') |