modify svn log for trac

When using trac with subversion, sometime I need to edit the subversion log. For example, I’ve got used to mention the trac ticket number in the log, thanks to the trac intergration, this is really handful. However once I made a typo on the ticket number, and it gets really annoying. So here is how I correct it:

First I need to modify the subversion log. They are stored in the db/revprops directory and are plain text files. But ofcause we are not suppose to modify that directly :) The recommand way is through svnadmin like this:

svnadmin setlog repo_path -r revision_number new_log_file

But first I’ll need to setup pre-revprop-change hook for the repo. Simple, just cd to the hooks directory of the repo and copy pre-revprop-change.tmpl to pre-revprop-change.

Now if I do a “svn log”, The new log shows up. However, on the trac “browse source” page, the old log is still there. This is because trac made a copy of the logs in its database. And we need to sync them:

trac-admin trac_path resync

Note there is a ticket for trac to edit the log directly. Though not implemented yet.

Tags: , , ,

Post a Comment

You could use <code type="name"> to get your code colorized

Your email is never published nor shared. Required fields are marked *

Close
E-mail It