Part of bzrlib.rename_map View In Hierarchy
Method | __init__ | Undocumented |
Static Method | iter_edge_hashes | Iterate through the hashes of line pairs (which make up an edge). |
Method | add_edge_hashes | Update edge_hashes to include the given lines. |
Method | add_file_edge_hashes | Update to reflect the hashes for files in the tree. |
Method | hitcounts | Count the number of hash hits for each tag, for the given lines. |
Method | get_all_hits | Find all the hit counts for the listed paths in the tree. |
Method | file_match | Return a mapping from file_ids to the supplied paths. |
Method | get_required_parents | Return a dict of all file parents that must be versioned. |
Method | match_parents | Map parent directories to file-ids. |
Class Method | guess_renames | Guess which files to rename, and perform the rename. |
Static Method | _match_hits | Using a hit list, determine a path-to-fileid map. |
Method | _find_missing_files | Undocumented |
Method | _make_inventory_delta | Undocumented |
The hash is truncated using a modulus to avoid excessive memory consumption by the hitscount dict. A modulus of 10Mi means that the maximum number of keys is 10Mi. (Keys are normally 32 bits, e.g. 4 Gi)
Parameters | lines | The lines to update the hashes for. |
tag | A tag uniquely associated with these lines (i.e. file-id) |
Parameters | tree | The tree containing the files. |
file_ids | A list of file_ids to perform the updates for. |
Hits are weighted according to the number of tags the hash is associated with; more tags means that the hash is less rare and should tend to be ignored. :param lines: The lines to calculate hashes of. :return: a dict of {tag: hitcount}
Returns | A list of tuples of count, path, file_id. |
The hit list is a list of (count, path, file_id), where count is a (possibly float) number, with higher numbers indicating stronger matches.
The keys are the required parents and the values are sets of their children.
This is done by finding similarity between the file-ids of children of required parent directories and the file-ids of children of missing parent directories.