Part of bzrlib.graph View In Hierarchy
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. |
Parameters | start_keys | The keys the search started at. |
exclude_keys | The keys the search excludes. | |
key_count | The total number of keys (from start to but not including exclude). | |
keys | The 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. |
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).
Returns | A 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. |
Parameters | seen | Revisions that have been satisfied. |
referenced | Revision references observed while satisfying some of this search. |