我该如何配置TortoiseSVN的外部合并行为?

13

我在使用TortoiseSVN合并后遇到了一些冲突解决问题。

我想让它将数据发送到BeyondCompare并使用其三路合并功能。不幸的是,它发送的文件顺序与BeyondCompare所期望的顺序不同,导致合并出现了错误。

如果我在资源管理器中右键单击并选择 TortoiseSVN->设置,然后在外部程序->合并工具下,可以指定BeyondCompare的路径,但没有关于参数的信息。我如何重新排列发送到外部合并工具的参数,以便在BeyondCompare中正确显示呢?

3个回答

15
你可以通过TortoiseSVN的TortoiseSVN -> 设置 -> 合并工具对话框来控制发送给外部合并应用程序(在本例中为BComp.exe)的参数。
使用BeyondCompare进行二向和三向合并的示例在BC支持文档中。
3-way Merge (v3 Pro)

1.    Select Settings from Explorer's TortoisSVN submenu.
2.    Switch to the Merge Tool tab.
3.    Change the radio buttons from TortoiseMerge to External.
4.    In the path edits, enter:
5.    "C:\Program Files\Beyond Compare 3\BComp.exe" %mine %theirs %base %merged /title1=%yname /title2=%tname /title3=%bname /title4=%mname 

2-way Merge (v3 Std, v2)

Use the same steps as above, but use the command line:

`"C:\Program Files\Beyond Compare 3\BComp.exe" %mine %theirs /savetarget=%merged`

这在 Tortoise SVN 文档4.30.5.2节中有详细说明(不提供子主题的链接 - 搜索页面中的Merge Tool):

参数替换方式与 Diff 程序相同。

%base - 原始文件,没有您或他人的更改

%bname - 基本文件的窗口标题

%mine - 您自己的文件,带有您的更改

%yname - 您的文件的窗口标题

%theirs - 存储库中的文件

%tname - 存储库中文件的窗口标题

%merged - 冲突文件,合并操作的结果

%mname - 合并文件的窗口标题

例如,使用 Perforce Merge:

C:\Path-To\P4Merge.exe %base %theirs %mine %merged

或者使用 KDiff3:

C:\Path-To\kdiff3.exe %base %mine %theirs -o %merged --L1 %bname --L2 %yname --L3 %tname

或者使用 Araxis:

C:\Path-To\compare.exe /max /wait /3 /title1:%tname /title2:%bname /title3:%yname %theirs %base %mine %merged /a2

或者使用 WinMerge(2.8 或更高版本):

C:\Path-To\WinMerge.exe %merged


感謝您的好建議。我在未使用參數的情況下使用了BComp,並且因為合併建議始終錯誤而非常惱怒。在Beyond Compare 4上運行良好。 - Arvid

1
上面的答案对我们来说不起作用,因为参数的解释虽然有帮助,但是是错误的(至少对我们来说是这样的)。
对我们来说正确的顺序是:[Path]\BCompare.exe %base %mine %theirs %merged
这里的诀窍是交换%theirs和%merged,因为Beyond Compare会将它们放错位置。提示:本地文件必须始终显示在右侧。左侧必须是revBase,中心是revHEAD。

1
奇怪,我有%mine %theirs %base %merged,所以本地的在左边,基础的在中间,他们的在右边,它很好地完成了合并。 - Simeon Pilgrim

0

仅针对DiffViewer:

Beyond Compare 3和TortioseSVN(TortoiseSVN 1.9.4)

设置->DiffViewer。将单选按钮移动到外部并粘贴~

C:\ Program Files(x86)\ Beyond Compare 3 \ BCompare.exe%base%mine


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接