comparison mercurial/branchmap.py @ 51451:84fca6d79e25

branchcache: introduce a base class for branchmap This will help define a clear boundary between the two.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 25 Feb 2024 14:09:36 +0100
parents bb8612053547
children 7a063dd9d64e
comparison
equal deleted inserted replaced
51450:bb8612053547 51451:84fca6d79e25
181 return b'branch cache (%s)' % repo.filtername 181 return b'branch cache (%s)' % repo.filtername
182 else: 182 else:
183 return b'branch cache' 183 return b'branch cache'
184 184
185 185
186 class branchcache: 186 class _BaseBranchCache:
187 """A dict like object that hold branches heads cache. 187 """A dict like object that hold branches heads cache.
188 188
189 This cache is used to avoid costly computations to determine all the 189 This cache is used to avoid costly computations to determine all the
190 branch heads of a repo. 190 branch heads of a repo.
191 191
650 ) 650 )
651 651
652 self.write(repo) 652 self.write(repo)
653 653
654 654
655 class remotebranchcache(branchcache): 655 class branchcache(_BaseBranchCache):
656 """Branchmap info for a local repo or repoview"""
657
658
659 class remotebranchcache(_BaseBranchCache):
656 """Branchmap info for a remote connection, should not write locally""" 660 """Branchmap info for a remote connection, should not write locally"""
657
658 def write(self, repo):
659 pass
660 661
661 662
662 # Revision branch info cache 663 # Revision branch info cache
663 664
664 _rbcversion = b'-v1' 665 _rbcversion = b'-v1'