Mercurial > public > mercurial-scm > hg
comparison mercurial/phases.py @ 18101:a464deecc9dd
clfilter: add a cache on repo for set of revision to filter for a given set.
Recomputing the filtered revisions at every access to changelog is far too
expensive. This changeset introduce a cache for this information. This cache is
hold by the repository (unfiltered repository) and invalidated when necessary.
This cache is not a protected attribute (leading _) because some logic that
invalidate it is not held by the local repo itself.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 20 Dec 2012 17:14:07 +0100 |
parents | 9bc5873e52af |
children | 312262ebc223 |
comparison
equal
deleted
inserted
replaced
18100:3a6ddacb7198 | 18101:a464deecc9dd |
---|---|
247 delroots.extend(olds - roots) | 247 delroots.extend(olds - roots) |
248 # declare deleted root in the target phase | 248 # declare deleted root in the target phase |
249 if targetphase != 0: | 249 if targetphase != 0: |
250 self.retractboundary(repo, targetphase, delroots) | 250 self.retractboundary(repo, targetphase, delroots) |
251 obsolete.clearobscaches(repo) | 251 obsolete.clearobscaches(repo) |
252 repo.filteredrevcache.clear() | |
252 | 253 |
253 def retractboundary(self, repo, targetphase, nodes): | 254 def retractboundary(self, repo, targetphase, nodes): |
254 # Be careful to preserve shallow-copied values: do not update | 255 # Be careful to preserve shallow-copied values: do not update |
255 # phaseroots values, replace them. | 256 # phaseroots values, replace them. |
256 | 257 |
265 currentroots.update(newroots) | 266 currentroots.update(newroots) |
266 ctxs = repo.set('roots(%ln::)', currentroots) | 267 ctxs = repo.set('roots(%ln::)', currentroots) |
267 currentroots.intersection_update(ctx.node() for ctx in ctxs) | 268 currentroots.intersection_update(ctx.node() for ctx in ctxs) |
268 self._updateroots(targetphase, currentroots) | 269 self._updateroots(targetphase, currentroots) |
269 obsolete.clearobscaches(repo) | 270 obsolete.clearobscaches(repo) |
271 repo.filteredrevcache.clear() | |
270 | 272 |
271 def advanceboundary(repo, targetphase, nodes): | 273 def advanceboundary(repo, targetphase, nodes): |
272 """Add nodes to a phase changing other nodes phases if necessary. | 274 """Add nodes to a phase changing other nodes phases if necessary. |
273 | 275 |
274 This function move boundary *forward* this means that all nodes | 276 This function move boundary *forward* this means that all nodes |