Friday, February 11, 2011

Locked svn repository and you can't unlock or clean?

I discovered that I couldn't update my subversion repository, nor could I commit, revert or even run cleanup on it! The error I got was
"Working copy is locked, run cleanup on it to remove locks"
I was wondering what the hell had happened since I hadn't locked any files on purpose. 'svn unlock --force' didn't do the job so I had to try cleanup. But when running cleanup all I got was
"svn cleanup: can't find .svn/tmp/log. "
It seems to stem from some version problem, and all that is really needed is to create a .svn/tmp directory by hand. By running a little command on the shell, we fix the problem within seconds.

find . -iname '.svn' -exec mkdir {}/tmp \;

After creating all the '/tmp' dirs, just run 'svn cleanup' again, and it should be ok for an update or a commit.

Thanks to Kyle Cordes for the fix.

No comments: