Log messages are kept in the repository as properties attached to each revision. By default, you cannot edit the log message property (svn:log) once it is committed. That is because changes to revision properties (like svn:log) cause the property's previous value to be permanently discarded, and Subversion tries to prevent you from doing this accidentally. However, there are a couple of ways to get Subversion to change a revision property.
Using Method 1: Enabling revision property modifications
Method 1 to resolve this issue is to create a hook called "pre-revprop-change". The "pre-revprop-change" hook has access to the old log message before it is changed, so it can preserve it in some way, such as by sending an email.
Once revision property modifications are enabled, you can change a revision's log message by passing the --revprop
switch to svn propedit
or svn propset
, like either one of the following examples:
$svn propedit -r N --revprop svn:log URL
$svn propset -r N --revprop svn:log "new log message" URL
In the previous example, N
is the revision number whose log message you wish to change, and URL
is the location of the repository. If you run this command from within a working copy, you can leave off the URL
.
Using Method 2: svnadmin setlog
IMPORTANT: Perform this method by referring to the repository's location on the filesystem. You cannot modify a remote repository using this command.
$ svnadmin setlog REPOS_PATH -r N FILE
In the previous example, REPOS_PATH
is the repository location, N
is the revision number whose log message you wish to change, and FILE
is a file containing the new log message. If the "pre-revprop-change" hook is not in place, or you want to bypass the hook script for some reason, you can also use the --bypass-hooks
option. However, if you decide to use this option, be very careful. You may be bypassing such things as email notifications of the change, or backup systems that keep track of revision properties.
Have questions? Please contact Customer Success at support@assembla.com.