tags:

views:

2929

answers:

4
svn co svn+ssh://myhost/path/projectname/trunk projectname

[...]

svn: Failed to add directory 'projectname/test/.svn': an unversioned 
  directory of the same name already exists

How is that possible??

I'm checking out into an empty dir.

Same error checking out to Windows and OS X.

+2  A: 

Are you sure it is empty and that .svn doesn't exist? Have you tried not giving it projectname and instead moving into that dir and checking it out?

docgnome
Yes 100% and yes tried.
Ethan
+2  A: 

If you're absolutely certain that the directory you're checking out into is empty, you may want to see if the repository contains directories with the same name using different capitalization. This sometimes happens when the host OS for the repository is Linux. Sometimes this causes problems when the working directory FS isn't case-sensitive.

Jacob
Thanks, but getting same error on OS X.
Ethan
@Ethan The default FS for OS X is _not_ case sensitive. (Unless that has changed recently)
docgnome
Wow, you're right.
Ethan
The case sensitivity of the SVN server doesn't matter. The SVN repo structure itself is case-sensitive on all platforms. You only run into trouble when you've done case-insensitive things to a working copy and then committed it (i.e. from windows, or, apparently, OSX, which is news to me).
rmeador
+2  A: 

If you've previously checked out into this directory, there could be a hidden .svn folder (folders prefixed with dot are the equivalent of hidden in Linux/OSX)?

Does the same problem occur in another recently created folder?

Jon
Yes. Create a new dir, cd in, try to check out, same error.
Ethan
+7  A: 

I may have seen this problem before when somebody had committed the .svn directory itself to the repository. Thus, when trying to create the working directory, the versioned .svn directory couldn't be created because the working directory already had its own .svn directory.

Jacob
Shouts of joy! You nailed it. All is well now.
Ethan
@Ethan: since this is your solution, I'm wondering what version of SVN you're running? SVN doesn't allow the .svn folders to be committed, except for a brief run of builds with a bug in it somewhere in the 1.5.x series, if memory serves. You might want to upgrade to the latest.
rmeador
@Jacob, @Ethan: Any ideas how to fix the problem? http://stackoverflow.com/questions/1028908/how-can-svn-co-give-a-directory-already-exists-error
Patrick McElhaney
@Patrick, try doing a `svn delete` on the repository URL of the .svn directory.
Jacob