Changing svn author property

Somehow managed to commit something under the wrong username? Want to know how to change it? It took me some googling to find out how, so that's why I put everything I found on one page.

$ svn propset --revprop -r revision_number svn:author your_username

You might get something like this:

svn: Repository has not been enabled to accept revision propchanges;
ask the administrator to create a pre-revprop-change hook

To solve that you need to be administrator of the svn repo: if you're not, you can't follow the next steps.

Go to the 'hooks' directory in your repository (eg. /var/svn/my_repo/hooks/), copy pre-revprop-change.tmpl to pre-revprop-change, edit the pre-revprop-change file to make sure setting the author is enabled (or see below), make the script executable (chmod +x pre-revprop-change) and you're done.

If you can't figure out how to change the pre-revprop-change file to allow authors, just creating a new file with the name pre-revprop-change and the following contents should work:

#!/bin/sh

Don't forget the chmod step though.

If you're using trac, make sure you use trac-admin resync after the svn propset.