How to integrate WinMerge with TortoiseSvn after installation?
Asked Answered
C

3

72

When you install winmerge after TortoiseSVN it gives you the option of associating winmerge with Tortoise. But if we install TortoiseSVN after winmerge how can we associate Winmerge to be used instead of Tortoise default diff viewer.

Cambyses answered 6/3, 2012 at 6:3 Comment(0)
M
100

You can open the TortoiseSVN settings and manually enter it:

enter image description here

My command line from the screenshot above is:

C:\Program Files (x86)\WinMerge\WinMergeU.exe -e -x -ub -dl %bname -dr %yname %base %mine

If you install TortoiseSVN after WinMerge, probably the easiest way would be to uninstall and re-install WinMerge again.

Moving answered 6/3, 2012 at 6:7 Comment(3)
I like to see the changed version in the left pane, so this is mine: C:\Program Files (x86)\WinMerge\WinMergeU.exe -e -ub -dl %yname -dr %bname %mine %baseIsomerous
I know the installer sets this options, but the official documenation, doesn't mention the -ub option. Looking at MergeCmdLineInfo.cpp, I found out that this means -ul and -ur combined. Source code says this option is deprecated and only -u works too.Paramedical
I also added a /wl since I don't see why i would want/allow to edit the base here. The docs only use windows-style switched (/ not -) so i went with that but i guess both work.Counselor
R
26

You can also use WinMerge for merging changes. In the settings window (as above) under Merge Tool, enter:

32-bit os

C:\Program Files\WinMerge\WinMergeU.exe -e -x -ub -dl %tname -dr %yname %theirs %mine

64-bit os

C:\Program Files (x86)\WinMerge\WinMergeU.exe -e -x -ub -dl %tname -dr %yname %theirs %mine

Then you'll get the remote file in the left pane, your local (changed) file in the right pane.

Rhinal answered 11/2, 2014 at 18:10 Comment(1)
Actually, I think it works better when you resolve it afterwards if you use the "wl" (read-only left pane) and %merged for output path. I use the following: C:\Program Files (x86)\WinMerge\WinMergeU.exe -e -x -ub -dl %tname -wl -dr %yname %theirs %mine %mergedVocalise
R
23

Diff Viewer

C:\Program Files\WinMerge\WinMergeU.exe -e -x -u -wl -dl %bname -dr %yname %base %mine

With:

  • -e enables you to close WinMerge with a single Esc key press.
  • -x closes WinMerge (after displaying an information dialog) when you start a comparison of identical files.
  • -u prevents WinMerge from adding either path (left or right) to the Most Recently Used (MRU) list.
  • -wl opens the left side as read-only.
  • -dl %bname specifies a description of the original file in the left side title bar.
  • -dr %yname specifies a description of your own file in the right side title bar.
  • %base specifies the left side file with the original file.
  • %mine specifies the right side file with your own file.

Merge Tool

C:\Program Files\WinMerge\WinMergeU.exe -e -x -u -wl -dl %tname -dr %yname %theirs %mine %merged

With the same options as above except:

  • -dl %tname specifies a description of the repository file in the left side title bar.
  • %theirs specifies the left side file with the repository file.
  • %merged specifies the conflicted file, the result of the merge operation.
Rampage answered 12/4, 2017 at 7:32 Comment(4)
For me, it only worked to click the Advanced button and Edit the .docx line, pasting the command line into the External Program field.Glandulous
Thanks for useful summary of what each different command line switch does.Judoka
Thanks for calling out the Merge Tool setting!Abyss
Great answer. Except that Winmerge now comes in 64 bits flavor, so "x86" in the path is not requested anymore :)Judoka

© 2022 - 2024 — McMap. All rights reserved.