cola.diffparse – Diff Parsing and Processing

class cola.diffparse.DiffParser(model, filename='', cached=True, branch=None, reverse=False)

Handles parsing diff for use by the interactive index editor.

diff_for_offset(offset)

Returns the hunks for a particular offset.

diff_subset(diff, start, end)

Processes the diffs and returns a selected subset from that diff.

diffs()

Returns the list of diffs.

diffs_for_range(start, end)

Returns the hunks for a selected range.

offsets()

Returns the offsets.

parse_diff(diff)

Parses a diff and extracts headers, offsets, hunks, etc.

process_diff_selection(selected, offset, selection, apply_to_worktree=False)

Processes a diff selection and applies changes to git.

set_diff_to_offset(offset)

Sets the diff selection to be the hunk at a particular offset.

set_diffs_to_range(start, end)

Sets the diff selection to be a range of hunks.

spans()

Returns the line spans of each hunk.

write_diff(filename, which, selected=False, noop=False)

Writes a new diff corresponding to the user’s selection.

Previous topic

cola.core – Unicode and UNIX helpers

Next topic

cola.difftool – Difftool helpers

This Page