File: trac_versioncontrol_diff.rst

package info (click to toggle)
trac 1.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 17,452 kB
  • ctags: 8,602
  • sloc: python: 71,206; makefile: 358; sh: 79; xml: 10
file content (40 lines) | stat: -rw-r--r-- 1,119 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
:mod:`trac.versioncontrol.diff` -- Utilities for generation of diffs
====================================================================

.. automodule :: trac.versioncontrol.diff

Synopsis
--------

`get_filtered_hunks`, `get_hunks` are low-level wrappers for Python's
`difflib.SequenceMatcher`, and they generate groups of opcodes
corresponding to diff "hunks".

`get_change_extent` is a low-level utility used when marking
intra-lines differences.

`diff_blocks` is used at a higher-level to fill the template data
needed by the "diff_div.html" template.

`unified_diff` is also a higher-level function returning differences
following the `unified diff`_ file format.

Finally, `get_diff_options` is an utility for retrieving user diff
preferences from a `~trac.web.api.Request`.

.. _unified diff: http://www.gnu.org/software/hello/manual/diff/Detailed-Unified.html

Function Reference
------------------

.. autofunction :: get_change_extent

.. autofunction :: get_filtered_hunks

.. autofunction :: get_hunks

.. autofunction :: diff_blocks

.. autofunction :: unified_diff

.. autofunction :: get_diff_options