Eric Leschinski
Eric Leschinski

Reputation: 153822

svn, can't remove a directory

I am on Fedora 17 trying to use svn version 1.7.6

I have created a repository at /home/el/svnworkspace and I checked out a working copy in /workspace

I am getting this error when I use the command:

[root@defiant workspace]# svn remove TestProject --force

Gives the Error:

svn: E155035: '/workspace/TestProject' 
              is the root of a working copy and cannot be deleted

The error message is partially right, TestProject was a root before. But I deleted it and now /workspace the root. So somehow it is confused. I no longer want TestProject to be a root, and I want workspace to be the root. svn is confused, and I want to unconfuse it, maybe one of you know the proper wizard incantation to remove /workspace/TestProject as a root of a working copy? I just want it to be a normal folder again.

Perhaps the only way for me to fix it is to blow everything away and re-add everything. Maybe a resident wizard knows a better way.

Upvotes: 4

Views: 13123

Answers (2)

Eric Leschinski
Eric Leschinski

Reputation: 153822

I was able to fix the problem with these steps:

Make sure nothing has a lock on the files in question, for me: Eclipse IDE. So close any IDE's or Editors that might have a lock on the file.

Make sure you have write permissions on the working copy as well as the repository.

chmod -R 775 /workspace
chown -R your_user_name.your_user_name 775 /workspace
chmod -R 775 /home/el/svnworkspace
chown -R your_user_name.your_user_name 775 /home/el/svnworkspace

If you are using a program with a GUI like rapidsvn to add/remove/commit files, turn that off and use only the command line svn command. The GUI might have been have been conflicting with what I was trying to do on the command line.

finally, I think this part is what fixed my problem:

Go into the directory that I want to add, but won't add. Manually rm -rf all the .svn files in it. Then try to svn remove it then svn add it. It successfully adds and then I could commit it and all is well.

Upvotes: 1

user1277476
user1277476

Reputation: 2909

SVN does get confused about directories sometimes.

Unless you have a lot of changes you need to check in, I suggest removing the hierarchy in question from your filesystem (rm -rf), and checking out again starting from wherever looks appropriate. This always seems to handle SVN directory confusion for me.

Upvotes: 6

Related Questions