13.3. Tying Revisions to Issue Tracking
Issue tracking and development go hand-in-hand, so it makes sense to have your issue-tracking system and Subversion work together. With a little bit of forethought and setup, you can do just that. For most issue-tracking systems, there are ways that they can control external systems, and vice versa. So, by hooking Subversion and your issue-tracking system up to each other, you can automate a lot of the drudgery that is involved in keeping both systems in sync.
13.3.1. Issue-tracking Properties
The TortoiseSVN GUI interface for Subversion has an interesting extra feature that adds integration with bug tracking to Subversion. By setting certain properties on project directories, you can control how the TortoiseSVN interface is able to automatically query the user about issue-tracking information, and store it in a manner that allows the GUI to present bug-tracking data to the
This property allows you to specify a label for the text box that the Subversion client displays to ask you to enter an issue number to associate a revision with. If this property is left unset, the client displays some
This property is used to
For instance, if your bugtraq:message property is equal to this:
Associated issues: %BUGID%
Then a commit that is given the issue IDs 247 , 342 , and 771 will have the following line added to the end of its log message:
Associated issues: 247, 342, 771
This property is used to
This property is used to allow a Subversion client to present you with a link to the issues referenced by the log message. The value of this property is a URL, which contains
. Just like in the
property, this URL
Subversion revisions aren't always associated with a specific issue in your issue tracker, but for some projects, unassociated revisions are the exception, not the norm. If this is the case for your project, you may want to have the Subversion client warn the user if he doesn't enter an issue number when he commits. To turn that warning on, you have to set this property to true . If you don't want the warnings, just leave this property unset.
The default for adding the issue message to your log messages is to append the message to the end of the log. If you would rather have the message appear at the top of each log message, you can set this property to false . In either case, the message appears on its own line.
13.3.2. Automating Interaction with Issue Tracking
If you're up for a little bit of scripting, much of the Subversion issue-tracking interaction can be automated, which allows you to keep your issue tracking system more consistently in sync with your Subversion repository, as well as alleviate some of the drudgery of entering information into both systems.
Another option for integrating Subversion with issue tracking is the Trac project management system ( www.edgewall.com ). TRac provides a Web-based environment for managing projects, including an issue tracker and a wiki that integrate with a Web-based interface to Subversion. Log messages can directly reference issues (called tickets) and wiki pages (with links generated by Trac when viewing the log message from the Trac interface), and ticket/wiki pages can reference specific repository revisions (also with links). Trac even includes a post-commit hook script that allows you to automatically update the status of Trac tickets based on information provided in the log message. Figure 13.1 shows the Trac interface displaying its repository browsing screen.
Figure 13.1. The Trac repository browser.