Mercurial > evolve
diff hgext3rd/topic/topicmap.py @ 6824:417f775d3eee
topic: we checked that branchmap.branchcache exists, let pytype know this
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Fri, 12 Jul 2024 15:44:12 +0400 |
parents | ed00ed185249 |
children |
line wrap: on
line diff
--- a/hgext3rd/topic/topicmap.py Fri Jul 12 15:43:01 2024 +0400 +++ b/hgext3rd/topic/topicmap.py Fri Jul 12 15:44:12 2024 +0400 @@ -133,6 +133,8 @@ branchmap.remotebranchcache = remotetopiccache else: # hg <= 6.7 (ec640dc9cebd) + assert hasattr(branchmap, 'branchcache') # help pytype + class topiccache(_topiccache, branchmap.branchcache): pass branchmap.branchcache = topiccache @@ -162,6 +164,7 @@ def copy(self): """return an deep copy of the branchcache object""" + assert hasattr(branchmap, 'branchcache') # help pytype assert isinstance(self, (branchmap.branchcache, branchmap.remotebranchcache)) # help pytype args = (self._entries, self.tipnode, self.tiprev, self.filteredhash, self._closednodes) @@ -176,6 +179,7 @@ """call branchmap.load(), and then transform branch names to be in the new "//" format """ + assert hasattr(branchmap, 'branchcache') # help pytype assert isinstance(self, branchmap.branchcache) # help pytype super(_topiccache, self).load(repo, lineiter) @@ -189,6 +193,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 hasattr(branchmap, 'branchcache') # help pytype assert isinstance(self, (branchmap.branchcache, branchmap.remotebranchcache)) # help pytype valid = super(_topiccache, self).validfor(repo) if not valid: @@ -225,6 +230,7 @@ missing heads, and a generator of nodes that are strictly a superset of heads missing, this function updates self to be correct. """ + assert hasattr(branchmap, 'branchcache') # help pytype assert isinstance(self, (branchmap.branchcache, branchmap.remotebranchcache)) # help pytype if not istopicfilter(repo.filtername): return super(_topiccache, self).update(repo, revgen) @@ -284,6 +290,7 @@ """ # we expect mutable set to be small enough to be that computing it all # the time will be fast enough + assert isinstance(self, branchmap.BranchCacheV2) # help pytype if not istopicfilter(repo.filtername): entries = self._entries.copy()