[[PageOutline(2-5,Contents,pullout)]] = 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 [trac:CommitTicketUpdater] options are used to configure the pattern. With the default option values, patterns such like `refs #1` and `fixes #2` will be matched. [[Image(ticketlog.png, border=2)]] Tested with Subversion, Mercurial and Git. See also TracTicketChangesetsPlugin, TicketModifiedFilesPlugin. === Mercurial For the Mercurial backend, since TracMercurial [t:#8417 does not support the repository cache] yet, you should install [http://github.com/maraujop/TracMercurialChangesetPlugin 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: {{{#!ini [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 [report:9?COMPONENT=TracTicketChangelogPlugin here]. If you have any issues, create a [/newticket?component=TracTicketChangelogPlugin new ticket]. [[TicketQuery(component=TracTicketChangelogPlugin&group=type,format=progress)]] == Download Download the zipped source from [export:tracticketchangelogplugin here]. The plugin is also available on ​[pypi:TracTicketChangelog PyPI]. == Source You can check out TracTicketChangelogPlugin from [/svn/tracticketchangelogplugin here] using Subversion, or [source:tracticketchangelogplugin browse the source] with Trac. == Installation You can install this plugin following the standard procedures described in [wiki:TracPlugins#InstallingaTracplugin]. 1. Uninstall TracTicketChangelogPlugin if you have installed it before. 1. Change to the directory containing setup.py. * (Optional): If you have Babel installed and would like to have translations available: {{{#!sh python setup.py compile_catalog -f }}} 1. If you want to install this plugin globally, you need to install this plugin to the Python path: {{{#!sh python setup.py install }}} 1. If you want to install this plugin to the Trac instance only: {{{#!sh python setup.py bdist_egg }}} Then copy the generated egg file to the Trac instance's plugins directory: {{{#!sh cp dist/*.egg /srv/trac/env/plugins }}} 1. Add the following to your `trac.ini` file: {{{#!ini [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 }}} 1. (Version 1.2) Upgrade the database and sync the `ticket-revision` table: {{{#!sh $ trac-admin $env upgrade $ trac-admin $env ticketlog sync }}} You must configure [TracRepositoryAdmin#Repositorycaching repository caching] and [TracRepositoryAdmin#ExplicitSync 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.[[br]]See comment:5:ticket:7884 In version 1.2 of the plugin, the pattern is configured using the [trac:CommitTicketUpdater#Configuration CommitTicketUpdater] options from the `[Ticket]` section of `trac.ini`. Note that in this case the plugin does not care if the the optional `tracopt.ticket.commit_updater.*` is actually enabled or disabled. It is enough if the configuration options are present. 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 [TracFineGrainedPermissions#AuthzPolicy AuthzPolicy] by selectively granting `CHANGESET_VIEW` on the `ticket` realm. For example, to only allow authenticated users to see the ticket log: {{{#!ini [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 [[ChangeLog(tracticketchangelogplugin, 3)]] == Author/Contributors '''Author:''' [wiki:richard] [[BR]] '''Maintainer:''' [[Maintainer]] [[BR]] '''Contributors:''' hasienda, jun66j5