# HG changeset patch # User Martin von Zweigbergk # Date 2018-08-19 06:17:06 # Node ID 5517d62c1bcce94f707c3a97f15d1f75aa481a19 # Parent 68b6383a840a527eaf7ebb79437f8950b593549d revlog: fix pure version of _partialmatch() to include nullid Before this patch, test-issue842.t and a few more tests fail when they try to refer to the null revision by using a "000.." prefix of it (or because they use the "shortest" template function which internally does that). This should have been part of my a3dacabd476b (index: don't allow index[len(index)] to mean nullid, 2018-07-20), but I had forgotten to update another part of the pure code there, so it didn't fail until a1f934573c0b (parsers: adjust pure-python version to mimic a3dacabd476b, 2018-08-09) and 65d5de1169dd (revlog: fix pure nodemap to not access missing index entry, 2018-08-17) fixed the other things I had missed. Differential Revision: https://phab.mercurial-scm.org/D4332 diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -27,6 +27,7 @@ import zlib from .node import ( bin, hex, + nullhex, nullid, nullrev, wdirfilenodeids, @@ -1853,6 +1854,8 @@ class revlog(object): 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]