eclipse 移动工作区后,Subclipse 抱怨“路径不是工作副本”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1425891/
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
Subclipse complains "Path is not a working copy" after moving workspace
提问by David Moles
I recently moved my Eclipse workspace directory and now Subclipse complains every time I open a file, dumping to the console something like:
我最近移动了我的 Eclipse 工作区目录,现在每次打开文件时 Subclipse 都会抱怨,转储到控制台,例如:
Path is not a working copy directory
svn: '[original (pre-move) directory path]' is not a working copy
No such file or directory
路径不是工作副本目录
svn: ' [原始(移动前)目录路径]' 不是工作副本
无此文件或目录
This also happens when I explicitly try to view the history of a file. This persists across SVN cleanups, closing and re-opening Eclipse, etc.
当我明确尝试查看文件的历史记录时,也会发生这种情况。这在 SVN 清理、关闭和重新打开 Eclipse 等过程中仍然存在。
Update, checkin, checkout and so on all seem to work fine, and Tortoise doesn't complain at all, so clearly it's not the SVN metadata that's screwed up, it's some Subclipse-specific metadata. Can anyone tell me how to blow this broken metadata away?
更新、签入、签出等似乎都运行良好,Tortoise 根本没有抱怨,所以很明显这不是 SVN 元数据被搞砸了,而是一些特定于 Subclipse 的元数据。谁能告诉我如何消除这个损坏的元数据?
Edited to add:"Team > Disconnect" followed by "Team > Share" doesn't solve the problem.
编辑添加:“团队>断开连接”后跟“团队>共享”并不能解决问题。
Edited again to add:I've grepped through the whole .metadata
directory and one of the project directories for a unique element of the old path and can't find it anywhere except in .metadata/.log
(the error message itself) and some old Findbugs warnings. Very nice.
再次编辑以添加:我已经在整个.metadata
目录和项目目录之一中搜索了旧路径的唯一元素,除了.metadata/.log
(错误消息本身)和一些旧的 Findbugs 警告之外,在任何地方都找不到它。非常好。
采纳答案by Serxipc
I was having the same error message using subclipse with javahl on a project that is out of the workspace directory. Changing to svnKit has resolved my problem.
我在工作区目录之外的项目上使用带有 javahl 的 subclipse 时遇到相同的错误消息。更改为 svnKit 解决了我的问题。
回答by Kyle Patrick
You need to delete the .syncinfo
files. This is easily done (in most cases) by closing and opening Eclipse, however you can also do so manually as in the following:
您需要删除这些.syncinfo
文件。这可以通过关闭和打开 Eclipse 轻松完成(在大多数情况下),但您也可以手动执行此操作,如下所示:
To delete the cache, close Eclipse. The cache is stored in:
[workspace]/.metadat?a/.plugins/org.eclip?se.core.resources/.p?rojects/PROJECTNAME/?.syncinfo
So you can just find and delete all files named
.syncinfo
in[workspace]/.metadat?a/.plugins/org.eclip?se.core.resources/.p?rojects
要删除缓存,请关闭 Eclipse。缓存存储在:
[workspace]/.metadat?a/.plugins/org.eclip?se.core.resources/.p?rojects/PROJECTNAME/?.syncinfo
所以你可以找到并删除所有命名
.syncinfo
的文件[workspace]/.metadat?a/.plugins/org.eclip?se.core.resources/.p?rojects
Quoted from this article: http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=868799
引自本文:http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=868799
回答by nightowl
I just did a "Team -> Cleanup" and this exact error went away! I also got this error because I moved between machines and the path wasn't the same.
我刚刚做了一个“团队 -> 清理”,这个错误就消失了!我也遇到了这个错误,因为我在机器之间移动并且路径不一样。
Using Eclipse 3.6 and the Subversion 1.6 plugin.
使用 Eclipse 3.6 和 Subversion 1.6 插件。
Update in 2016:Still works perfectly with Eclipse 4.5.2 and Subclipse 1.10.
2016 年更新:仍然与 Eclipse 4.5.2 和 Subclipse 1.10 完美配合。
回答by David Moles
Edited to add:Nope, spoke too soon. This doesn't fix it. Some files just seem not to exhibit the problem.
编辑补充:不,说话太快了。这不能解决它。有些文件似乎没有出现问题。
The following seems to solve the problem:
以下似乎可以解决问题:
- Team > Disconnect.
- Quit Eclipse.
- Blow away
.metadata/.plugins/org.tigris.subversion.subclipse.*
. - Restart Eclipse.
- Team > Share.
- 团队 > 断开连接。
- 退出 Eclipse。
- 吹走
.metadata/.plugins/org.tigris.subversion.subclipse.*
。 - 重新启动 Eclipse。
- 团队 > 共享。
Not sure how the old path was actually being stored in the plugin prefs, but it must have been in there somehwere. It's kind of pathetic of Subclipse to store absolute paths, but apparently it is.
不确定旧路径实际上是如何存储在插件首选项中的,但它一定是在某个地方。Subclipse 存储绝对路径有点可悲,但显然确实如此。
There's a bug filed on this, or at least on the same error message. No context. Fifty cents says it gets rejected.
有一个关于此的错误,或者至少在相同的错误消息上。没有上下文。五十美分说它被拒绝了。
回答by Mike Blyth
I'm sure there are many causes with different solutions, but I found the one that worked for me at Dan Wilson's blog. Simply remove the offending folders from the workspace (probably saving them if they have new content), update (letting Subversion recreate the folders), then move the contents back into the fresh folders in your workspace.
我确信有很多原因会导致不同的解决方案,但我在Dan Wilson 的博客中找到了一个对我有用的原因。只需从工作区中删除有问题的文件夹(如果它们有新内容,可能会保存它们),更新(让 Subversion 重新创建文件夹),然后将内容移回工作区中的新文件夹。
回答by David B
I got the error when I tried to rename a class by changing the case from DAO
to Dao
in Eclipse.
我得到的错误,当我试图从改变的情况下重命名一个类DAO
来Dao
在Eclipse中。
I had to rename it to something like Dao2
and then was able to rename it to Dao
.
我不得不将其重命名为类似的名称Dao2
,然后才能将其重命名为Dao
.
回答by JanTheGun
What worked for me: Do a "refactor - rename" on the project => after that do it again to rename it back to the original name.
对我有用的方法:对项目进行“重构 - 重命名”=> 之后再次将其重命名为原始名称。
回答by Sergio
checkout the whole project to a temp dir, then I copied the first level .svn directory and replaced my working copy .svn folder with this.
将整个项目签出到临时目录,然后我复制了第一级 .svn 目录并用这个替换了我的工作副本 .svn 文件夹。
http://blog.itopia.de/directory-svn-containing-working-copy-admin-area-is-missing/275
http://blog.itopia.de/directory-svn- contains-working-copy-admin-area-is-missing/275
It woks for me.
它对我有用。
回答by James Drinkard
I had added a png file to my project, but I got this error trying to rename or delete it. Cleaning and refreshing the project didn't do anything.
我已经在我的项目中添加了一个 png 文件,但是我在尝试重命名或删除它时遇到了这个错误。清理和刷新项目没有做任何事情。
I went into the svn Team Synchronizing perspective, right clicked on the file and deleted it. That solved my problem.
我进入 svn Team Synchronizing 透视图,右键单击该文件并将其删除。那解决了我的问题。
回答by Immortal Code
- Right click on the project and select Teams-> Switch to another Branch/Tag/Revision.
- Select the appropriate Branch/Tag/Revision that the project should be tied to and click OK.
- Give Eclipse some time to process the changes.
- Restart Eclipse for the changes to take affect.
- 右键单击项目并选择Teams-> Switch to another Branch/Tag/Revision。
- 选择项目应绑定到的相应分支/标签/修订版,然后单击OK。
- 给 Eclipse 一些时间来处理更改。
- 重新启动 Eclipse 以使更改生效。