Renamed file, now SVN not allowing me to commit?

2020-02-17 06:20发布

I'm developing a ColdFusion website using Aptana. We're using SVN for version control.

I renamed a few files and am now trying to commit one of them, but I'm getting the following error:

'SVN Commit' has encountered a problem.
org.apache.subversion.javahl.ClientException: Illegal target for the requested operation
svn: Commit failed (details follow):
svn: Cannot commit 'R:\myPath\My-New-File-Name.cfm' because it was moved from 'R:\myPath\My-Old-File-Name.cfm' which is not part of the commit; both sides of the move must be committed together

This seems to indicate that I need to commit both the previous file (that was renamed) and the new renamed file together. How can I commit a file that no longer exists...?

标签: svn commit
10条回答
叛逆
2楼-- · 2020-02-17 06:48

Add a file with old name and do commit, Then delete the file again do commit.

查看更多
我欲成王,谁敢阻挡
3楼-- · 2020-02-17 06:49

In eclipse with subversion, I was able to work around this confusing error by doing a Team->synchronize at a high enough level folder in the project that it encompassed both the old and new file names and locations. If you moved and renamed your files or if you can't figure out what precisely is going on, it can't hurt to synchronize at the very top level of your project.

When I did this, the old versions of the renamed files showed up in the synchronize view. Once I used "override and commit" on them, they disappeared again. At this point, the new ones will finally commit properly.

查看更多
家丑人穷心不美
4楼-- · 2020-02-17 06:53

For Visual Studio 2015, I tripped over a fix for Ankh SVN. In my case the error resulted from renaming a "Form1.cs" during development (and perhaps moving it). That caused issues with the old and new .resx files.

  • Highlight the project in the Solution Explorer to open the pending changes view window,
  • Choose File > Subversion > Pending changes
  • Uncheck the Path
  • Check the two or more files that subversion needs. If "new" one isn't in the list change its contents in a non-desturctive way so it will appear in the list.
  • Run commit.

Hope this works for you.

查看更多
一夜七次
5楼-- · 2020-02-17 06:54

Various clients seem to handle this better than others..

AnkhSVN for Visual Studio encounters this error and can't deal with it.

TortiseSVN (shell extension) works though - it knows to delete the old file and add the new one.

So if you're on Windows an easy way to work around this is to use TortiseSVN from Explorer to do a commit on the directory (which deletes the old file name and adds the new one).

查看更多
登录 后发表回答