b.r.RenameMap(object) : class documentation

Part of bzrlib.rename_map View In Hierarchy

Determine a mapping of renames.
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
def __init__(self, tree):
Undocumented
@staticmethod
def iter_edge_hashes(lines):
Iterate through the hashes of line pairs (which make up an edge).

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)

def add_edge_hashes(self, lines, tag):
Update edge_hashes to include the given lines.
ParameterslinesThe lines to update the hashes for.
tagA tag uniquely associated with these lines (i.e. file-id)
def add_file_edge_hashes(self, tree, file_ids):
Update to reflect the hashes for files in the tree.
ParameterstreeThe tree containing the files.
file_idsA list of file_ids to perform the updates for.
def hitcounts(self, lines):
Count the number of hash hits for each tag, for the given lines.

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}

def get_all_hits(self, paths):
Find all the hit counts for the listed paths in the tree.
ReturnsA list of tuples of count, path, file_id.
def file_match(self, paths):
Return a mapping from file_ids to the supplied paths.
@staticmethod
def _match_hits(hit_list):
Using a hit list, determine a path-to-fileid map.

The hit list is a list of (count, path, file_id), where count is a (possibly float) number, with higher numbers indicating stronger matches.

def get_required_parents(self, matches):
Return a dict of all file parents that must be versioned.

The keys are the required parents and the values are sets of their children.

def match_parents(self, required_parents, missing_parents):
Map parent directories to file-ids.

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.

def _find_missing_files(self, basis):
Undocumented
@classmethod
def guess_renames(klass, tree, dry_run=False):
Guess which files to rename, and perform the rename.

We assume that unversioned files and missing files indicate that versioned files have been renamed outside of Bazaar.

ParameterstreeA write-locked working tree.
def _make_inventory_delta(self, matches):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2019-07-19 00:30:15.