Domanda

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
È stato utile?

Soluzione

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!

Altri suggerimenti

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

I had this same issue and I went into the file folder where the issue was occurring and right clicked on the file and said TortoiseSVN --> add. Then a dialog box came up saying the file already exists and would I like to

1) Case has changed 2) Add the file (cause problems with windows)

I of course picked #1 and then refreshed the status in VS and it fixed the issue. I then committed the changes and I was back to normal.

In Windows Explorer, navigate to the folder where the files where originally located (before they were moved/renamed)

Right click in the folder and access your Repo browser from the Subversion menu.

Drag and drop the original files from the Repo back into your project folder.

In Visual Studio, open "Working Copy Explorer" and navigate to the directory where you just dragged and dropped the files.

You should see red "x"s next to the name of the files indicating that they have been deleted.

Select all the files and right-click on then, then choose "Add to Pending Changes"

After that you should be able to commit your changes.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top