class documentation
class RenameDetector:
Constructor: RenameDetector(store, rename_threshold, max_files, rewrite_threshold, ...)
Object for handling rename detection between two trees.
| Method | __init__ |
Initialize the rename detector. |
| Method | changes |
Iterate TreeChanges between two tree SHAs, with rename detection. |
| Method | _add |
Undocumented |
| Method | _choose |
Undocumented |
| Method | _collect |
Undocumented |
| Method | _find |
Undocumented |
| Method | _find |
Undocumented |
| Method | _join |
Undocumented |
| Method | _prune |
Undocumented |
| Method | _prune |
Undocumented |
| Method | _rename |
Undocumented |
| Method | _reset |
Undocumented |
| Method | _should |
Undocumented |
| Method | _should |
Undocumented |
| Method | _sorted |
Undocumented |
| Instance Variable | _adds |
Undocumented |
| Instance Variable | _candidates |
Undocumented |
| Instance Variable | _changes |
Undocumented |
| Instance Variable | _deletes |
Undocumented |
| Instance Variable | _find |
Undocumented |
| Instance Variable | _include |
Undocumented |
| Instance Variable | _max |
Undocumented |
| Instance Variable | _rename |
Undocumented |
| Instance Variable | _rewrite |
Undocumented |
| Instance Variable | _store |
Undocumented |
| Instance Variable | _want |
Undocumented |
def __init__(self, store:
BaseObjectStore, rename_threshold: int = RENAME_THRESHOLD, max_files: int | None = MAX_FILES, rewrite_threshold: int | None = REWRITE_THRESHOLD, find_copies_harder: bool = False):
¶
Initialize the rename detector.
| Parameters | |
store:BaseObjectStore | An ObjectStore for looking up objects. |
renameint | The threshold similarity score for considering an add/delete pair to be a rename/copy; see _similarity_score. |
maxint | None | The maximum number of adds and deletes to consider, or None for no limit. The detector is guaranteed to compare no more than max_files ** 2 add/delete pairs. This limit is provided because rename detection can be quadratic in the project size. If the limit is exceeded, no content rename detection is attempted. |
rewriteint | None | The threshold similarity score below which a modify should be considered a delete/add, or None to not break modifies; see _similarity_score. |
findbool | If True, consider unmodified files when detecting copies. |
def changes_with_renames(self, tree1_id:
ObjectID | None, tree2_id: ObjectID | None, want_unchanged: bool = False, include_trees: bool = False) -> list[ TreeChange]:
¶
Iterate TreeChanges between two tree SHAs, with rename detection.