How do I configure TortoiseSVN's external merge behavior?
Asked Answered
J

3

13

I'm having some trouble running conflict resolution after a merge with TortoiseSVN.

I'm trying to have it send the data to BeyondCompare and use its 3-way merge functionality. Unfortunately, it sends the files in a different order than what BeyondCompare is expecting, and so it gets the merging all wrong.

If I right-click in Explorer and say TortoiseSVN->Settings, then under External Programs->Merge Tool I can specify the path to BeyondCompare, but there's nothing there about the arguments. How do I reorder the arguments it sends to the external merge tool so I can get things to show up right in BeyondCompare?

Janessa answered 22/6, 2012 at 0:9 Comment(0)
P
15

You can control the parameters sent to the external merge application (in this case BComp.exe) by TortoiseSVN in the TortoiseSVN->Settings->Merge Tools dialog.

An example of using BeyondCompare for both a two-way and three-way merge is in the BC support documentation:

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`

This is covered in the Tortoise SVN docs, section 4.30.5.2 (no link to subtopics - search the page for Merge Tool):

Parameter substitution is used in the same way as with the Diff Program.

%base - the original file without your or the others changes

%bname - The window title for the base file

%mine - your own file, with your changes

%yname - The window title for your file

%theirs - the file as it is in the repository

%tname - The window title for the file in the repository

%merged - the conflicted file, the result of the merge operation

%mname - The window title for the merged file

For example, with Perforce Merge:

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

or with KDiff3:

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

or with Araxis:

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

or with WinMerge (2.8 or later): C:\Path-To\WinMerge.exe %merged

Purity answered 22/6, 2012 at 0:35 Comment(1)
Thanks for great tip. I used BComp without the parameters and was really annoied by merge suggestions was always wrong with BComp. Works well with Beyond Compare 4 also.Revoice
C
1

The answer above does not work for us as the explanation of parameters is helpful but wrong (at least for us)

The correct order for us was: [Path]\BCompare.exe %base %mine %theirs %merged

The trick here is to swap %theirs and %merged as Beyond Compare places them wrong. As a hint: the local file must always be displayed at the right hand sight. Left must be revBase and center revHEAD.

Chemiluminescence answered 5/11, 2013 at 10:7 Comment(1)
odd, i have it %mine %theirs %base %merged so the local is left, base middle and theirs on right, and it does a great job of merging.Sestina
I
0

For just the DiffViewer:

Beyond Compare 3 and TortioseSVN (TortoiseSVN 1.9.4)

Settings->DiffViewer. Move Radio button to external and paste in ~

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

Infatuated answered 29/5, 2017 at 23:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.