Interfacing Subversion and Mercurial to Spiceworks

I keep our web site source files, stored procedures, and assorted programs in a source control management(SCM) program called Subversion. Since I am a small shop I track my trouble tickets using Spiceworks. My normal work flow is to enter the trouble ticket into Spiceworks and then start working on the problem. When I am finished with the problem I commit the files to the SCM and close the trouble ticket. To make life a little easier with future problems, I include a reference to the Spiceworks trouble ticket in the Subversion commit message. This could be a text version of trouble ticket number but I prefer a little nicer web interface so I implemented the bugtraq interface. This gives me a click-able link in the log that will bring up the original trouble ticket in a web browser window. This can be handy when you are troubleshooting a file that has some modification history. Implementing the bugtraq interface is pretty simple. You add two properties on your subversion repository, bugtraq:message and bugtraq:url. I set my parameters on the trunk folder properties. I set the message parameter to "Issue : %BUGID%" and the url parameter to "http://svrdev1:9675/tickets/list/all_tickets#ticket_id_%BUGID%". If you are planning to copy my parameters you should omit the double quotes and change the "svrdev1:9675" to your Spiceworks host name and port number.

If your SCM is Mercurial you can implement the bugtraq interface using these instructions, http://www.offroadcode.com/2010/10/5/better-issue-tracking-with-tortoisehg-and-kiln.aspx. The instructions are for a different SCM, Kiln, but these instructions work for any SCM you access via a url. In this case the issue link in the issue tracker changed to "http://svrdev1:9675/tickets/list/all_tickets#ticket_id_{1}".  There are several valid formats you could use. Just look at the regular expression used in setting it up for details. I used "(?i)(?:case|bugzid|Issue|#)\s*:?\s*(\d+)" for my Issue Regex. When you browse the log you should find the "Issue : 619" is an underlined, click-able link to your SCM trouble ticket.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.