eclipse svn:项目 <文件夹> 已过期

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2805546/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:23:05  来源:igfitidea点击:

svn: Item <folder> is out of date

eclipseubuntusubclipse

提问by Tom Brito

[answer auto-selected by bounty system against my will]

[赏金系统违背我的意愿自动选择答案]

I'm using subclipse, and always when delete a folder in Eclipse, and try to commit it, the following errors raise:

我正在使用 subclipse,并且总是在 Eclipse 中删除文件夹并尝试提交时,会出现以下错误:

svn: Item <folder> is out of date
svn: DELETE of <folder>: 409 Conflict (http://myintranet)

Deleting and commiting via command line works fine, but what's wrong with doing it via subclipse? Is anyone more experiencing this problem?

通过命令行删除和提交工作正常,但是通过 subclipse 执行它有什么问题?还有更多人遇到这个问题吗?

(I experienced this problem in Ubuntu 9.10 and 10.04; last Eclipse version; and subclipse 1.4 - as the next versions of subclipse have much more bugs)

(我在 Ubuntu 9.10 和 10.04;上一个 Eclipse 版本;和 subclipse 1.4 中遇到了这个问题——因为 subclipse 的下一个版本有更多的错误)

--updated:Its when I delete folders, not files

--updated:当我删除文件夹而不是文件时

采纳答案by bartosz.r

Subclipse has many problems like this. It works 90% of time, and then it just DOES NOT work as it should! I am using subclipse, since it is very well integrated into eclipse, and when I have problem or some bigger moves needed in svn (like merging some branch) I use Tortoisse.

Subclipse 有很多这样的问题。它在 90% 的时间里都可以工作,然后它就不能正常工作了!我正在使用 subclipse,因为它很好地集成到 eclipse 中,当我遇到问题或在 svn 中需要一些更大的动作(比如合并某个分支)时,我使用 Tortoisse。

I had the thing with directory like you. Then I just run the TortoiseSVN like @luiscolorado suggests, and it helped. Tortoise is so great tool (it has many great features for diffing, applying patches, getting patches and so on.).

我有像你这样的目录。然后我就像@luiscolorado 建议的那样运行 TortoiseSVN,它有所帮助。Tortoise 是一个非常棒的工具(它有许多很棒的功能,用于差异化、应用补丁、获取补丁等等。)。

Today I had a problem when I have removed a file, and someone had changed the same file! Then subclipse shows conflict (up to this point everything is ok), so I wanted to revert! But then the revert button is missing (disappears when inconflict mode!) so I have to do merge, and merge does not work, throws some kind of error. I didn't bother to read (maybe I should read and file it as a bug to subclipse maintainers ;-(), I knew the tortoisse will work, and you know what, it worked. There was a REVERT option.

今天我在删除文件时遇到问题,有人更改了同一个文件!然后 subclipse 显示冲突(到目前为止一切正常),所以我想恢复!但是随后缺少恢复按钮(在冲突模式时消失!)所以我必须进行合并,但合并不起作用,会引发某种错误。我没有费心阅读(也许我应该阅读并将其作为错误提交给 subclipse 维护者;-(),我知道 tortoisse 会起作用,你知道吗,它起作用了。有一个 REVERT 选项。

So @Tom Brito, try command line, try Tortoisse, and then you can look at the subclipse changelog and file a bug. I think that subclipse just forgets to show us some directory changes and updates (or it is designed not to do it?), but I may be wrong.

所以@Tom Brito,尝试命令行,尝试 Tortoisse,然后您可以查看 subclipse 更改日志并提交错误。我认为 subclipse 只是忘记向我们展示一些目录更改和更新(或者它被设计为不这样做?),但我可能错了。

回答by VonC

Isn't that addressed by the Subclipse FAQ?

Subclipse FAQ不是解决了这个问题吗?

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".

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

每当您在错误消息中看到“过时”时,这意味着存储库中项目的修订版比本地工作副本中的副本新
解决方案总是要运行更新,让你的工作副本是最新与资源库,然后做再提交(假设更新没有产生任何冲突)。

  • 对于文件,这通常很容易理解如何以及为什么会发生这种情况。
  • 然而,Subversion 也会对文件夹进行版本控制,而且这个问题通常发生在文件夹中。
    Subversion 不允许您删除/重命名文件夹或更改其版本属性,除非文件夹的本地副本位于存储库中文件夹的 HEAD 修订版。

您的下一个问题可能是:
“好吧,我可能理解这一点,但为什么我的文件夹已过期?我是这个存储库中唯一工作的人。

这是一个有效的问题,答案在于 Subversion 的工作方式。
当您提交对文件的更改时,当提交完成时,您的工作副本中文件的修订版将更新为该新修订版,但该文件的父文件夹的版本不会更新。
这是因为该文件夹中的其他文件可能已添加/删除,并且在您运行更新之前,该文件夹并不是真正的新版本。
这称为“混合修订工作副本”。

总之,答案始终是进行更新,以便将文件夹或文件更新为其HEAD修订版。



About "Mixed Revision Working Copies":

关于“混合修订工作副本”:

One special kind of flexibility is the ability to have a working copy containing files and directories with a mix of different working revision numbers.

One of the fundamental rules of Subversion is that a “push” action does not cause a “pull,” nor vice versa.
Just because you're ready to submit new changes to the repository doesn't mean you're ready to receive changes from other people.

The fact is, every time you run svn commit your working copy ends up with some mixture of revisions.
The things you just committed are marked as having larger working revisions than everything else. After several commits (with no updates in between), your working copy will contain a whole mixture of revisions

一种特殊的灵活性是能够拥有一个工作副本,其中包含具有不同工作修订号混合的文件和目录。

Subversion 的基本规则之一是“推”操作不会导致“拉”,反之亦然。
仅仅因为您已准备好向存储库提交新更改并不意味着您已准备好接收其他人的更改。

事实是,每次运行 svn commit 时,您的工作副本最终都会包含一些修订版本
您刚刚提交的内容被标记为比其他所有内容具有更大的工作修订。经过多次提交(中间没有更新),您的工作副本将包含完整的修订版本

(and that is why, I believe, you cannot reproduce your "out of date" message on subsequent commits with folder deleted: your update did solve the "mixed revision" state.)

(这就是为什么,我相信,您无法在删除文件夹的后续提交中重现您的“过时”消息:您的更新确实解决了“混合修订”状态。)

Mixed revisions have limitations

You cannot commit the deletion of a file or directory that isn't fully up to date.
If a newer version of the item exists in the repository, your attempt to delete will be rejected to prevent you from accidentally destroying changes you've not yet seen.

混合修订有局限性

您不能提交对未完全更新的文件或目录的删除
如果存储库中存在该项目的较新版本,您的删除尝试将被拒绝,以防止您意外破坏尚未看到的更改。

回答by marianboda

i think if you UPDATE before that it should work.. it did work for me

我想如果你在那之前更新它应该可以工作..它对我有用

回答by luiscolorado

Tom,

汤姆,

You might want to try TortoiseSVN, and manually update the project workspace. Find the location of your project directory in your hard drive, and then try TortoiseSVN (or the command line if it's your preference) to do the update.

您可能想尝试 TortoiseSVN,并手动更新项目工作区。在您的硬盘驱动器中找到您的项目目录的位置,然后尝试 TortoiseSVN(或命令行,如果它是您的偏好)进行更新。

A frequent cause of this problem is to delete the directory without "informing" SVN. For instance, if you manually delete the directory using the operating system instead of using SVN, you will have this problem.

这个问题的一个常见原因是在没有“通知”SVN 的情况下删除目录。例如,如果您使用操作系统而不是使用SVN手动删除目录,则会出现此问题。

If you removed the directory before you installed the subversion plug-in, but the project already existed in the repository, you will experiment this problem. A solution, in this case, would be to recreate the directory, updating/committing, and then delete again the directory.

如果在安装 subversion 插件之前删除了目录,但是项目已经存在于存储库中,您将尝试这个问题。在这种情况下,解决方案是重新创建目录,更新/提交,然后再次删除目录。

Good luck.

祝你好运。

回答by Oskar Emil

My solution to this was

我对此的解决方案是

  1. Delete all items in folder
  2. Commit to repository
  3. Update folder to HEAD
  4. Delete folder in Eclipse
  5. Commit to repository
  1. 删除文件夹中的所有项目
  2. 提交到存储库
  3. 将文件夹更新为 HEAD
  4. 删除 Eclipse 中的文件夹
  5. 提交到存储库

A bit cumbersome, maybe, but it always works

可能有点麻烦,但它总是有效

回答by Martin

There's a simple solution without installing some extra software. I also had this "problem" and what you can do is the following:

有一个简单的解决方案,无需安装一些额外的软件。我也有这个“问题”,你可以做的是:

1) open the SVN Repository view 2) there go to the folder you want to get rid of and delete it 3) go back to the java view 4) update the folder in your project you actually deleted / update your project should also work

1) 打开 SVN 存储库视图 2) 转到您要删除的文件夹并删除它 3) 返回 Java 视图 4) 更新您实际删除的项目中的文件夹/更新您的项目也应该可以工作

That solved the problem in my case, as updating only retrieved the files I deleted

这解决了我的问题,因为更新只检索了我删除的文件

回答by Tom Brito

The only working way in same cases is via command line. The subclipse is still not perfect..

在相同情况下唯一的工作方式是通过命令行。子剪辑仍然不完美..