I’ve been using Subversion for a while now to manage the source code for my hobby projects. I like it, it is easier to use than CVS and it doesn’t trash your files like Visual Source Safe does. Also there is the very excellent Tortoise GUI to make it even nicer.
However, Subversion has one REALLY annoying problem. About once a month it just freezes up solid and refuses to commit any files. It has never lost any of my data but I think I’ll stick to CVS for my professional work.
Anyway before this turns into a rant, the purpose of this post is to write down the magical incantations to un-wedge Subversion so that next time it freezes I can just read my own blog rather than spending half an hour trying to figure it all out again
First shut down the web server
# /etc/init.d/apache2 stop
Then run either the Berkely recovery utility or the Subversion recovery utility depending on which component has frozen - or just run both. Here’s the commandline for Subversion recovery:
# svnadmin recover /home/subversion/<project-name>
and here’s the Berkely recovery commandline:
# db4.2_recover -c -v -h /home/subversion/<project-name>/db
Then adjust the permissions on all the files so that the web server can read and write them
# cd /home/subversion/<project-name>
# chown -R www-data.www-data *
And finally we can fire up the web server again.
# /etc/init.d/apache2 start
PS. I’m running Debian Etch Beta and using Apache2 as my web server. This procedure may be slightly different on other configurations. YMMV.