Orange is my favorite color

TortoiseSVN Screen grab with Trac integrationI searched like crazy and couldn’t find this information very easily anywhere so here’s the documentation. Many subversion clients, like TortoiseSVN, look for bugtraq properties in your repository. When it sees these properties, in the case of TortoiseSVN, it adds a new box to the UI when you’re committing code changes that allows you to enter a ticket number you want to close/reference.

You can also run regular expressions to open up the language you can use to link to include things like “closes”, “fixes”, “re” and so forth, followed by a #<ticket number>.

bugtraq:logregex = '(?:closes|fixes|addresses|references|refs|re)?(#[0-9]+(?:(?:[, &]+| *and *)#[0-9]+)*)
(\d+)'
bugtraq:number = 'true'
bugtraq:label = 'Ticket #:'
bugtraq:url = 'http://yourdomain.com/trac/ticket/%BUGID%'
bugtraq:message = 'Ticket #%BUGID%'

Note that your Trac URL needs to be the URL where you view a ticket. So just log in to your Trac install, view a ticket and copy the URL. Replace the actual ticket number at the end with %BUGID% and you’re done. You can add these from TortoiseSVN by right-clicking and choosing “TortoiseSVN” -> “Properties”. Be sure to apply them recursively but note you can’t set them on a directory created from svn:externals!

Enjoy!

3 Comments

  1. Orange is my favorite color » Blog Archive » Managing third-party software with Subversion said:

    on October 12, 2007 at 12:32 pm

    [...] the heels of my post yesterday, I want to share a strategy I’ve recently started using to manage third party [...]

  2. Corey Trager said:

    on November 17, 2007 at 9:43 am

    Here’s some more documentation on this, from the TortoiseSVN folks:
    http://tortoisesvn.net/issuetracker_integration

    I happen to be the author of a free open sourceissue tracker with Subversion integration like Trac’s integration, BugTracker.NET

    I include with my distribution a Windows batch file that sets the “bugtraq” properties:

    svn propset -R bugtraq:label “BugTracker.NET ID:” .
    svn propset -R bugtraq:url “http://127.0.0.1/btnet/edit_bug.aspx?id=%%BUGID%%” .
    svn propset -R bugtraq:message “bugid: %%BUGID%%” .
    svn propset -R bugtraq:number “true” .
    svn propset -R bugtraq:warnifnoissue “true” .
    svn commit -q -m “Added BugTracker.NET properties to the repository”

  3. Cristi Harjoi said:

    on February 20, 2008 at 8:24 am

    Thank you both! :)

    I’ve managed to integrate trac and subversion running on SME server with the following batch file (takes local path and trac project name as variables)

    @echo off
    svn propset -R bugtraq:label “Ticket #:” %1
    svn propset -R bugtraq:url “https://127.0.0.1/%2/%%BUGID%%” %1
    svn propset -R bugtraq:message “Ticket #%%BUGID%%” %1
    svn propset -R bugtraq:number “true” %1

    example: integrare.bat d:\testsvn test_svn

    takes the pain out of right-clicking in tortoisesvn :)

{ RSS feed for comments on this post}