Utilities for diffing files and trees.
Class |
|
Object for handling rename detection between two trees. |
Class |
|
Named tuple a single change between two trees. |
Function | tree |
Find the differences between the contents of two trees. |
Function | tree |
Get the tree changes for a merge tree relative to all its parents. |
Function | walk |
Recursively walk all the entries of two trees. |
Constant | CHANGE |
Undocumented |
Constant | CHANGE |
Undocumented |
Constant | CHANGE |
Undocumented |
Constant | CHANGE |
Undocumented |
Constant | CHANGE |
Undocumented |
Constant | CHANGE |
Undocumented |
Constant | MAX |
Undocumented |
Constant | RENAME |
Undocumented |
Constant | RENAME |
Undocumented |
Constant | REWRITE |
Undocumented |
Function | _all |
Undocumented |
Function | _all |
Undocumented |
Function | _common |
Count the number of common bytes in two block count dicts. |
Function | _count |
Count the blocks in an object. |
Function | _is |
Undocumented |
Function | _merge |
Merge the entries of two trees. |
Function | _similarity |
Compute a similarity score for two objects. |
Function | _skip |
Undocumented |
Function | _tree |
Undocumented |
Function | _tree |
Undocumented |
Constant | _BLOCK |
Undocumented |
Constant | _MAX |
Undocumented |
Constant | _NULL |
Undocumented |
Find the differences between the contents of two trees.
Parameters | |
store | An ObjectStore for looking up objects. |
tree1 | The SHA of the source tree. |
tree2 | The SHA of the target tree. |
want | If True, include TreeChanges for unmodified entries as well. |
rename | RenameDetector object for detecting renames. |
include | Whether to include trees |
change | Whether to report change types in the same entry or as delete+add. |
Returns | |
|
Get the tree changes for a merge tree relative to all its parents.
Parameters | |
store | An ObjectStore for looking up objects. |
parent | An iterable of the SHAs of the parent trees. |
tree | The SHA of the merge tree. |
rename | RenameDetector object for detecting renames. |
Returns | |
Iterator over lists of TreeChange objects, one per conflicted path in the merge. Each list contains one element per parent, with the TreeChange for that path relative to that parent. An element may be None if it never existed in one parent and was deleted in two others. A path is only included in the output if it is a conflict, i.e. its SHA in the merge tree is not found in any of the parents, or in the case of deletes, if not all of the old SHAs match. |
Recursively walk all the entries of two trees.
Iteration is depth-first pre-order, as in e.g. os.walk.
Parameters | |
store | An ObjectStore for looking up objects. |
tree1 | The SHA of the first Tree object to iterate, or None. |
tree2 | The SHA of the second Tree object to iterate, or None. |
prune | If True, identical subtrees will not be walked. |
Returns | |
|
Count the number of common bytes in two block count dicts.
Parameters | |
blocks1 | The first dict of block hashcode -> total bytes. |
blocks2 | The second dict of block hashcode -> total bytes. |
Returns | |
The number of bytes in common between blocks1 and blocks2. This is only approximate due to possible hash collisions. |
Count the blocks in an object.
Splits the data into blocks either on lines or <=64-byte chunks of lines.
Parameters | |
obj | The object to count blocks for. |
Returns | |
A dict of block hashcode -> total bytes occurring. |
Merge the entries of two trees.
Parameters | |
path | A path to prepend to all tree entry names. |
tree1 | The first Tree object to iterate, or None. |
tree2 | The second Tree object to iterate, or None. |
Returns | |
|
Compute a similarity score for two objects.
Parameters | |
obj1 | The first object to score. |
obj2 | The second object to score. |
block | An optional dict of SHA to block counts to cache results between calls. |
Returns | |
|