Sunday, September 25, 2005

Usertags fun

I just spent the afternoon playing around with usertags and the other recent BTS changes. It looks like a really useful addition to debbugs, and I'm sure we'll see a lot of interesing uses pop up. I immediately went and used it to mark bugs that have been fixed in the aptitude SVN by using a quick-and-dirty Python script to extract them from the ChangeLog; with some help from AJ, I even came up with a URL that separates these bugs out from the completely unresolved ones.

So that was pretty easy. Having done this, the next logical thought was, of course, "if I can extract bug numbers from the ChangeLog on my computer, couldn't an SVN hook script do the same thing?" A bit of hacking around later, I now have a script that does exactly this. To use it, download it and (optionally) the sample configuration file, and then add the following line to your post-commit hook:

path-to-svntag.py "$1" "$2" path-to-svntag.conf

The script looks for text like "Closes: #nnnnnn" in a file called "changelog" and sends appropriate tagging messages to the BTS when it's spotted.