views:

30

answers:

3

After a big refactor involving creating new projects and moving files around between them, I am having a big problem committing a folder (and its contents) which was moved.

The folder currently shows as modified (i.e. red overlay with exclamation mark). When I try to commit it, I am told I need to update the working copy first.

When I try to update it, I get 'Target path '[location]' does not exist'. Worryingly, this is the location in the structure that the folders existed BEFORE I moved them. It seems to be trying to update them from the wrong location.

So, I'm stuck in this 'can't commit, can't update' loop and I have no idea how to get out of it.

I think that what must have happened is that I have copied the folder including the .svn folder inside it into the new location. The subversion stuff in the .svn folder still thinks it needs to hook up with the old location when talking to the repository.

Can anyone help?

Thanks

David

A: 

Sometimes forcing an update works

svn up --force .

On the command line

krico
A: 

In this case, I solved the problem by deleting the .svn folders in the folder. This meant they just appeared like new folders to Tortoise, and I was able to commit them.

David
A: 

Glad you were able to solve this. I am guessing that you had to "svn add" the folder again after deleting the ".svn" folder. This has the unfortunate side effect of blowing away the history for those files.

In the future, when moving things using Tortoise, you should remember its most forgotten feature: right-click-drag. You should get in the habit of using right-click-drag when moving versioned files and folders around with Tortoise, because right-drag allows you to "svn move", "svn copy", or "svn add" the files/folders you are dragging. The key to working with Tortoise (and all svn clients, for that matter) is to remember that standard file system operations will confuse the hell out of svn. Any operations you do on your files must be done via the corresponding "svn" actions so that svn knows to keep track of the changes and preserve the history of the files/folders.

If you work in an IDE, I would suggest using an svn plug-in for the IDE, because they tend to handle these issues very nicely for you. In MS land, there is VisualSVN, and in java land there is Subversive.

Stuart Lange
This is excellent advice. Thank you.
David