如何使用 Subclipse 在 Eclipse 中从分支合并到主干?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14537769/
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
How to merge from branch to trunk in Eclipse using Subclipse?
提问by srk
I am using the Subclipse plugin in eclipse IDE, to commit and update my code. I am in need of merging code from branch to trunk. As a part of it, I am facing this issue. Here's my workaround steps to merge the branch to trunk.
我在 Eclipse IDE 中使用 Subclipse 插件来提交和更新我的代码。我需要将代码从分支合并到主干。作为其中的一部分,我正面临这个问题。这是我将分支合并到主干的解决方法步骤。
- Right click on the project -> Team -> Merge.
- Select Merge two different trees.
- I have set From URL to my branch. Eg: http://abc.com:40/branches/appi1.1/src/demo.properties
- I have also set To URL to my trunk Eg: http://abc.com:40/trunk/appi/src
- In both from and to URL sections, I have selected head revision radio button.
- In the console, I got the message: Merge completed abnormally
- 右键单击项目 -> 团队 -> 合并。
- 选择合并两个不同的树。
- 我已将 From URL 设置为我的分支。例如:http://abc.com:40/ branches/appi1.1/src/ demo.properties
- 我还设置了到我的后备箱的 URL 例如:http://abc.com:40/trunk/appi/ src
- 在从 URL 和到 URL 部分,我选择了头部修订单选按钮。
- 在控制台中,我收到消息:合并异常完成
Lucidly, here's my error alert from eclipse IDE.
显然,这是我来自 Eclipse IDE 的错误警报。
P.S: In my trunk code, there exists no demo.properties, but it's there in the branch code.
PS:在我的主干代码中,没有demo.properties,但它在分支代码中。
回答by Mark Phippard
If you have not installed the CollabNet Merge Client from the Subclipse update site you should do so. The Subclipse merge option has not really been updated for the merge tracking support since Subversion 1.5.
如果您尚未从 Subclipse 更新站点安装 CollabNet Merge Client,则应该这样做。自 Subversion 1.5 以来,Subclipse 合并选项并没有真正更新合并跟踪支持。
Your merge parameters are definitely not correct. The "To URL" is not the target for the merge, your working copy is. The From and To URL are the two URL/revision ranges to diff to produce the merge that you want to apply to your working copy. In most cases, the two URL's should be the same and the revision numbers should change to reflect the range of revisions you want to merge.
您的合并参数肯定不正确。“到 URL”不是合并的目标,您的工作副本才是。From 和 To URL 是两个 URL/修订范围,用于 diff 以生成要应用于工作副本的合并。在大多数情况下,两个 URL 应该相同,并且修订号应该更改以反映您要合并的修订的范围。
The new UI introduced with the CollabNet Merge Client resolves these issues and makes it much easier to perform the correct merge.
CollabNet Merge Client 引入的新 UI 解决了这些问题,并使执行正确合并变得更加容易。
You should avoid merging a specific file, when using Subversion. Ideally you should merge the entire tree, /branches/appi1.1 in your example.
使用 Subversion 时,应避免合并特定文件。理想情况下,您应该在示例中合并整个树 /branches/appi1.1。