This is an archive of the discontinued Mercurial Phabricator instance.

tags: return tag cache source from _readtagcache()
AbandonedPublic

Authored by pulkit on Feb 17 2021, 2:44 PM.

Details

Reviewers
Alphare
Group Reviewers
hg-reviewers
Summary

If the cache is invalid, _readtagcache() can return data which has a wrong
filenode. We want to fix the cache in such cases by replacing the wrong filenode
with a correct one. To do so, first the callers need to be aware from
which cache values returned by this function are read.

This patch adds a new return value which depicts the source of data return from
_readtagcache().

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

pulkit created this revision.Feb 17 2021, 2:44 PM
Alphare accepted this revision.Feb 23 2021, 4:41 AM
marmoute added inline comments.
mercurial/tags.py
186–188

small nits: I would probably use 2 explicit line for this instead of a "one-liner" spawning 3 line:

cache_values = _readtagcache(ui, repo)
(heads, tagfnode, valid, cachetags, shouldwrite, source) = cache_values
409–413

what does this mean if "the cache data is read from hgtagsfnodes" ? Does this always result in cachetags being None ?

pulkit planned changes to this revision.Mar 1 2021, 1:53 PM

Superseeded by D10083.

pulkit abandoned this revision.Mar 9 2021, 2:14 AM