branchcache: introduce a base class for branchmap
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 25 Feb 2024 14:09:36 +0100
changeset 51454 84fca6d79e25
parent 51453 bb8612053547
child 51455 7a063dd9d64e
branchcache: introduce a base class for branchmap This will help define a clear boundary between the two.
mercurial/branchmap.py
--- a/mercurial/branchmap.py	Mon Feb 19 12:09:06 2024 +0100
+++ b/mercurial/branchmap.py	Sun Feb 25 14:09:36 2024 +0100
@@ -183,7 +183,7 @@
         return b'branch cache'
 
 
-class branchcache:
+class _BaseBranchCache:
     """A dict like object that hold branches heads cache.
 
     This cache is used to avoid costly computations to determine all the
@@ -652,11 +652,12 @@
         self.write(repo)
 
 
-class remotebranchcache(branchcache):
-    """Branchmap info for a remote connection, should not write locally"""
+class branchcache(_BaseBranchCache):
+    """Branchmap info for a local repo or repoview"""
 
-    def write(self, repo):
-        pass
+
+class remotebranchcache(_BaseBranchCache):
+    """Branchmap info for a remote connection, should not write locally"""
 
 
 # Revision branch info cache