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
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.
RSS feed for comments to this post