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

Re: launching GUI diff from the command line for diff with previous version

From: Jared Silva <jayrod_at_gmail.com>
Date: 2007-05-05 00:03:24 CEST

anjan bacchu wrote:
> Hi There,
>
> I have svn 1.4.2 and tortoisesvn (v 1.4.3, build 8645) on windows xp.
>
> Coming from mostly a clearcase background, where I could do this
> easily with cleartool commandline tool, here's what I want.
>
> I would like to be able to launch a (GUI) diff with the previous version
> of a
> file from the command line. I know that svn diff does that BUT only on the
> console. But what I would like to do is to be
> able to launch the GUI version of the diff. In my case, I configured
> Tortoisesvn to use WindDiff for the diff. TortoiseSvn is somehow able to
> understand which versions I am interested in (working and previous) for
> the diff and then launch Windiff with the required files.
>
> Is there a command-line equivalent to what TortoiseSvn does for the diff ?
> I would like to be able to launch the diff from the console or from an IDE
> BUT I would like to see the WinDiff(or any other GUI diff) utility be diff
> tool.
>
> In a crux, how do I tell the svn diff to just compare the current(hard disk)
> and the previous versions and launch my GUI diff tool for the same ?
>
> If you think I should be posting it to the svn list, pls. let me know.
>
> Thanks for any guidelines and pointers,
>
> BR,
> ~A
> anjan.bacchu@nike.com

See:
Appendix D. Automating TortoiseSVN
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-automation.html

:diff
Starts the external diff program specified in the TortoiseSVN
settings. The /path specifies the first file. If the option /path2 is
set, then the diff program is started with those two files. If /path2
is ommitted, then the diff is done between the file in /path and its
BASE.

This is not the best way to do it (I actually want to set up Bash
completion), but this is the function I defined in my .bashrc.

function tsvn-diff () {
    CMD="cygstart -o TortoiseProc /notempfile /closeonend /command:diff"
    case "${#}" in
        0) CMD="${CMD} /path:\"$(cygpath -aw ".")\"" ;;
        1) CMD="${CMD} /path:\"$(cygpath -aw "${1}")\"" ;;
        2) CMD="${CMD} /path:\"$(cygpath -aw "${2}")\"
/path2:\"$(cygpath -aw "${1}")\"" ;;
        *) CMD="echo Usage: tsvn-diff PATH1 [PATH2]" ;;
    esac
    $CMD ;
}

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: users-help@tortoisesvn.tigris.org
Received on Sat May 5 00:03:40 2007

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

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