Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN - Not a working copy error

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?

like image 955
Paul M Avatar asked Dec 15 '08 12:12

Paul M


People also ask

What is svn working copy?

A Subversion working copy is your own private working area, which looks like any other ordinary directory on your system. It contains a COPY of those files which you will have been editing on the website. You can edit these files however you wish, in the usual way.

How do I find my svn working copy?

You can use the svn command line utility svn info from the working copy root directory. It will tell you revision, repository url and much more.

How do I copy a folder from one directory to another in svn?

The easiest way to copy files and folders from within a working copy is to use the right drag menu. When you right drag a file or folder from one working copy to another, or even within the same folder, a context menu appears when you release the mouse.


2 Answers

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) 
like image 86
Sam Avatar answered Sep 22 '22 17:09

Sam


If you want the generated files to be added to SVN, use svn add to recursively add them - this will make sure that all directories are part of the working copy, and all files and directories are added to SVN, and will be committed as part of the next svn commit.

However, often generated files and folders should not be added to SVN, since they are generated from the source files as part of a build. In this case, you should mark the with svn:ignore so that they are not part of the working copy.

like image 28
Avi Avatar answered Sep 23 '22 17:09

Avi