[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn diff command

From: Max Bruche <m.e.bruche_at_lse.ac.uk>
Date: 2005-04-15 12:24:35 CEST

> The > svn diff -r n : m URL command 's output is not very "user
> friendly".
>
> Is there an interface, or GUI possible , in order to present the
> result in 2 panels.

This is an ugly hack, but it works:

You can use --diff-cmd to specify the diff command you want to use - and
you can put your favourite GUI diff program in there.

Unfortunately, the arguments are passed to the diff command in a
slightly funny way. There might be a slicker way to do this, but I just
wrote a little script ('mydiff') that I specify as a diff command. That
takes the arguments passed to it by svn and puts them in the order
expected by my favourite diff program (vimdiff):

-- file: mydiff --
#!/usr/bin/python
import sys, os
diffprogram = '/usr/bin/vimdiff'
fn_old = sys.argv[6]
fn_working_copy = sys.argv[7]
# arrange the args in the order diffprogram expects them
args = ['mydiff', '-d', fn_old, fn_working_copy]
os.execv(diffprogram, args)
------------------

I put 'mydiff' as my default -diff-cmd into .subversion/config:
[helpers]
diff-cmd = /usr/local/bin/mydiff

Now when I run svn diff, I get my two panels.

If there is a more elegant way to do this, I would be interested to hear it.

Max

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Apr 15 11:46:32 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.