[PATCH 0 of 2 Repost] move cache files to a collected cache folder .hg/caches/

Jason Harris jason.f.harris at gmail.com
Sat Jan 15 19:18:01 CST 2011


move tags.cache and branchheads.cache to a collected cache folder .hg/caches/

[Repost] This patch seemed to fall through the cracks. At the last stage I
implemented the changes that had been requested in
http://www.selenic.com/pipermail/mercurial-devel/2011-January/027263.html. Just
so people recall this first patch does the actual move of the cache files. The
second part refactors this into using copener as advocated by Adrian Buehlmann.
(However just to be clear I don't really like the copener approach, I have just
included it since Adrian requested it.) Thus the maintainers (crew, Matt) can
take just patch 1 if they don't want copener or they can take both patches if
they want the copener approach.

The generation of cache files like tags.cache and branchheads.cache is not an
actual reflection of things changing in the whole of the .hg directory (like eg
a commit or a rebase or something) but instead these cache files are just part
of bookkeeping. As such its convenient to allow various clients to ignore file
events to do with these cache files which would otherwise cause a double
refresh. Eg one refresh might occur after a commit, but the act of refreshing
after the commit would cause Mercurial to generate a new branchheads.cache which
would then cause a second refresh, for clients.

However if these cache files are moved into a directory like eg .hg/caches/ then
GUI clients on OSX (and possibly other platforms) can happily ignore file events
in this cache directory.


More information about the Mercurial-devel mailing list