Reputation: 1835
We use VisualStudio with SVN and VisualSVN.
I restructured the solution by moving (cut and paste/drag and drop) and renaming a lot of files.
Never heard a complaint from VisualSVN, now it is time to commit it refuses to do so:
Commit failed (details follow):
Error: Cannot commit 'C:\Sources\xxx' 'xx\Model\Model.cs' because it was moved to
'xxx\NewModel.cs' which is not part of the commit; both sides of the move must be committed together
That is correct neither file exists any longer at the given positions, and frankly I don't care.
I need SVN to store the solution as it is now. It is OK that I will not be able to trace change history for moved and/or copied files.
Is there a way to force the commit?
Upvotes: 3
Views: 2128
Reputation: 1322
Please click refresh button first, after refresh in commit package Visual Studio will be included delete and rename rules, needed for SVN
Upvotes: -1
Reputation: 2335
I ran into this exact problem over the past week while refactoring some code and renaming numerous files. I was able to correct the problem as follows:
TL;DR -- If SVN thinks a file is part of your project, but the file is missing from you HDD, it will give you this error. Simply revert the file to get it back on your drive. To clean it up, add the file back into your project and then delete it within VS to get everything in sync.
Upvotes: 1
Reputation: 30662
It seems that you get the error because you commit only the part of the move action. Moves in Subversion consist of svn copy
(to the new item location) followed by svn delete
(of the original item), so both sides of the move must be committed in one revision together.
I suggest following these steps:
Visual Studio | VisualSVN | Commit.... Make sure that both sides of the move you've performed are listed in "Changes made" list view and try to commit. Do you still get the same error?
If the first step fails, go to Visual Studio | VisualSVN | Windows | Pending Changes. Right-click the root node of your solution / working copy and choose Commit.... Still getting the error?
Go to Visual Studio | VisualSVN | Set Working Copy Root... and make sure that the working copy root points to the root of your solution's WC. Attempt to commit after this step.
Upvotes: 1