b.g.CachingParentsProvider(object) : class documentation

Part of bzrlib.graph View In Hierarchy

A parents provider which will cache the revision => parents as a dict.

This is useful for providers which have an expensive look up.

Either a ParentsProvider or a get_parent_map-like callback may be supplied. If it provides extra un-asked-for parents, they will be cached, but filtered out of get_parent_map.

The cache is enabled by default, but may be disabled and re-enabled.

Method __init__ Constructor.
Method __repr__ Undocumented
Method enable_cache Enable cache.
Method disable_cache Disable and clear the cache.
Method get_cached_map Return any cached get_parent_map values.
Method get_cached_parent_map Return items from the cache.
Method get_parent_map See StackedParentsProvider.get_parent_map.
Method note_missing_key Note that key is a missing key.
def __init__(self, parent_provider=None, get_parent_map=None):
Constructor.
Parametersparent_providerThe ParentProvider to use. It or get_parent_map must be supplied.
get_parent_mapThe get_parent_map callback to use. It or parent_provider must be supplied.
def __repr__(self):
Undocumented
def enable_cache(self, cache_misses=True):
Enable cache.
def disable_cache(self):
Disable and clear the cache.
def get_cached_map(self):
Return any cached get_parent_map values.
def get_cached_parent_map(self, keys):
Return items from the cache.

This returns the same info as get_parent_map, but explicitly does not invoke the supplied ParentsProvider to search for uncached values.

def get_parent_map(self, keys):
See StackedParentsProvider.get_parent_map.
def note_missing_key(self, key):
Note that key is a missing key.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.