comparison mercurial/sparse.py @ 33302:36a415b5a4b2

localrepo: add sparse caches The sparse extension maintains caches for the sparse files to a signature and a signature to a matcher. This allows the sparse matchers to be resolved quickly, which is apparently something that can occur in loops. This patch ports the sparse caches to the localrepo class pretty much as-is. There is potentially room to improve the caching mechanism. But that can be done as a follow-up. The default invalidatecaches() now clears the relevant sparse cache. invalidatesignaturecache() has been moved to sparse.py.
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 06 Jul 2017 12:20:53 -0700
parents ca4b78eb11e7
children 8b571495d811
comparison
equal deleted inserted replaced
33301:ca4b78eb11e7 33302:36a415b5a4b2
124 profiles = set() 124 profiles = set()
125 for rev in revs: 125 for rev in revs:
126 profiles.update(patternsforrev(repo, rev)[2]) 126 profiles.update(patternsforrev(repo, rev)[2])
127 127
128 return profiles 128 return profiles
129
130 def invalidatesignaturecache(repo):
131 repo._sparsesignaturecache.clear()