Part of bzrlib
Class | BinaryFiles | Undocumented |
Class | PatchSyntax | Undocumented |
Class | MalformedPatchHeader | Undocumented |
Class | MalformedHunkHeader | Undocumented |
Class | MalformedLine | Undocumented |
Class | PatchConflict | Undocumented |
Function | get_patch_names | Undocumented |
Function | parse_range | Parse a patch range, handling the "1" special-case |
Function | hunk_from_header | Undocumented |
Class | HunkLine | Undocumented |
Class | ContextLine | Undocumented |
Class | InsertLine | Undocumented |
Class | RemoveLine | Undocumented |
Function | parse_line | Undocumented |
Class | Hunk | No class docstring; 1/6 methods documented |
Function | iter_hunks | |
Class | BinaryPatch | Undocumented |
Class | Patch | No class docstring; 3/7 methods documented |
Function | parse_patch | |
Function | iter_file_patch | |
Function | iter_lines_handle_nl | Iterates through lines, ensuring that lines that originally had no |
Function | parse_patches | |
Function | difference_index | Find the indext of the first character that differs between two texts |
Function | iter_patched | Iterate through a series of lines with a patch applied. |
Function | iter_patched_from_hunks | Iterate through a series of lines with a patch applied. |
Parameters | textrange | The text to parse (type: str) |
Returns | the position and range, as a tuple (type: (int, int)) |
Parameters | iter_lines | iterable of lines to parse for hunks |
Unknown Field: kwarg | allow_dirty | If True, when we encounter something that is not a hunk header when we're looking for one, assume the rest of the lines are not part of the patch (comments or other junk). Default False |
Parameters | iter_lines | iterable of lines to parse |
Unknown Field: kwarg | allow_dirty | If True, allow the patch to have trailing junk. Default False |
Parameters | iter_lines | iterable of lines to parse for patches |
Unknown Field: kwarg | allow_dirty | If True, allow comments and other non-patch text before the first patch. Note that the algorithm here can only find such text before any patches have been found. Comments after the first patch are stripped away in iter_hunks() if it is also passed allow_dirty=True. Default False. |
Iterates through lines, ensuring that lines that originally had no terminating are produced without one. This transformation may be applied at any point up until hunk line parsing, and is safe to apply repeatedly.
Parameters | iter_lines | iterable of lines to parse for patches |
Unknown Field: kwarg | allow_dirty | If True, allow text that's not part of the patch at selected places. This includes comments before and after a patch for instance. Default False. |
Parameters | atext | The first text (type: str) |
btext | The second text | |
str | (type: str) | |
Returns | The index, or None if there are no differences within the range (type: int or NoneType) |