SVN Error – Not a working copy

svn

Recently our svn server was changed and we did a svn switch.

Since the working copy had a huge amount of unversioned resources, the working copy got locked and we started switching folder by folder for all folders under svn, which works perfectly fine.

But at the top most level of the repository, when I try to update files, I get the svn: Working copy '.' locked error and cleanup is not helping either. When I do cleanup, I get errors like these – svn: 'content' is not a working copy directory

Fresh checkout is NOT an option at all. Are there any other ways to cleanup and release the locks and do the switch completely ?

EDIT:
The last paragraph in JesperE's answer

If you get a "not a working copy" when
doing a recursive "svn cleanup" my
guess is that you have a directory
which should be a working copy (i.e.
the .svn directory at the toplevel
says so), but it is missing its own
.svn directory. In that case, you
could try to just remove/move that
directory and then do a local update

seems to be the solution to the problem in the repository. I have identified those folders and did a fresh checkout of those specific folders alone and wow, the locks are released in the subsequent cleanup! Thanks a lot JesperE !!

But, I still cannot figure out the svn switch error which now reads something like,

svn: The repository at
'svn://repourl/reponame/foldername'
has uuid 'm/reponame', but the WC
has 'b5b39681-0ff6-784b-ad26-2846b9ea8e7d'

Any ideas ?

Best Answer

If you get a "not a working copy" when doing a recursive svn cleanup my guess is that you have a directory which should be a working copy (i.e. the .svn directory at the top level says so), but it is missing its own .svn directory. In that case, you could try to just remove/move that directory and then do a local update (i.e. rm -rf content; svn checkout content).

If you get a not a working copy error, it means that Subversion cannot find a proper .svn directory in there. Check to see if there is an .svn directory in contents

The ideal solution is a fresh checkout, if possible.