• Increase font size
  • Default font size
  • Decrease font size
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Home Development Code Change a SVN commit log message or date

Change a SVN commit log message or date

Most of the information stored in a SVN commit can be edited. This is the case of the message and date: edition of these values just require a simple hook.

Adding the pre-revprop-change hook to allow SVN properties edition

In your repository, create a file hooks/pre-revprop-change or simply copy file hooks/pre-revprop-change.tmpl. Then ensure read and execute rights are granted for everyone. This script will be executed whenever a property is changed. The script return value tells if a modification is allowed or not. Edit the file so it looks like:



if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:date" ]; then exit 0; fi

echo "Only svn:log and svn:date revision properties can be changed" >&2
exit 1

Caution! This script allows anyone who has write access to the repository to change date and log. You may want to restrict this access by adding some check to the $USER value

Editing a SVN commit log or date

From your workcopy, you can edit a SVN commit log with:

~$ svn propset --revprop -r 25 svn:log "Bugfix 007."

To edit a date, just check the date format first:

~$ svn propget svn:date --revprop -r1

Then edit the svn:date property to change the date:

~$ svn propset svn:date --revprop -r1 "2007-04-18T22:00:19.308764Z"

Add New Search
valmein   | |2011-05-03 10:29:51
administrator disabled it.. how to enable it back?
pwet   | |2011-05-03 10:45:04
Adding a SVN hook requires you to have a privileged access to the SVN
repository... So you have to be an administrator (or ask your administrator) to
allow this kind of property change.
Write comment
[b] [i] [u] [url] [quote] [code] [img] 
Please input the anti-spam code that you can read in the image.

3.26 Copyright (C) 2008 / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."