changeset 6621:5efde4e19eb7

topic: help pytype see that _topiccache is a mixin for use with branchcache There seems to be another way to maybe do this (PEP 544), but it's for Python 3.8, so we can't use it right now.
author Anton Shestakov <av6@dwimlabs.net>
date Thu, 28 Dec 2023 14:19:54 -0300
parents 35e70a2a66f2
children b669ded0fe00
files hgext3rd/topic/topicmap.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/topic/topicmap.py	Tue Dec 26 16:23:25 2023 -0300
+++ b/hgext3rd/topic/topicmap.py	Thu Dec 28 14:19:54 2023 -0300
@@ -175,6 +175,7 @@
     def copy(self):
         """return an deep copy of the branchcache object"""
         entries = compat.bcentries(self)
+        assert isinstance(self, _oldbranchmap)  # help pytype
         args = (entries, self.tipnode, self.tiprev, self.filteredhash,
                 self._closednodes)
         if util.safehasattr(self, '_repo'):
@@ -188,6 +189,7 @@
         """call branchmap.load(), and then transform branch names to be in the
         new "//" format
         """
+        assert isinstance(self, _oldbranchmap)  # help pytype
         super(_topiccache, self).load(repo, lineiter)
         entries = compat.bcentries(self)
 
@@ -201,6 +203,7 @@
 
         - False when cached tipnode is unknown or if we detect a strip.
         - True when cache is up to date or a subset of current repo."""
+        assert isinstance(self, _oldbranchmap)  # help pytype
         valid = super(_topiccache, self).validfor(repo)
         if not valid:
             return False
@@ -237,6 +240,7 @@
         missing heads, and a generator of nodes that are strictly a superset of
         heads missing, this function updates self to be correct.
         """
+        assert isinstance(self, _oldbranchmap)  # help pytype
         if not istopicfilter(repo.filtername):
             return super(_topiccache, self).update(repo, revgen)