Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AnkhSVN - Renaming (changing its case) a file inside Visual Studio

When I try to rename the file Class1.cs to class1.cs inside VS and then try to commit the project via ankhSVN I get two errors:

[...\Class1.cs] is already under version control.


The commit processing can't commit [...\Class1.cs], because it is not managed by Subversion. Maybe you should refresh the status after applying changes with another client?

I then deleted class1.cs, added a new class1.cs, tried to commit it but received the same errors. How can I get around this problem so I can change the case and still be able to commit? I know that Windows is case insesitive but shouldn't there still be a (easy) way to do this?

After playing a little more with ankhSVN and then trying to commit the file with its original name (so i at least have it back in version control) I got:

An internal error occured. Commit failed (details follow):  Cannot commit: '[...]\Class1.cs' because it was moved to '[...]\class1.cs' which is not part of the commit; both sides of the move must be committed together

SharpSvn.SvnIllegalTargetException...

I'm using

  • Windows 7 64
  • Visual Studio 2012
  • TortoiseSVN 1.8.4
  • ankhSVN 2.5.12266.473
like image 557
user764754 Avatar asked Jan 20 '14 16:01

user764754


2 Answers

You can do this with in Visual Studio + ankhSVN.

  1. Copy/Paste the file you want to rename and paste it in the same folder

  2. Rename the file from "Copy Of xxxx" to the desired new name.

  3. Delete the old file

  4. right click the folder both files were in and perform the svn commit operation on the entire folder.

Thats it!

like image 176
Selwyn Avatar answered Nov 15 '22 23:11

Selwyn


I fixed it with the following steps. I still hope there is an easier way.

  • I made sure no class1.cs or Class1.cs was part of the project anymore using VS.
  • Now inside Windows Explorer:
    • I commited Class1.cs using TortoiseSVN (because I deleted it, see question)
    • I used the Rename Option from TortoiseSVN to name it class1.cs
    • I commited class1.cs using TortoiseSVN
  • Now inside VS I showed all files, included class1.cs in the project and commited the project via ankhSVN
like image 38
user764754 Avatar answered Nov 15 '22 22:11

user764754