views:

135

answers:

2

I have a c# solution with a bunch of projects. One of them resides in a folder that does not match the project name (for reasons I can't know since the guy who did it left before I arrived). My beloved ReSharper plugin goes all grumpy on me and draws blue swiggly lines under the namespace declarations and groans: "Namespace does not correspond to file location, should be..." And I agree. But the file location is wrong, not the namespace.

How can do I change the folder name of the project without breaking subversion integration and whatnot? I'm using the AnkhSvn pluging, but also have TortoiseSVN installed and would be comfortable to use either as long as the solution stays sane.

Any tips?

+2  A: 

In TortoiseSVN you have a function to move versioned items. If you drag the folder using the right mouse button to the location where you want to move it, you will get a menu when you drop it with several options using SVN methods of moving or exporting it. Then SVN will have control on what's happening.

Edit: In your case, you might just want to rename the folder using Right click: TortoiseSVN->Rename...

awe
But won't that confuse Visual Studio?
Daren Thomas
Probably, but it will only be in the .sln file and maybe in the .proj files referencing it. You can manually change it in Notepad. You might also want to delete .suo file for the solution and .user files for the projects. These are only auto generated files keeping track of what you have open in VS. Just make sure you don't have it open in Visual Studio when you do this.
awe
+2  A: 

Just rename the folder. This should work in all cases except for case-only changes and AnkhSVN will handle the hard work.

For this last category you can rename to a different name, commit... update all working copies (e.g. wait a day).. and then rename to the final name. (Case only renames are not supported by Subversion)

It looks like Subversion 1.7 will support case only renames, but it will take some time for that to be released.

Bert Huijben