SVN - Not a working copy error

Paul M picture Paul M · Dec 15, 2008 · Viewed 87.9k times · Source

I'm pulling my hair out on this one.

I have a site which is version controlled using Subversion. I use aptana (eclipse, subclipse) to do the svn. I have been checking in and out files, updating etc and everything is fine. However the system we have been building has been adding its own files and folders.

When I try to commit these, it tells me <path> is not a working copy. If I try to do a cleanup then it gives the same error. I found I can manually add each file to version control but this throws the same error. Doing an update doesn't help, refreshing the workspace does not do anything either. Cleanup seems to die after the error and then the directory is locked.

I know you're supposed to add files using SVN, but how on earth do you work with generated files? How do I get around this "<folder> is not a working copy directory" error? How do I get Subversion to just look at the files and add them to its repository?

Answer

Sam picture Sam · May 5, 2009

We had this problem today when I tried to add a folder "A" in which I didn't have write permission (so it couldn't create the A/.svn folder).

Running svn status gave me a "~" next to folder A. Running svn cleanup said that parent of A was locked.

What ended up working was:

cp -r A A~    # backup, since A was not in the repo
rm -rf A      # removed locked directory
svn rm A      # remove A from pending commit
mv ~A A       # restore backup
svn add A     # re-add to pending commit
svn cleanup   # (had to cleanup several parent folders higher as well)