diff -r 68b6383a840a -r 5517d62c1bcc mercurial/revlog.py --- a/mercurial/revlog.py Sat Aug 18 15:15:04 2018 -0400 +++ b/mercurial/revlog.py Sat Aug 18 23:17:06 2018 -0700 @@ -27,6 +27,7 @@ from .node import ( bin, hex, + nullhex, nullid, nullrev, wdirfilenodeids, @@ -1853,6 +1854,8 @@ nl = [e[7] for e in self.index if e[7].startswith(prefix)] nl = [n for n in nl if hex(n).startswith(id) and self.hasnode(n)] + if nullhex.startswith(id): + nl.append(nullid) if len(nl) > 0: if len(nl) == 1 and not maybewdir: self._pcache[id] = nl[0]