comparison mercurial/localrepo.py @ 48363:8e5effbf52d0 stable

branchmap: stop writing cache for uncommitted data If we are about to write the branch while a transaction is active. we delay that write. After the transaction is closed, we flush all the write we delayed (unless they have been written in between). Differential Revision: https://phab.mercurial-scm.org/D12128
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 01 Feb 2022 15:19:50 +0100
parents f7086f6173f8
children e845537f6adb
comparison
equal deleted inserted replaced
48362:3f618484eeb6 48363:8e5effbf52d0
2828 if tr is None or tr.changes[b'origrepolen'] < len(self): 2828 if tr is None or tr.changes[b'origrepolen'] < len(self):
2829 # accessing the 'served' branchmap should refresh all the others, 2829 # accessing the 'served' branchmap should refresh all the others,
2830 self.ui.debug(b'updating the branch cache\n') 2830 self.ui.debug(b'updating the branch cache\n')
2831 self.filtered(b'served').branchmap() 2831 self.filtered(b'served').branchmap()
2832 self.filtered(b'served.hidden').branchmap() 2832 self.filtered(b'served.hidden').branchmap()
2833 # flush all possibly delayed write.
2834 self._branchcaches.write_delayed(self)
2833 2835
2834 if repository.CACHE_CHANGELOG_CACHE in caches: 2836 if repository.CACHE_CHANGELOG_CACHE in caches:
2835 self.changelog.update_caches(transaction=tr) 2837 self.changelog.update_caches(transaction=tr)
2836 2838
2837 if repository.CACHE_MANIFESTLOG_CACHE in caches: 2839 if repository.CACHE_MANIFESTLOG_CACHE in caches: