comparison mercurial/localrepo.py @ 48040:7970895a21cb stable

manifestlog: also monitor `00manifest.n` when applicable This let the locarepo's file cache detect outdated nodemap docket and reload the manifestlog after `localrepo.invalidate` when applicable. The same problem than issue6554 could affect the Manifest too. Differential Revision: https://phab.mercurial-scm.org/D11483
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 21 Sep 2021 18:18:56 +0200
parents c094e829e848
children b4f83c9e7905
comparison
equal deleted inserted replaced
48039:c094e829e848 48040:7970895a21cb
157 if obj.store.opener.options.get(b'persistent-nodemap', False): 157 if obj.store.opener.options.get(b'persistent-nodemap', False):
158 paths.append(self.join(obj, b'00changelog.n')) 158 paths.append(self.join(obj, b'00changelog.n'))
159 return paths 159 return paths
160 160
161 161
162 class manifestlogcache(storecache):
163 """filecache for the manifestlog"""
164
165 def __init__(self):
166 super(manifestlogcache, self).__init__()
167 _cachedfiles.add((b'00manifest.i', b''))
168 _cachedfiles.add((b'00manifest.n', b''))
169
170 def tracked_paths(self, obj):
171 paths = [self.join(obj, b'00manifest.i')]
172 if obj.store.opener.options.get(b'persistent-nodemap', False):
173 paths.append(self.join(obj, b'00manifest.n'))
174 return paths
175
176
162 class mixedrepostorecache(_basefilecache): 177 class mixedrepostorecache(_basefilecache):
163 """filecache for a mix files in .hg/store and outside""" 178 """filecache for a mix files in .hg/store and outside"""
164 179
165 def __init__(self, *pathsandlocations): 180 def __init__(self, *pathsandlocations):
166 # scmutil.filecache only uses the path for passing back into our 181 # scmutil.filecache only uses the path for passing back into our
1695 return repo.store.changelog( 1710 return repo.store.changelog(
1696 txnutil.mayhavepending(repo.root), 1711 txnutil.mayhavepending(repo.root),
1697 concurrencychecker=revlogchecker.get_checker(repo.ui, b'changelog'), 1712 concurrencychecker=revlogchecker.get_checker(repo.ui, b'changelog'),
1698 ) 1713 )
1699 1714
1700 @storecache(b'00manifest.i') 1715 @manifestlogcache()
1701 def manifestlog(self): 1716 def manifestlog(self):
1702 return self.store.manifestlog(self, self._storenarrowmatch) 1717 return self.store.manifestlog(self, self._storenarrowmatch)
1703 1718
1704 @repofilecache(b'dirstate') 1719 @repofilecache(b'dirstate')
1705 def dirstate(self): 1720 def dirstate(self):