在 Eclipse 中使用 Beyond Compare 合并 Subversion
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6306845/
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
Using Beyond Compare inside Eclipse for Merging in Subversion
提问by mliebelt
I would like to use Beyond Compare inside Eclipse. The problem at hand is, that the native diff and merge tool does not allow to customize the diff enough, so there are too much differences. Beyond Compare has the right customization for that, but I could not integrate the tool. I have tried the following:
我想在 Eclipse 中使用 Beyond Compare。手头的问题是,原生差异和合并工具不允许对差异进行足够的自定义,因此存在太多差异。Beyond Compare 对此进行了正确的自定义,但我无法集成该工具。我尝试了以下方法:
- Use the Eclipse Plugin http://beyondcvs.sourceforge.net/But I could not configure Subversive inside Eclipse to use that plugin, and the plugin does not integrate itself into the merge action of Subversive.
- Tried to integrate Beyond Compare as the diff viewer (see Eclipse Window > Preferences > Team > SVN > Diff Viewer). When doing then a synchronize, the diff viewer I configured was not used at all. I followed the information found at http://www.scootersoftware.com/download.php?c=kb_vcsunder the point "tortoisesvn" and changed the syntax as needed by the Subversive plugin.
- 使用 Eclipse 插件http://beyondcvs.sourceforge.net/但我无法在 Eclipse 中配置 Subversive 以使用该插件,并且该插件不会将自身集成到 Subversive 的合并操作中。
- 尝试将 Beyond Compare 集成为差异查看器(请参阅 Eclipse Window > Preferences > Team > SVN > Diff Viewer)。在进行同步时,根本没有使用我配置的差异查看器。我按照在http://www.scootersoftware.com/download.php?c=kb_vcs下的“tortoisesvn”点找到的信息进行操作,并根据 Subversive 插件的需要更改了语法。
Has anyone succeeded in integrating Beyond Compare in Eclipse for Subversion? I have found the similar question How to configure Beyond Compare 3 for Eclipse conflict resolution?, but it did not work for me (perhaps the difference between Subversive and Subclipse?).
有没有人成功地在 Eclipse 中为 Subversion 集成 Beyond Compare ?我发现了类似的问题如何为 Eclipse 冲突解决配置 Beyond Compare 3?,但它对我不起作用(也许是 Subversive 和 Subclipse 之间的区别?)。
Addition: I followed the steps of @Tom Clift (thank's a lot), and the diff is now working, the merge was a little bit more difficult. I have done the following steps to final success:
另外:我按照@Tom Clift 的步骤操作(非常感谢),差异现在正在运行,合并有点困难。我已经完成了以下步骤以取得最终成功:
- Configured as documented by the answer.
- Changed something on a branch and commited that.
- Switched to the trunk.
- Started there the merge operation:
Team > Merge... > Tab URL > URL Field: <branch URL> and Radio button "Start from copy"
- When pressing
Ok
, a dialog pops up that ask if it is ok to open the "Synchronize View". - The synchronize perspecitve shows all changes, and when I select one, there is a menu entry "Open in external compare editor" that opens Beyond Compare.
- 按照答案中的说明进行配置。
- 在一个分支上改变了一些东西并提交了。
- 切换到后备箱。
- 从那里开始合并操作:
Team > Merge... > Tab URL > URL Field: <branch URL> and Radio button "Start from copy"
- 按 时
Ok
,会弹出一个对话框,询问是否可以打开“同步视图”。 - 同步透视显示所有更改,当我选择一个时,有一个菜单项“在外部比较编辑器中打开”打开 Beyond Compare。
回答by Tom Clift
Steps for configuring Eclipse (tested with 3.7 (Indigo) through 4.4 (Luna)) with Subversiveto use Beyond Compareas the default diff and merge tool (may work with other versions too):
使用Subversive配置 Eclipse(使用 3.7 (Indigo) 到 4.4 (Luna) 测试)以使用Beyond Compare作为默认差异和合并工具(也可以与其他版本一起使用)的步骤:
Note: per MattPassell's commentthere seems to be an outstanding issue on OS X (and Linux?) with spaces in paths and arguments. The config below for OS X works around this by avoiding spaces.
注意:根据MattPassell 的评论,在 OS X(和 Linux?)上似乎存在一个突出的问题,路径和参数中有空格。OS X 下面的配置通过避免空格来解决这个问题。
- Preferences → Team → SVN → Diff Viewer
- Add...
- Extension or mime-type: *
- Diff program arguments → Program Path: enter the path for the Beyond Compare binary (with no arguments). E.g.:
- OS X:
/Users/tom/bin/bcomp
(which is a symlink to/Applications/Beyond Compare.app/Contents/MacOS/bcomp
to avoid spaces in the path) - Windows:
C:\Program Files (x86)\Beyond Compare 3\BComp.exe
- OS X:
- Diff program arguments(box):
- OS X:
${base} ${mine} -lefttitle=Base -righttitle=Local
- Windows:
"${base}" "${mine}" /lefttitle="Base ${base}" /righttitle="Local ${mine}"
- OS X:
- Merge program arguments → Program path: path to binary again.
- Merge program arguments(box):
- OS X:
${theirs} ${mine} ${base} ${merged} -lefttitle=Incoming -centertitle=Base -righttitle=Local -outputtitle=Merged
- Windows:
"${theirs}" "${mine}" "${base}" "${merged}" /lefttitle="Incoming (${theirs})" /centertitle="Base (${base})" /righttitle="Local (${mine})" /outputtitle="Merged (${merged})"
- OS X:
- OK
- 首选项 → 团队 → SVN → 差异查看器
- 添加...
- 扩展名或 MIME 类型:*
- Diff program arguments → Program Path:输入 Beyond Compare 二进制文件的路径(不带参数)。例如:
- OS X:(
/Users/tom/bin/bcomp
这是一个符号链接,/Applications/Beyond Compare.app/Contents/MacOS/bcomp
以避免路径中的空格) - 视窗:
C:\Program Files (x86)\Beyond Compare 3\BComp.exe
- OS X:(
- Diff 程序参数(框):
- 操作系统:
${base} ${mine} -lefttitle=Base -righttitle=Local
- 视窗:
"${base}" "${mine}" /lefttitle="Base ${base}" /righttitle="Local ${mine}"
- 操作系统:
- 合并程序参数 → 程序路径:再次指向二进制文件的路径。
- 合并程序参数(框):
- 操作系统:
${theirs} ${mine} ${base} ${merged} -lefttitle=Incoming -centertitle=Base -righttitle=Local -outputtitle=Merged
- 视窗:
"${theirs}" "${mine}" "${base}" "${merged}" /lefttitle="Incoming (${theirs})" /centertitle="Base (${base})" /righttitle="Local (${mine})" /outputtitle="Merged (${merged})"
- 操作系统:
- 好的
I have tried and failed to configure Beyond Compare as a diff tool with Subclipse (it seems to only have external tool configuration for merge/conflict).
我曾尝试将 Beyond Compare 配置为带有 Subclipse 的差异工具,但未能成功(它似乎只有用于合并/冲突的外部工具配置)。