• Increase font size
  • Default font size
  • Decrease font size
The great thing about a computer notebook is that no matter how much you stuff into it, it doesn't get bigger or heavier.
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.
Tejas  - Add list of user for permission   | |2017-04-18 16:43:09
For pre-revprop-change, I don't want all user to make changes. But a specific
list of users.
User list should more easy to maintain. Like you have an array.
Simply modify it i.e. either add or remove any user and script will work.
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."