8

I want to use meld to view the difference between revisions. I installed meld and then executed in the project directory:

svn diff -r 2165:2182 --diff-cmd meld

but it thows up the following error:

Index: app/models/college_friends_count.rb
===================================================================
svn: E200012: Process 'meld' failed (exitwhy 2)

Can anybody tell me what is going wrong here?

aash
  • 1,323
  • 1
  • 14
  • 22
  • Try running meld on two arbitrary files. Does it work? – Ivaylo Strandjev Jun 20 '12 at 07:17
  • 1
    yeah...it is working...also if I change content in some files without commit, meld shows that differences by executing "meld .". But comparing different revisions is not working – aash Jun 20 '12 at 07:21
  • SVN passes to the diff tool not only 2 paths to compare but also other options like labels (you may see all options by passing to --cmd a script that prints its command line). Maybe meld doesn't accept those additional options. I know little about meld, just an idea. – Dmitry Pavlenko Jun 20 '12 at 11:15
  • question. how should I print the command line arguments?..In the link here, http://www.yolinux.com/TUTORIALS/Subversion.html it's written that if i write 'diff-cmd = echo' in subversion/config, it will print the command line arguments. But the error i get in this case is 'svn: E200012: Process 'echo' failed (exitwhy 2) '..wht should i do to print the command line arguments? – aash Jun 20 '12 at 16:02

2 Answers2

7

I believe E200012 means the underlying process (meld) exited with a non-zero exit code. Lots of diff tools do this to indicate the result of the diff operation (0 = no difference 1 = differences, etc).

Though my version of meld doesn't appear to use non-zero exit codes, I know colordiff does, which halts SVN during a directory-crawling "svn diff", like in your example above. Try it on a file that doesn't have any changes to test.

A good fix is to to make your own diff command, let's say you call it meld_svn:

#!/bin/bash
meld "$6" "$7" 
exit 0

So what we're doing is ignoring meld's exit codes, and exiting with our own (which won't stop SVN). The quotes around the arguments mean that filenames with spaces in them won't break your script.

Make it executable, then edit your ~/.subversion/config and set the diff-cmd to "meld_svn". This works great for colordiff, should fix your problem with meld if meld's indeed exiting with non-zero exit codes.

I hope that helps.

Greg
  • 529
  • 5
  • 9
4

For me the problem was that by default svn passes -u as an option to the external diff command, and meld doesn't expect or that flag.

The -x flag for svn-diff allows you to to override this default flag:

 svn diff -x \"\" --diff-cmd meld

This replaces -u with "" on melds command line, the escapes are required so that your shell doesn't parse the quote-marks the first time round and instead passes them to SVN, who passes it onto the meld command line.

(btw, using echo as the diff-cmd allows you to easily inspect what SVN would send to meld)

Ben Page
  • 3,011
  • 4
  • 35
  • 37
  • See [this answer](http://stackoverflow.com/a/7418087/420867) for another approach that also allows meld to do merges. – drevicko Mar 17 '14 at 00:43