SVN add Error – Not a working copy

svn

I'm trying to create a new entry in subversion for development. This is based on a project which already exists in subversion. I don't want to have it based on that version, because that's for reference only and can't be changed.

I tried to export it using subclipse in sts/eclipse. However, when I import the top level project into sts/eclipse, the project structure isn't preserved.

The sts/eclipse project structure is preserved when I do a checkout. So I checked out the project to a different directory path. Then, using cywin's command line, I recursively removed all the .svn entries from the project with a "find.-name".svn"-execrm-rf{} \;"

However, when I attempt to add the new project into subversion, I get an "SVN add Error – Not a working copy" for the top level directory.

I've been checking/googling, and it this error occurs when an .svn file is missing for the directory. So, somehow subversion is still aware of this project despite the removal of all the .svn directories. If I go a level higher, I'm in the "workspace" for sts, and (I don't believe) there are .svn entries at that level.

Why does subversion think this is still a subversion project after I've removed all the tags? How can I get this checked-out directory added as a new entry into subversion?

Best Answer

I think this is what you are looking for:

From cygwin's command line:

  1. svn export the orignal project into a local folder (svn export is like svn checkout but it won't create all the .svn folders).
  2. svn add and svn commit that folder into subversion.

Here's another way that achieves exactly the same as above, but it's faster:

  1. svn branch the original project into a new location (directory). This creates a copy of the original project (directory) in the repository.
  2. svn checkout the branch into a local directory.

Now, if you don't want to keep a local copy of the original directory because you are only going to work on the new one from now on, then this is the fastest way to do it:

  1. svn branch the original project into a new location (directory). This creates a copy of the original project (directory) in the repository.
  2. svn switch your local copy of the original project (directory) to the new branch.