trac.versioncontrol.web_ui.changeset

class trac.versioncontrol.web_ui.changeset.ChangesetModule

Bases: trac.core.Component

Renderer providing flexible functionality for showing sets of differences.

If the differences shown are coming from a specific changeset, then that changeset information can be shown too.

In addition, it is possible to show only a subset of the changeset: Only the changes affecting a given path will be shown. This is called the ‘’restricted’’ changeset.

But the differences can also be computed in a more general way, between two arbitrary paths and/or between two arbitrary revisions. In that case, there’s no changeset information displayed.

max_diff_bytes

Maximum total size in bytes of the modified files (their old size plus their new size) for which the changeset view will attempt to show the diffs inlined.

max_diff_files

Maximum number of modified files for which the changeset view will attempt to show the diffs inlined.

process_request(req)

The appropriate mode of operation is inferred from the request parameters:

  • If new_path and old_path are equal (or old_path is omitted) and new and old are equal (or old is omitted), then we’re about to view a revision Changeset: chgset is True. Furthermore, if the path is not the root, the changeset is ‘’restricted’’ to that path (only the changes affecting that path, its children or its ancestor directories will be shown).
  • In any other case, the set of changes corresponds to arbitrary differences between path@rev pairs. If new_path and old_path are equal, the ‘’restricted’’ flag will also be set, meaning in this case that the differences between two revisions are restricted to those occurring on that path.

In any case, either path@rev pairs must exist.

property_diff_renderers

List of components that implement IPropertyDiffRenderer

render_property_diff(name, old_node, old_props, new_node, new_props, options)

Renders diffs of a node property to HTML.

timeline_collapse

Whether consecutive changesets from the same author having exactly the same message should be presented as one event. That event will link to the range of changesets in the log view.

timeline_long_messages

Whether wiki-formatted changeset messages should be multiline or not.

If this option is not specified or is false and wiki_format_messages is set to true, changeset messages will be single line only, losing some formatting (bullet points, etc).

timeline_show_files

Number of files to show (-1 for unlimited, 0 to disable).

This can also be location, for showing the common prefix for the changed files.

wiki_format_messages

Whether wiki formatting should be applied to changeset messages.

If this option is disabled, changeset messages will be rendered as pre-formatted text.

class trac.versioncontrol.web_ui.changeset.DefaultPropertyDiffRenderer

Bases: trac.core.Component

Default version control property difference renderer.

class trac.versioncontrol.web_ui.changeset.IPropertyDiffRenderer

Bases: trac.core.Interface

Render node properties in TracBrowser and TracChangeset views.

match_property_diff(name)

Indicate whether this renderer can treat the given property diffs

Returns a quality number, ranging from 0 (unsupported) to 9 (‘’perfect’’ match).

render_property_diff(name, old_context, old_props, new_context, new_props, options)

Render the given diff of property to HTML.

name is the property name as given to match_property_diff(), old_context corresponds to the old node being render (useful when the rendering depends on the node kind) and old_props is the corresponding collection of all properties. Same for new_node and new_props. options are the current diffs options.

The rendered result can be one of the following:
  • None: the property change will be shown the normal way (‘’changed from old to new‘’)
  • an unicode value: the change will be shown as textual content
  • Markup or Fragment: the change will shown as block markup