解决Subclipse进行commit的时候出现 file out of date和remains in tree-conflict的方法

今天commit最新修改好的脚本到Google code的时候,由于网速问题中断了,再次提交的时候,Subclipse提示某某文档"file out of date".

于是一顿神搜,在官方网站的FAQ里找到一段解释:

I am trying to commit some changes and I am getting an error message about the transaction being "out of date". What does this mean and what should I do?

Whenever you see "out of date" in an error message it means that the revision of the item in the repository is newer than the copy in your local working copy. The solution is always going to be to run an update, so that your working copy is up to date with the repository, and then do the commit again (assuming that the update did not generate any conflicts). For files, this is usually pretty easy to understand how and why this happens. However, Subversion also versions folders, and it is usually with folders that this problem most often happens. Subversion does not allow you to delete/rename a folder OR change its versioned properties, UNLESS the local copy of the folder is at the HEAD revision of the folder in the repository.

Your next question might be: "OK, I can maybe understand that, but why is my folder out of date? I am the only person working in this repository." That is a valid question, the answer lies in the way that Subversion works. When you commit a change to a file, the revision of the file in your working copy is updated to that new revision when the commit completes, however the version of the parent folder(s) of that file is not updated. This is because there may have been adds/deletes to other files in that folder and until you have run an update, the folder is not really at that new revision. This is called "mixed revision working copies" and is probably explained better in the Subversion book.

In summary, the answer is always to do an update so that the folder or file is updated to its HEAD revision.

看了上面的解释我才知道是这个错误时由于我的working copy删除移动了某个目录引起,开始我还以为是因为第一次commit中断引起的呢.

解决方法就是将working copy 进行"Update to HEAD"的操作. 这时Subclipse提示我有一个我已经删除的目录有冲突,我没理它,直接commit,结果出现某某目录"remains in tree-conflict".

没办法,只好再次请出Google大神,找到这样一篇文章 <解决subclipse同步冲突问题A conflict in the working copy obstructs the current operation>

根据这篇文章提供的方法:

右击你要删除的目录–>team–>Show Tree Conflict–>在Eclpise中会出现一个Tab视图显示Tree Conflict的内容,一个一个选择列表中的冲突右击将其标志为已解决,然后回到项目再提交更改就可以了。

最后,我终于能够正常commit了~~~

你可能感兴趣的:(Eclipse)