The following is an example of a problem I've had with Subversion on a number of occasions. The problem arises because a versioned directory (working copy) contains an unversioned resource/directory. This prevents subversion doing anything with the resources, as in the following example:
steph@dimwit:java # ls
com
steph@dimwit:java # svn revert -R com
svn: Working copy 'com' locked
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
steph@dimwit:java # svn cleanup com
svn: 'com/opencms' is not a working copy directory
steph@dimwit:java # cd com
steph@dimwit:com # svn add opencms
svn: Working copy '.' locked
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
steph@dimwit:com # svn status
L .
~ opencms
If you type svn status you'll probably see some resources preceeded with a tilda. This means that the versioned item is obstructed by some item of a different kind (i.e. an unversioned one). Some of the other resources may be locked too (indicated with a capital L).
Unfortunately, the only solution I know of is to replace the unversioned resource with the latest from the repository. If it's a directory this will mean restoring the directory and everything it contains. Of course, this means you will loose all versioning since your last commit.
- Backup the unversioned resource by renaming it. For the above example, I'd rename the opencms directory to opencms.bak with mv opencms opencms.bak.
- Clean up the working copy with svn cleanup.
- Update up the working copy with svn update, to make sure it's up to date.
- Remove any references to the unversioned resource from the .svn/entries file. You may have to do this as root. For the above example I'd remove the entry like <
- Remove any .svn directories from the backed-up resource. You can do this for the current directory (and all subdirectories) with find . -name .svn -print0 | xargs -0 rm -rf. For the above example it'd be find ./opencms.bak -name .svn -print0 | xargs -0 rm -rf.
- Rename the backed-up resource to what it should be. For the above example this would be cp opencms.bak opencms (note that I copied it rather than moving it - always best to maintain a backup just in case).
- Add the resource to version control as usual. For the above example, svn add opencms.
- If all has gone well, delete the backed-up resource. Even better, move it somewhere else, out of the working copy. Hopefully you'll never need it again.