wiki:OneRepoManyTracSitesPatch

One Repository Commit Can Update Tickets From Multiple Trac Sites

Description

This plugin allows you to update tickets on multiple Trac sites from a single commit comment in a repository.

We have multiple repositories and multiple Trac sites. For example, consider the commit:

Updated the foo to fix the bar.

Closes #71
See #42 as well

Our problem was that ticket 71 existed in TracSiteA, and ticket 42 existed in TracSiteB. On TracSiteA, the comment would be added to ticket 71 and 42, but ticket 42 on TracSiteA had nothing to do with the issue. Similarly on TracSiteB, the comment would be added to ticket 42, with an unknown link to the non-existent ticket 71 on that site.

This patch enables our users to commit as follows:

Updated the foo to fix the bar.

Closes #71@TracSiteA
See #42@TracSiteB as well

The comments only get added to TracSiteA ticket 71 and TracSiteB ticket 42.

This patch also converts the comments so that the links take the user to the correct place. For example, the source of the comment on ticket 71 of TracSiteA would appear as follows:

Updated the foo to fix the bar.

Closes #71@TracSiteA
See [[http://mytracsite.com/TracSiteB/ticket/42|#42@TracSiteB]] as well

...and the source of the comment on ticket 42 of TracSiteB would appear as follows:

Updated the foo to fix the bar.

Closes [[http://mytracsite.com/TracSiteA/ticket/71|#71@TracSiteA]]
See #42@TracSiteB as well

This way links created in the comment don't take our users to confusing places.

Bugs/Feature Requests

Existing bugs and feature requests for OneRepoManyTracSitesPatch are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Source

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

Installation

Apply the patch to tracopt/ticket/commit_updater.py.

Update your trac.ini file. Following the scenario in the description:

TracSiteA's ini has the following:

[ticket]
commit_ticket_update_name_is_required = true

[commit_ticket_update_inversions]
TracSiteB = http://mytracsite.com/TracSiteB/ticket/

And TracSiteB's ini has the following:

[ticket]
commit_ticket_update_name_is_required = true

[commit_ticket_update_inversions]
TracSiteA = http://mytracsite.com/TracSiteA/ticket/

Recent Changes

14962 by wrightnn on 2015-10-20 15:14:36
Hacked to support multiple trac sites from a single repository commit.
14961 by wrightnn on 2015-10-20 15:13:24
Original file from Trac 1.0.9
14960 by wrightnn on 2015-10-20 15:08:11
New hack OneRepoManyTracSitesPatch, created by wrightnn
(more)

Author/Contributors

Author: wrightnn?
Maintainer: Nathan Wright?
Contributors:

Last modified 16 months ago Last modified on Aug 6, 2016, 10:22:29 PM