Part of bzrlib.groupcompress View In Hierarchy
Method | __init__ | Construct a _GCGraphIndex on a graph_index. |
Method | add_records | Add multiple records to the index. |
Method | find_ancestry | See CombinedGraphIndex.find_ancestry |
Method | get_parent_map | Get a map of the parents of keys. |
Method | get_missing_parents | Return the keys of missing parents. |
Method | get_build_details | Get the various build details for keys. |
Method | keys | Get all the keys in the collection. |
Method | scan_unvalidated_index | Inform this _GCGraphIndex that there is an unvalidated index. |
Method | _check_read | Raise an exception if reads are not permitted. |
Method | _check_write_ok | Raise an exception if writes are not permitted. |
Method | _get_entries | Get the entries for keys. |
Method | _node_to_position | Convert an index value to position details. |
Parameters | graph_index | An implementation of bzrlib.index.GraphIndex. |
is_locked | A callback, returns True if the index is locked and thus usable. | |
parents | If True, record knits parents, if not do not record parents. | |
add_callback | If not None, allow additions to the index and call this callback with a list of added GraphIndex nodes: [(node, value, node_refs), ...] | |
track_external_parent_refs | As keys are added, keep track of the keys they reference, so that we can query get_missing_parents(), etc. | |
inconsistency_fatal | When asked to add records that are already present, and the details are inconsistent with the existing record, raise an exception instead of warning (and skipping the record). |
This function does not insert data into the Immutable GraphIndex backing the KnitGraphIndex, instead it prepares data for insertion by the caller and checks that it is safe to insert then calls self._add_callback with the prepared GraphIndex nodes.
Parameters | records | a list of tuples: (key, options, access_memo, parents). |
random_id | If True the ids being added were randomly generated and no check for existence will be performed. |
Note: Callers are responsible for checking that the index is locked before calling this method.
Parameters | keys | An iterable of index key tuples. |
Parameters | keys | The keys to look up parents for. |
Returns | A mapping from keys to parents. Absent keys are absent from the mapping. |
Ghosts are omitted from the result.
Parameters | keys | An iterable of keys. |
Returns | A dict of key: (index_memo, compression_parent, parents, record_details).
|
This allows this _GCGraphIndex to keep track of any missing compression parents we may want to have filled in to make those indices valid. It also allows _GCGraphIndex to track any new keys.
Parameters | graph_index | A GraphIndex |