b.g.SearchResult(AbstractSearchResult) : class documentation

Part of bzrlib.graph View In Hierarchy

The result of a breadth first search.

A SearchResult provides the ability to reconstruct the search or access a set of the keys the search found.

Method __init__ Create a SearchResult.
Method __repr__ Undocumented
Method get_recipe Return a recipe that can be used to replay this search.
Method get_network_struct Return a tuple that can be transmitted via the HPSS protocol.
Method get_keys Return the keys found in this search.
Method is_empty Return false if the search lists 1 or more revisions.
Method refine Create a new search by refining this search.
def __init__(self, start_keys, exclude_keys, key_count, keys):
Create a SearchResult.
Parametersstart_keysThe keys the search started at.
exclude_keysThe keys the search excludes.
key_countThe total number of keys (from start to but not including exclude).
keysThe keys the search found. Note that in future we may get a SearchResult from a smart server, in which case the keys list is not necessarily immediately available.
def __repr__(self):
Undocumented
def get_recipe(self):
Return a recipe that can be used to replay this search.

The recipe allows reconstruction of the same results at a later date without knowing all the found keys. The essential elements are a list of keys to start and to stop at. In order to give reproducible results when ghosts are encountered by a search they are automatically added to the exclude list (or else ghost filling may alter the results).

ReturnsA tuple ('search', start_keys_set, exclude_keys_set, revision_count). To recreate the results of this search, create a breadth first searcher on the same graph starting at start_keys. Then call next() (or next_with_ghosts()) repeatedly, and on every result, call stop_searching_any on any keys from the exclude_keys set. The revision_count value acts as a trivial cross-check - the found revisions of the new search should have as many elements as revision_count. If it does not, then additional revisions have been ghosted since the search was executed the first time and the second time.
def get_network_struct(self):
Return a tuple that can be transmitted via the HPSS protocol.
def get_keys(self):
Return the keys found in this search.
ReturnsA set of keys.
def is_empty(self):
Return false if the search lists 1 or more revisions.
def refine(self, seen, referenced):
Create a new search by refining this search.
ParametersseenRevisions that have been satisfied.
referencedRevision references observed while satisfying some of this search.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.