[PATCH 3 of 5 "] hgtagsfnodescache: handle nullid lookup
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Mon Mar 11 05:24:02 EDT 2019
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1552262978 -3600
# Mon Mar 11 01:09:38 2019 +0100
# Node ID 85680409790f231f5865d76dab00efc0ccd42901
# Parent d3b70c96c0fec26e452925592a5e916e943a7abd
# EXP-Topic fnodecache
# Available At https://bitbucket.org/octobus/mercurial-devel/
# hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 85680409790f
hgtagsfnodescache: handle nullid lookup
The null revision is empty, so it `.hgtags` content is `nullid` in regards with
the `hgtagsfnodescache`. Dealing with `nullid` will help with the next
changeset. Before this change, feeding `nullid` to `hgtagsfnodescache.getfnode` would
return a wrong result (fnode for tip).
diff --git a/mercurial/tags.py b/mercurial/tags.py
--- a/mercurial/tags.py
+++ b/mercurial/tags.py
@@ -691,6 +691,9 @@ class hgtagsfnodescache(object):
If an .hgtags does not exist at the specified revision, nullid is
returned.
"""
+ if node == nullid:
+ return nullid
+
ctx = self._repo[node]
rev = ctx.rev()
More information about the Mercurial-devel
mailing list