You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jeff Price <je...@gmail.com> on 2005/03/03 20:36:01 UTC

Bug in --diff-cmd argument passing?

I'm trying to get svn --diff-cmd working with an external diff program
(opendiff, aka FileMerge).  Here are the arguments passed using
Subversion 1.1.3 on Mac OS 10.3.8:
---------------------------------------------------------------------------------
>$ svn diff --diff-cmd svndiffargs.pl Day.txt
Index: Day.txt
===================================================================
numArgs = 7
0 : -u
1 : -L
2 : Day.txt     (revision 1)
3 : -L
4 : Day.txt     (working copy)
5 : .svn/text-base/Day.txt.svn-base
6 : .svn/tmp/Day.txt.tmp
>
---------------------------------------------------------------------------------
Notice that none of the 7 arguments passed by -diff-cmd are the actual
working copy. According to a thread in the group from 8/2003, argument
6 used to be the working copy filename. Now, however, arg 6 it is a
non-existent file under .svn/tmp. (At least the .tmp file is
non-existent when my script gets to the part that tries to launch
opendiff.)

Any thoughts?

Thanks!
Jeff

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Bug in --diff-cmd argument passing?

Posted by Matt Gillette <ma...@netcell.com>.
I'm not sure why this happens, but there is a workaround. Included in  
the download of svnX*  is a script (it's in the app's resource folder).  
Basically all it does is copy the temp file before calling opendiff.

> cp -f "$6" /tmp/svnx-opendiff.tmp
> cp -f "$7" /tmp/svnx-opendiff2.tmp
>
> # Sometimes, svn diff wants us to diff from a tmp file. (don't know  
> why)
> # We want to diff the real working copy file.
>
> f=`echo "$7" | sed -e 's/\.svn\/tmp\/\(.*\)\.tmp$/\1/'`
>
> name=$5
> isWorkingCopy=${name/*(working copy)/1}
>
> if [ "$isWorkingCopy" == "1" ]
> then
> 	/usr/bin/opendiff /tmp/svnx-opendiff.tmp "$f" -merge "$f"
> else
> 	/usr/bin/opendiff /tmp/svnx-opendiff.tmp /tmp/svnx-opendiff2.tmp
> fi

This works from the command line. If anyone knows how to make this work  
for Xcode, I'd be glad to hear it (xcode compare will only work with  
the latest changes for me)

Matt

*  
http://www.lachoseinteractive.net:81/en/community/subversion/svnx/ 
download/

On Mar 3, 2005, at 12:36 PM, Jeff Price wrote:

> I'm trying to get svn --diff-cmd working with an external diff program
> (opendiff, aka FileMerge).  Here are the arguments passed using
> Subversion 1.1.3 on Mac OS 10.3.8:
> ----------------------------------------------------------------------- 
> ----------
>> $ svn diff --diff-cmd svndiffargs.pl Day.txt
> Index: Day.txt
> ===================================================================
> numArgs = 7
> 0 : -u
> 1 : -L
> 2 : Day.txt     (revision 1)
> 3 : -L
> 4 : Day.txt     (working copy)
> 5 : .svn/text-base/Day.txt.svn-base
> 6 : .svn/tmp/Day.txt.tmp
>>
> ----------------------------------------------------------------------- 
> ----------
> Notice that none of the 7 arguments passed by -diff-cmd are the actual
> working copy. According to a thread in the group from 8/2003, argument
> 6 used to be the working copy filename. Now, however, arg 6 it is a
> non-existent file under .svn/tmp. (At least the .tmp file is
> non-existent when my script gets to the part that tries to launch
> opendiff.)
>
> Any thoughts?
>
> Thanks!
> Jeff
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org