comparison mercurial/localrepo.py @ 51522:c0d51565b501

branchcache: unconditionally write delayed branchmap
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 08 Jan 2024 15:11:34 +0100
parents 7f7086a42b2b
children 94f821490645
comparison
equal deleted inserted replaced
51521:19b2736c8e45 51522:c0d51565b501
2925 if tr is None or tr.changes[b'origrepolen'] < len(self): 2925 if tr is None or tr.changes[b'origrepolen'] < len(self):
2926 # accessing the 'served' branchmap should refresh all the others, 2926 # accessing the 'served' branchmap should refresh all the others,
2927 self.ui.debug(b'updating the branch cache\n') 2927 self.ui.debug(b'updating the branch cache\n')
2928 self.filtered(b'served').branchmap() 2928 self.filtered(b'served').branchmap()
2929 self.filtered(b'served.hidden').branchmap() 2929 self.filtered(b'served.hidden').branchmap()
2930 # flush all possibly delayed write.
2931 self._branchcaches.write_delayed(self)
2932 2930
2933 if repository.CACHE_CHANGELOG_CACHE in caches: 2931 if repository.CACHE_CHANGELOG_CACHE in caches:
2934 self.changelog.update_caches(transaction=tr) 2932 self.changelog.update_caches(transaction=tr)
2935 2933
2936 if repository.CACHE_MANIFESTLOG_CACHE in caches: 2934 if repository.CACHE_MANIFESTLOG_CACHE in caches:
2972 # never been used by hg, they won't ever have been written, even if 2970 # never been used by hg, they won't ever have been written, even if
2973 # they're a subset of another kind of cache that *has* been used). 2971 # they're a subset of another kind of cache that *has* been used).
2974 for filt in repoview.filtertable.keys(): 2972 for filt in repoview.filtertable.keys():
2975 filtered = self.filtered(filt) 2973 filtered = self.filtered(filt)
2976 self._branchcaches.update_disk(filtered) 2974 self._branchcaches.update_disk(filtered)
2975
2976 # flush all possibly delayed write.
2977 self._branchcaches.write_delayed(self)
2977 2978
2978 def invalidatecaches(self): 2979 def invalidatecaches(self):
2979 if '_tagscache' in vars(self): 2980 if '_tagscache' in vars(self):
2980 # can't use delattr on proxy 2981 # can't use delattr on proxy
2981 del self.__dict__['_tagscache'] 2982 del self.__dict__['_tagscache']