comparison mercurial/manifest.py @ 50637:32837c7e2e4b

revlog: add a `get_revlog` method This might seen weird, but I actually thing we have been needing this for a long time. There is multiple object that kind of pretend being revlogs while actually wrapping the actual revlog. Since multiple code needs to access the actuel revlog. See documentation for more details. Expect cleanup of various places one the current series is done.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 28 May 2023 05:23:46 +0200
parents 0ec94359eae8
children d718eddf01d9
comparison
equal deleted inserted replaced
50636:c90ea9bbf327 50637:32837c7e2e4b
1615 ) 1615 )
1616 1616
1617 self.index = self._revlog.index 1617 self.index = self._revlog.index
1618 self._generaldelta = self._revlog._generaldelta 1618 self._generaldelta = self._revlog._generaldelta
1619 1619
1620 def get_revlog(self):
1621 """return an actual revlog instance if any
1622
1623 This exist because a lot of code leverage the fact the underlying
1624 storage is a revlog for optimization, so giving simple way to access
1625 the revlog instance helps such code.
1626 """
1627 return self._revlog
1628
1620 def _setupmanifestcachehooks(self, repo): 1629 def _setupmanifestcachehooks(self, repo):
1621 """Persist the manifestfulltextcache on lock release""" 1630 """Persist the manifestfulltextcache on lock release"""
1622 if not util.safehasattr(repo, '_wlockref'): 1631 if not util.safehasattr(repo, '_wlockref'):
1623 return 1632 return
1624 1633