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:

#!/bin/sh 

REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5"

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
2007-04-17T22:00:19.308764Z

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

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

Comments   

# valmein 2011-05-03 10:29
administrator disabled it.. how to enable it back?
Reply
# pwet 2011-05-03 10:45
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.
Reply
# Add list of user for permissionTejas 2017-04-18 16:43
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.
Reply