[PATCH 1 of 3] hgtagsfnodescache: handle nullid lookup

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu May 2 12:24:01 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 a753bc019c1ad7c5661a050adce49e4c3cd5a786
# Parent  bed4c308fc56e29181602c5c004483d5a878ed26
# EXP-Topic fnodecache
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r a753bc019c1a
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