Mason Wheeler
Mason Wheeler

Reputation: 84540

How do I configure TortoiseSVN's external merge behavior?

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?

Upvotes: 13

Views: 8301

Answers (3)

EricT
EricT

Reputation: 1

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

Upvotes: 0

Samuel
Samuel

Reputation: 6490

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.

Upvotes: 1

Ken White
Ken White

Reputation: 125620

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

Upvotes: 15

Related Questions