diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -28,6 +28,7 @@ bin, hex, nullid, + nullhex, nullrev, wdirfilenodeids, wdirhex, @@ -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]