Reputation: 3129
Recently, I have committed some code into Tortoise SVN by providing some commit message like Added two java files test.java and test1.java. After committing the code, I realized that I wrote a wrong commit message and correct one should be Update two java files test.java and test1.java. Is there a way to change the commit message?
Upvotes: 2
Views: 131
Reputation: 24709
Yes there is, but the administrator of your Subversion repository must have it enabled - I believe it is disabled by default. If it's already enabled, from TortoiseSVN -> Show Log, simply right click your revision in the log and choose "edit log message". If it is not enabled, this operation will fail.
This functionality relies on the pre-revprop-change repository hook. Quoted from the SVN 1.7 manual:
The pre-revprop-change hook is run immediately prior to the modification of a revision property when performed outside the scope of a normal commit. Unlike the other hooks, the default state of this one is to deny the proposed action. The hook must actually exist and return a zero exit value before a revision property modification can happen.
In your repository's "hooks" directory (on the Subversion server), a platform-appropriate script must be present and, as stated above, return a zero exit value. For instance, you may want to allow the user who made a commit to edit their commit log message later.
Here's an example pre-revprop-change batch script for Windows on someone's blog. I did not write this script, but we've used this in our environment so I can confirm it works for me.
Upvotes: 4