dulwich.patch
module documentationdulwich
Classes for dealing with git am-style patches.
These patches are basically unified diffs with some extra metadata tacked on.
Function | write_commit_patch | Write a individual file patch. |
Function | get_summary | Determine the summary line for use in a filename. |
Function | unified_diff | difflib.unified_diff that can detect "No newline at end of file" as original "git diff" does. |
Function | is_binary | See if the first few bytes contain any null characters. |
Function | shortid | Undocumented |
Function | patch_filename | Undocumented |
Function | write_object_diff | Write the diff for an object. |
Function | gen_diff_header | Write a blob diff header. |
Function | write_blob_diff | Write blob diff. |
Function | write_tree_diff | Write tree diff. |
Function | git_am_patch_split | Parse a git-am-style patch and split it up into bits. |
Function | parse_patch_message | Extract a Commit object and patch from an e-mail message. |
Function | _format_range_unified | Convert range to the "ed" format |
Parameters | commit | Commit object |
progress | Tuple with current patch number and total. | |
Returns | tuple with filename and contents |
Parameters | commit | Commit |
Returns | Summary string |
difflib.unified_diff that can detect "No newline at end of file" as original "git diff" does.
Based on the same function in Python2.7 difflib.py
Parameters | content | Bytestring to check for binary content |
Parameters | f | File-like object to write to |
store | Store to retrieve objects from, if necessary | |
old_file | (path, mode, hexsha) tuple | |
new_file | (path, mode, hexsha) tuple | |
diff_binary | Whether to diff files even if they are considered binary files by is_binary(). | |
Note | the tuple elements should be None for nonexistant files |
Parameters | paths | Tuple with old and new path |
modes | Tuple with old and new modes | |
shas | Tuple with old and new shas |
Parameters | f | File-like object to write to |
old_file | (path, mode, hexsha) tuple (None if nonexisting) | |
new_file | (path, mode, hexsha) tuple (None if nonexisting) | |
Note | The use of write_object_diff is recommended over this function. |
Parameters | f | File-like object to write to. |
old_tree | Old tree id | |
new_tree | New tree id | |
diff_binary | Whether to diff files even if they are considered binary files by is_binary(). |