Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN: Cannot commit 'x' and 'y' as they refer to the same URL?

I'm trying to do a commit on my project and am running into the following error. Pay close attention to the path:

Commit failed (details follow):
Cannot commit both
'C:\Development\Project\branches\nextver\project\bin\com\companyname\blah\Foo.java'
and
'C:\Development\Project\branches\nextver\project\src\com\companyname\blah\Foo.java'
as they refer to the same URL

How in the world did this happen? I never had my source files in the bin path in Eclipse! What can I do to fix it? Please tell me there's something better than checking it out again and replacing all of the files. I have 191 Java files alone, not to mention resources and Eclipse files.

like image 367
jasonh Avatar asked May 27 '11 20:05

jasonh


3 Answers

I know it's over a year since you posted this, but this may help someone else. I've just gone through the same issue. I eventually traced it back to the project setup on Eclipse. In my case what happened is the build process within eclipse was "building"/copying ALL files in the source folder to the build folder. This caused the .svn directory from the source to be copied to the build folder and this is how Subversion gets mixed up. If you check the paths via RepoBrowser (I am using Tortoise in a Windows environment) the paths point to the correct directories (source and build), but if you run "svn info" from within the directory on your local machine you will find that the source and build directory point to the same URL (hence the message).

Once I realised the problem was within Eclipse and not specific to Subversion it was easy to search for a solution. You need to add "**/.svn/" to the source exclusions in the Java Build Path of the Source tab:

Project --> Properties --> Java Build Path.

like image 70
T.Fisher Avatar answered Nov 06 '22 21:11

T.Fisher


Try this:

Go to C:\Development\Project\branches\nextver\project\bin\ and delete .svn if you see one. And then try committing.

I think somehow stuff in the src including the .svn got copied to bin making both of them seem like they are from the same url in the server. Of course you don't want that. You may want to correct your build settings.

like image 30
manojlds Avatar answered Nov 06 '22 20:11

manojlds


The solution was to delete and ignore my bin dirs from my local copy. Again. Tortoise SVN seemed to forget that I had done that before and I didn't notice that the bin dirs had crept in, leading to this problem. After resolving several other problems it threw in my path (source trees in conflict, etc.), I managed to get it to commit.

I did first try deleting the .svn folder from the bin dirs, but all that did was cause it to complain that the bin dir was no longer under source control and halt.

like image 35
jasonh Avatar answered Nov 06 '22 19:11

jasonh