简体   繁体   English

如何使用超越比较作为外部svn diff工具

[英]How to use beyond compare as a external svn diff tool

I want to configure it so that svn diff filename shows the diff in beyond compare. 我想配置它,以便svn diff filename显示超出比较的差异。

I am on ubuntu. 我在ubuntu上。 On a related note what is everyone using to diff and merge. 在相关的说明中,每个人都使用差异和合并。 BC is awesome on windows, but very ugly looking on Linux, imo. BC在Windows上很棒,但在Linux上非常难看,imo。

Like the other answers have said -- you have to call beyond compare from a script and pass that to subversion's --diff-cmd option. 就像其他答案所说的那样 - 你必须在脚本之外调用,并将其传递给subversion的--diff-cmd选项。 I use the following script on linux: 我在linux上使用以下脚本:

#!/bin/bash
test `/usr/bin/bcompare "$6" "$7" -title="$3" -title2="$5" -readonly` > 2 && exit 1; exit 0

That's similar to what the link in CooCooC's post says, except that it translates the return value of beyond compare into what subversion expects: 0 for no difference, 1 for difference. 这与CooCooC帖子中的链接类似,不同之处在于它将超出比较的返回值转换为subversion期望的值:0表示无差异,1表示差异。 That gets rid of the error messages and aborts that otherwise get in your way... 这摆脱了错误信息和中止,否则会妨碍你...

EDIT: See colgur's comment below, a better way to do it is: 编辑:请参阅下面的colgur评论,更好的方法是:

/usr/bin/bcompare "$7" "$6" -title1="$5" -title2="$3" -readonly & wait $! [ $? -gt 2 ] && exit 1; exit 0

See the SVN Book on External Diff Tools : 请参阅SVN Book on External Diff Tools

The presence of --diff-cmd and --diff3-cmd options, and similarly named runtime configuration parameters (see the section called “Config” ), can lead to a false notion of how easy it is to use external differencing (or “diff”) and merge tools with Subversion. 存在--diff-cmd--diff3-cmd选项以及类似命名的运行时配置参数(请参阅“Config”一节 ),可能会导致使用外部差异(或“ diff“)和Subversion合并工具。 While Subversion can use most of popular such tools available, the effort invested in setting this up often turns out to be non-trivial. 虽然Subversion可以使用大多数流行的这类工具,但投入设置这些工具的努力往往是非平凡的。

... ...

The key to using external diff and merge tools (other than GNU diff and diff3, of course) with Subversion is to use wrapper scripts which convert the input from Subversion into something that your differencing tool can understand, and then to convert the output of your tool back into a format which Subversion expects—the format that the GNU tools would have used. 使用外部差异和合并工具(当然除了GNU diff和diff3)与Subversion的关键是使用包装器脚本将Subversion的输入转换为差异工具可以理解的东西,然后转换你的输出工具回到Subversion期望的格式 - GNU工具将使用的格式。 The following sections cover the specifics of those expectations. 以下部分介绍了这些期望的具体内容。

Definitely a fan of Beyond Compare , as it not only serves as a very good diff/merge tool for use with source control, it does a very good job of helping to synchronise directories/files in general. 绝对是Beyond Compare的粉丝,因为它不仅是一个非常好的差异/合并工具,用于源代码控制,它在帮助同步目录/文件方面做得非常好。 An absolute no-brainer, when it comes to buying a copy - can't vouch for the Linux version, though, as I've never used it. 在购买副本时,绝对不用脑子 - 不能担保Linux版本,因为我从未使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM