From patchwork Thu May 2 16:24:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1,of,3] hgtagsfnodescache: handle nullid lookup From: Pierre-Yves David X-Patchwork-Id: 39921 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Thu, 02 May 2019 18:24:01 +0200 # HG changeset patch # User Pierre-Yves David # 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()