Using Beyond Compare inside Eclipse for Merging in Subversion
Asked Answered
S

1

18

I would like to use Beyond Compare inside Eclipse. The problem at hand is, that the native diff and merge tool does not allow to customize the diff enough, so there are too much differences. Beyond Compare has the right customization for that, but I could not integrate the tool. I have tried the following:

  1. Use the Eclipse Plugin http://beyondcvs.sourceforge.net/ But I could not configure Subversive inside Eclipse to use that plugin, and the plugin does not integrate itself into the merge action of Subversive.
  2. Tried to integrate Beyond Compare as the diff viewer (see Eclipse Window > Preferences > Team > SVN > Diff Viewer). When doing then a synchronize, the diff viewer I configured was not used at all. I followed the information found at http://www.scootersoftware.com/download.php?c=kb_vcs under the point "tortoisesvn" and changed the syntax as needed by the Subversive plugin.

Has anyone succeeded in integrating Beyond Compare in Eclipse for Subversion? I have found the similar question How to configure Beyond Compare 3 for Eclipse conflict resolution?, but it did not work for me (perhaps the difference between Subversive and Subclipse?).


Addition: I followed the steps of @Tom Clift (thank's a lot), and the diff is now working, the merge was a little bit more difficult. I have done the following steps to final success:

  1. Configured as documented by the answer.
  2. Changed something on a branch and commited that.
  3. Switched to the trunk.
  4. Started there the merge operation: Team > Merge... > Tab URL > URL Field: <branch URL> and Radio button "Start from copy"
  5. When pressing Ok, a dialog pops up that ask if it is ok to open the "Synchronize View".
  6. The synchronize perspecitve shows all changes, and when I select one, there is a menu entry "Open in external compare editor" that opens Beyond Compare.
Squirrel answered 10/6, 2011 at 13:13 Comment(0)
H
28

Steps for configuring Eclipse (tested with 3.7 (Indigo) through 4.4 (Luna)) with Subversive to use Beyond Compare as the default diff and merge tool (may work with other versions too):

Note: per MattPassell's comment there seems to be an outstanding issue on OS X (and Linux?) with spaces in paths and arguments. The config below for OS X works around this by avoiding spaces.

  1. Preferences → Team → SVN → Diff Viewer
  2. Add...
  3. Extension or mime-type: *
  4. Diff program arguments → Program Path: enter the path for the Beyond Compare binary (with no arguments). E.g.:
    • OS X: /Users/tom/bin/bcomp (which is a symlink to /Applications/Beyond Compare.app/Contents/MacOS/bcomp to avoid spaces in the path)
    • Windows: C:\Program Files (x86)\Beyond Compare 3\BComp.exe
  5. Diff program arguments (box):
    • OS X:
      ${base} ${mine} -lefttitle=Base -righttitle=Local
    • Windows:
      "${base}" "${mine}"
      /lefttitle="Base ${base}"
      /righttitle="Local ${mine}"
      
  6. Merge program arguments → Program path: path to binary again.
  7. Merge program arguments (box):
    • OS X:
      ${theirs} ${mine} ${base} ${merged}
      -lefttitle=Incoming
      -centertitle=Base
      -righttitle=Local
      -outputtitle=Merged
    • Windows:
      "${theirs}" "${mine}" "${base}" "${merged}"
      /lefttitle="Incoming (${theirs})"
      /centertitle="Base (${base})"
      /righttitle="Local (${mine})"
      /outputtitle="Merged (${merged})"
      
  8. OK

Eclipse 3.7 (Indigo) Subversive configuration for Beyond Compare

I have tried and failed to configure Beyond Compare as a diff tool with Subclipse (it seems to only have external tool configuration for merge/conflict).

Herold answered 13/10, 2011 at 4:23 Comment(10)
Thank's a lot, I will give it a try and come back later.Squirrel
Sorry for the big delay ... I have tried it now, and the diff works quite well, but the merge didn't. I have documented the steps in my question.Squirrel
Found the problem, and docuemnted it in the question. Thank's a lot again.Squirrel
np. Not sure why the merge wouldn't work normally, although I've only used it a few times when merging a conflict on update, and I usually update from outside Eclipse (TortoiseSVN / terminal).Herold
I'm trying to make this work on a Mac and the space in the path is throwing things off. I've tried quoting it and backslashing the space and neither of those works. Any suggestions?Ancon
@MattPassell I've had problems with that too - haven't tested to find out if it's Subversive or Beyond Compare to blame. As a workaround I keep spaces out of everything. For program path I use /Users/tom/bin/bcomp, which is a symlink to the Applications one. Spaces in argument values also seem to be a problem, and I assume they would be in paths, but haven't tested. I'll add a section to the answer, but we really should reproduce and raise bugs appropriately :)Herold
@TomClift I did some more digging and I think it's Subversive's fault. On the bright side, Beyond Compare 4 now includes a menu item under the main "Beyond Compare" menu called "Install Command Line Tools..." which creates a symlink similar to yours, but at /usr/local/bin/bcomp. Oh, and thanks for clarifying that under Linux/Mac the args start with a '-' instead of a '/'.Ancon
Compare works (when comparing older revisions) but merge doesn't (such as synchronizing the current file)Trombley
@united-expression related to spaces in the path on OS X, or something else?Herold
I'm working on Windows 7, no idea why it fails, nothing is shown just the eclipse merge tool opens.Trombley

© 2022 - 2024 — McMap. All rights reserved.