wiki:TracTicketChangelogPlugin

Show ticket relative changelogs

Description

This plugin adds a changelog list in a Trac ticket.

Compose your log message with a ticket reference pattern. The default pattern in versions 0.12 and 1.0 of the plugin is to add #ticketid before the log messages:

#ticketid any messages

In version 1.2 of the plugin the CommitTicketUpdater options are used to configure the pattern. With the default option values, patterns such like refs #1 and fixes #2 will be matched.

Tested with Subversion, Mercurial and Git.

See also TracTicketChangesetsPlugin, TicketModifiedFilesPlugin.

Mercurial

For the Mercurial backend, since TracMercurial does not support the repository cache yet, you should install TracMercurialChangesetPlugin to generate the repository cache.

Git

For the Git backend, you should add following config to the [git] section of your trac.ini file:

[git]
cached_repository = true
persistent_cache = true

You need to run trac-admin repository resync after the change.

Bugs/Feature Requests

Existing bugs and feature requests for TracTicketChangelogPlugin are here.

If you have any issues, create a new ticket.

defect

22 / 22

enhancement

6 / 6

task

0 / 1

Download

Download the zipped source from here.

Source

You can check out TracTicketChangelogPlugin from here using Subversion, or browse the source with Trac.

Installation

You can install this plugin following the standard procedures described in TracPlugins.

  1. Uninstall TracTicketChangelogPlugin if you have installed it before.
  2. Change to the directory containing setup.py.
    • (Optional): If you have Babel installed and would like to have translations available:
      python setup.py compile_catalog -f
      
  3. If you want to install this plugin globally, you need to install this plugin to the Python path:
    python setup.py install
    
  4. If you want to install this plugin to the Trac instance only:
    python setup.py bdist_egg
    
    Then copy the generated egg file to the Trac instance's plugins directory:
    cp dist/*.egg /srv/trac/env/plugins
    
  5. Add the following to your trac.ini file:
    [components]
    ticketlog.* = enabled
    
    [ticketlog]
    ; optional: custom your log message pattern
    log_pattern = ^\s*#%s[:\s]+.*$  # version 0.12 and 1.0
    ; optional: set log message's max length, default is no limit
    log_message_maxlength = 100
    
  6. (Version 1.2) Sync the ticket-revision table:
    $ trac-admin $env ticketlog sync
    
    You must configure repository caching and explicit synchronization, and resync all of the repositories before running ticketlog sync.

Configuration

In version 0.12 and 1.0 of the plugin you can configure log_pattern:

  • %s in the pattern will be replaced with the referenced ticket number (e.g. 12345), so \s*#%s+\s+.* will be evaluated as \s*#12345+\s+.*.
  • (?:\n|[^#])*#%s(?:\D|$) matches ticket references in the form #xyz anywhere in the commit message.
    See comment:5:ticket:7884

In version 1.2 of the plugin, the pattern is configured using the CommitTicketUpdater options.

Version 0.12 requires granting TICKETLOG_VIEW permission for the change log to be visible. The permission was redundant with CHANGESET_VIEW, so it was removed in version 1.0. In version 1.0 and later the ticket log will be visible to users that have been granted CHANGESET_VIEW.

The equivalent of TICKETLOG_VIEW can be implemented using AuthzPolicy by selectively granting CHANGESET_VIEW on the ticket realm. For example, to only allow authenticated users to see the ticket log:

[ticket:*]
authenticated = CHANGESET_VIEW
* = !CHANGESET_VIEW

Note that the changeset links in the log will be disabled if the user doesn't have CHANGESET_VIEW for the changeset realm (or coarse-grained CHANGESET_VIEW).

Recent Changes

16848 by rjollos on 2017-10-05 04:45:12
TracTicketChangelog 1.2.0dev: Require CHANGESET_VIEW

This revises r14227, as CHANGESET_VIEW is more appropriate
than LOG_VIEW.

Refs #11821.

16847 by rjollos on 2017-10-05 04:44:53
TracTicketChangelogPlugin 1.0.1: Require CHANGESET_VIEW

This revises r14227, as CHANGESET_VIEW is more appropriate
than LOG_VIEW.

Refs #11821.

16780 by rjollos on 2017-08-27 06:19:54
TracTicketChangelog 1.2.0dev: Make compatible with Trac 1.3.2+ with Jinja
(more)

Author/Contributors

Author: richard
Maintainer: Ryan J Ollos
Contributors: hasienda, jun66j5

Last modified 6 weeks ago Last modified on Oct 5, 2017, 4:46:40 AM

Attachments (1)

Download all attachments as: .zip