So far, it\’s RoR

Ruby on Rails, PostgreSQL, SVN, etc….

Changing a revision property in Subversion

Posted by Chirag Patel on July 22, 2007

I’m using Subversion and needed to change a revision property (in my case, the log message) of a particular revision of the code. When I tried to do it with TortoiseSVN (Show log > Right click on a revision > Edit Log Message), I got the following error message:

DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent

Basically, Subversion doesn’t allow you to modify log messages because they are unversioned and will be lost permanently. They don’t want you screwing things up by accident! Therefore, you have to set up a hook script that the Subversion server will invoke when you try to change the log message in TortoiseSVN. In the case of log messages, you need to set up a pre-revprop-change script. There are other ‘hooks’ such as post-commit which allows you to run some custom stuff after you’ve made a commit. These hooks are located in the hooks subdirectory of the Subversion repository directory on your server. Inside that directory, there are a bunch of template scripts (e.g. pre-revprop-change.tmpl) that can be modified to be used for your particular repository. If you’re running the Subversion server on UNIX, setting up the pre-revprop-change script (so that log messages are allowed to be modified) can be done like this

  • Go to the hooks directory on your Subversion server (replace ~/svn/reponame with the directory of your repository)

cd ~/svn/reponame/hooks

  • Remove the extension

mv pre-revprop-change.tmpl pre-revprop-change

  • Make it executable (cannot do chmod +x!)

chmod 755 pre-revprop-change

Now try modifying the log message again.

5 Responses to “Changing a revision property in Subversion”

  1. suls said

    thanks boy! the stupid renaming was the hint i needed =)

  2. Elrinth said

    Thanx a bunch, it’s annoying cause I tend to want to add stuff to my log every now and then. :)

  3. thoward37 said

    Here’s a quick batch file, if you’re running windows…

    @ECHO OFF

    if /i not [%4] == [svn:log] goto EXIT_FAIL

    if /i not [%5] == [M] goto EXIT_FAIL

    exit /b 0

    :EXIT_FAIL
    echo Only svn:log revision properties may be modified.
    exit /b 1

  4. jp said

    Hi Chirag,

    I put the pre-revprop-change.bat script under hooks dir, but still getting the “DAV request failed” message. Is it b/c I’m not issuing the command at the cmd prompt but using TortoiseSVN to edit the log? I just put “@exit 0″ in the script to see if even that works but to no avail.

    Any help is appreciated.

    Thanks,
    Jay

  5. jp said

    Actually, you can disregard my question. I realized that I had put the script under the wrong hooks dir. Thanks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: