hgext3rd/evolve/genericcaches.py
changeset 4965 191ed83dbc07
parent 4814 48b30ff742cb
equal deleted inserted replaced
4964:bb2042ff6444 4965:191ed83dbc07
    12 from mercurial import (
    12 from mercurial import (
    13     node,
    13     node,
    14     util,
    14     util,
    15 )
    15 )
    16 
    16 
    17 class incrementalcachebase(object):
    17 class incrementalcachebase(object):  # pytype: disable=ignored-metaclass
    18     """base class for incremental cache from append only source
    18     """base class for incremental cache from append only source
    19 
    19 
    20     There are multiple append only data source we might want to cache
    20     There are multiple append only data source we might want to cache
    21     computation from. One of the common pattern is to track the state of the
    21     computation from. One of the common pattern is to track the state of the
    22     file and update the cache with the extra data (eg: branchmap-cache tracking
    22     file and update the cache with the extra data (eg: branchmap-cache tracking
   131 
   131 
   132     def _deserializecachekey(self, data):
   132     def _deserializecachekey(self, data):
   133         """read the cachekey from bytes"""
   133         """read the cachekey from bytes"""
   134         return self._cachekeystruct.unpack(data)
   134         return self._cachekeystruct.unpack(data)
   135 
   135 
   136 class changelogsourcebase(incrementalcachebase):
   136 class changelogsourcebase(incrementalcachebase):  # pytype: disable=ignored-metaclass
   137     """an abstract class for cache sourcing data from the changelog
   137     """an abstract class for cache sourcing data from the changelog
   138 
   138 
   139     For this purpose it use a cache key covering changelog content.
   139     For this purpose it use a cache key covering changelog content.
   140     The cache key parts are: (tiprev, tipnode)
   140     The cache key parts are: (tiprev, tipnode)
   141     """
   141     """