Show More
@@ -1093,6 +1093,10 b' class localrepository(object):' | |||||
1093 | **pycompat.strkwargs(hookargs)) |
|
1093 | **pycompat.strkwargs(hookargs)) | |
1094 | reporef()._afterlock(hook) |
|
1094 | reporef()._afterlock(hook) | |
1095 | tr.addfinalize('txnclose-hook', txnclosehook) |
|
1095 | tr.addfinalize('txnclose-hook', txnclosehook) | |
|
1096 | def warmscache(tr2): | |||
|
1097 | repo = reporef() | |||
|
1098 | repo.updatecaches(tr2) | |||
|
1099 | tr.addpostclose('warms-cache', warmscache) | |||
1096 | def txnaborthook(tr2): |
|
1100 | def txnaborthook(tr2): | |
1097 | """To be run if transaction is aborted |
|
1101 | """To be run if transaction is aborted | |
1098 | """ |
|
1102 | """ | |
@@ -1227,6 +1231,17 b' class localrepository(object):' | |||||
1227 | self.destroyed() |
|
1231 | self.destroyed() | |
1228 | return 0 |
|
1232 | return 0 | |
1229 |
|
1233 | |||
|
1234 | @unfilteredmethod | |||
|
1235 | def updatecaches(self, tr): | |||
|
1236 | """warm appropriate caches after a transaction closed""" | |||
|
1237 | if tr.hookargs.get('source') == 'strip': | |||
|
1238 | # During strip, many caches are invalid but | |||
|
1239 | # later call to `destroyed` will refresh them. | |||
|
1240 | return | |||
|
1241 | ||||
|
1242 | if tr.changes['revs']: | |||
|
1243 | branchmap.updatecache(self.filtered('served')) | |||
|
1244 | ||||
1230 | def invalidatecaches(self): |
|
1245 | def invalidatecaches(self): | |
1231 |
|
1246 | |||
1232 | if '_tagscache' in vars(self): |
|
1247 | if '_tagscache' in vars(self): |
General Comments 0
You need to be logged in to leave comments.
Login now