如何让 Eclipse 使用现有的 svn 工作副本?
我已经用 svn 签出了一份工作副本; 此外,我在 Eclipse 中创建了一个新项目,该项目将工作副本的根目录作为项目的位置。 我希望能够执行诸如比较 Eclipse 版本之类的操作。 我有 Subclipse 1.4.8,但这似乎没有给我我想要的。 难道我做错了什么?
I've got a working copy checked out with svn; furthermore, I've created a new project in Eclipse that has the root of the working copy as the project's location. I want to be able to do stuff like compare versions from Eclipse. I have Subclipse 1.4.8, but that doesn't seem to give me what I want. Am I doing something wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(13)
我有一个 svn 工作副本,它也是 eclipse 中的一个项目。 安装 subclipse 插件后,我遇到了同样的问题,工作副本未被识别。
我只是偶然地通过重命名有问题的项目,然后将其重命名回原来的名称,将其识别为 svn 工作副本。 不太好,但它成功了:-)
i have an svn working copy that also is a project in eclipse. after installing the subclipse plugin i had the same problem, the working copy was not recognized as such.
i just managed by chance to get it recognized as an svn working copy by renaming the project in question and then renaming it back to its old name. not very nice, but it did the trick :-)
创建新项目时,有一个选项可以使用现有源目录:
新建项目/新 Java 项目/从现有源创建项目。
使用它,告诉它你的源代码所在的位置,它应该会自动检测它是否是 SVN 工作副本。
There is an option when creating a new project, to use an existing source directory:
New project/ new Java Project / Create project from existing source.
Use that, tell it where your source lives, and it should automatically detect if it's a SVN working copy.
我想这对于 Subclipse 来说是不可能的,因为它在其 文档表明,根据文档,您只能在一种条件下导入现有的 svn 管理的文件夹:
因此,如果您有一个不是完整 Eclipse 项目的工作副本,Subclipse 不会将其连接到 SVN。
I guess this is not possible with Subclipse as it's given in its documentation that, you can only import an existing svn-managed folder under one condition, according to the doc:
So, if you have a working copy that is not a complete eclipse project, Subclipse will not connect it to SVN.
您可以右键单击项目的根节点并选择:团队/共享项目
然后选择SVN,让默认设置,它应该可以正常工作!
You can right click on the root node of your project and select: Team / Share project
Then you choose SVN, let the default settings and it should work fine!
我是在被问了很长时间之后才回答这个问题的。 我最终来到这里是因为我面临着同样的问题。
我的解决方案是在项目的根文件夹中创建一个空的 .svn 文件夹(在最新版本的 svn 客户端乌龟中,所有元数据都位于根文件夹中)。 然后进行了日食刷新,瞧,它成功了。 我正在运行 subclipse core - 1.8.4。
I am answering this after a long time of the question being asked. I ended up here because I was facing the same problem.
My solution was to create an empty .svn folder at the root folder of the project (in the latest version of svn client tortoise all meta-data is at the root folder). Then did an eclipse refresh and voila it did the trick. I am running subclipse core - 1.8.4.
这对我有用:
1) 转到“SVN Repository Exploring”透视图并在工作副本上方的某个位置添加一个文件夹
2) 关闭并打开 Eclipse 项目。
这应该足以让 Subclipse 识别它们。
This worked for me:
1) Go to the 'SVN Repository Exploring' perspective and add a folder somewhere above your working copy
2) Close and open the Eclipse projects.
This should then be enough to get them recognized by Subclipse.
我遇到过类似的情况,现有项目不会与 Subversive 插件关联。 不幸的是,之前的建议都没有帮助(重命名项目等)。 有用的是从 Eclipse 中删除项目,方法是删除它们——只是 Package Explorer 中的项目,而不是光盘上的实际目录和文件(删除提示有一个特殊的复选框,默认情况下未选中)——然后重新导入删除的项目作为现有项目返回。
当然,正如这里的一些答案中提到的,在重新导入项目之前需要向 Eclipse 注册相关的 SVN 存储库。 否则,将没有存储库来重新关联项目。
I have encountered a similar situation were existing projects would not get associated with the Subversive plugin. Unfortunately, none of the previous suggestions helped (renaming projects etc.). What has helped is removing projects from Eclipse by deleting them -- just the projects from Package Explorer and not the actual directories and files on disc (the deletion prompt has a special checkbox for that, which is unchecked by default) -- and reimporting the deleted projects as existing projects back.
Of course, as mentioned in some of the answers here, the relevant SVN repositories need to be registered with Eclipse before reimporting the projects. Otherwise, there would no repositories to re-associate the projects with.
当您在 Eclipse 中打开以前从未与 Subclipse 一起使用过的版本化项目(即 SVN 工作副本中的项目)时,您需要执行以下步骤:
Subclipse 会自动将该项目识别为版本,并且 SVN 插件的所有功能都应该可用。
When you open a versioned project (i.e., a project in SVN working copy) in Eclipse, that was never previously used with Subclipse, you need to perform these steps:
Subclipse automatically recognizes this project as versioned and all the features of the SVN plug-in should become available.
有一个步骤似乎对我有用,但还没有人明确提到:我关闭了该项目,然后重新打开了该项目。 我尝试了上面的“重命名”技巧,但这没有用,但也许该答案的发布者也关闭了该项目 - 他们没有详细说明重命名它所经历的具体步骤。 (我发现您不必必须关闭项目才能重命名它,但也许他们这样做了。
) /抢>
One step that seemed to work for me, that no one has explicitly mentioned yet: I closed and then re-opened the project. I tried the "rename" trick, above, and that didn't work, but perhaps the poster of that answer also closed the project - they didn't detail exactly what steps they went thru to rename it. (I found you don't have to close the project to rename it, but perhaps they did.)
< /rob>
就我而言,我无法使用现有副本,因为我在命令行上使用较新版本的 Subversion 检查了代码,而 Subclipse 1.4 无法识别它。 升级并通过改进的“共享项目”菜单解决了这个问题。
我从这里的论坛得到了这个提示:
http://subclipse。 tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2380064
In my case, I couldn't use an existing copy because I checked out the code using a newer version of Subversion on the command-line and Subclipse 1.4 couldn't recognize it. Upgrading and going through the improved "Share Project" menu resolved the problem.
I got this tip from the forums here:
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2380064
我遇到了同样的问题,这里是修复的详细信息。
我的 Eclipse 是“Helios Service Release 1”。
我在我的文件系统上进行了 SVN 签出,我转到
新建 Java 项目
,取消选中使用默认位置
,选择位置,转到下一步,选择源文件夹并说完成
。该项目上没有磁盘图标。 根据一些论坛帖子,右键单击该项目,转到
Team
>Share Project
,选择SVN
,点击Next
,选项只有第一次将文件共享到SVN Repository。我说的是
取消
,选项是更改 SVN 插件设置。 进入Window
菜单,选择Preferences
,浏览Team
> SVN。 选择SVN Connector
选项卡,将SVNKit 1.2.3
更改为SVNKit 1.3.5
并单击OK
。然后,右键点击项目,说
Team
>SVN
,在下一个屏幕上,选择选项使用项目设置
,然后单击完成
。 磁盘按钮出现在项目上,并且上面显示了 SVN URL。I had the same issue and here are the details of the fix.
My Eclipse is "Helios Service Release 1".
I had an SVN checkout on my filesystem, I went to
New Java Project
, uncheckedUse default location
, chose the location, went to next step, chose the source folder and saidFinish
.The project came up with no disk icon on it. As per few forum posts, right-clicked on the project, went to
Team
>Share Project
, choseSVN
, clickedNext
, and the option was only to share the files to the SVN Repository for the first time.I said
Cancel
, and the option is to make changes to the SVN plug-in settings. Went toWindow
menu, chosePreferences
, browsedTeam
>SVN
. Chose theSVN Connector
tab, changed theSVNKit 1.2.3
toSVNKit 1.3.5
and saidOK
.Then, right clicked on the project, said
Team
>SVN
, on the next screen, chose the optionUse Project Settings
and clickedFinish
. The disk button came to the project and the SVN URL got displayed on it.通过选择 Window->Show View->Other... 并将存储库添加到 subclipse 中的存储库列表中,然后选择 SVN->SVN Repositories。 输入连接到存储库所需的所有信息。
接下来,右键单击存储库并选择“签出”。 如果项目还没有 eclipse .project 文件,您可以从源创建一个新项目。 如果它已经有一个 .project 文件,它将导入该 .project 并将其用作本地的 eclipse 项目。
Add the repository to your list of repositories in subclipse by choosing Window->Show View->Other... and choose SVN->SVN Repositories. Put in all the necessary info to connect to the repository.
Next, right click the repository and choose "checkout". If the project doesn't already have an eclipse .project file, you can create a new project from the source. If it already has a .project file, it will import that .project and use that as your eclipse project locally.
如果您使用与 Eclipse 支持的版本不同的 svn 进行结账,那么它肯定无法工作。 我遇到了这个问题,因为我使用 svn 1.6 来结帐,但我有一个较旧的 eclipse 版本,只有 1.5。 Subclipse 有自己的内置 svn 客户端(实际上,如果我没记错的话,有两种风格)。
检查 subclipse 版本是否与您用于签出的 svn 客户端匹配。 您可以检查 subclipse 的插件版本号(帮助 -> 关于 -> 单击 subversion 徽标)并将其与 svn --version 进行匹配
It will definitively not work if you use a different version of svn to checkout, that the one that is supported by Eclipse. I had this problem as I used svn 1.6 to checkout but I had an older eclipse version that had only 1.5. Subclipse has its own build-in svn client (Actually, in two flavors if I am not mistaken).
Check that the subclipse version matches the svn client that you used to checkout. You can check the plugin version number for subclipse (Help -> About -> Click on subversion logo) and match it against svn --version