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

RE: confusion over external svn diff and merge on windows

From: Adam Downer <adam.downer_at_ri3k.com>
Date: Fri, 6 May 2011 11:33:06 +0100

In an attempt to answer my own question I set my diff wrapper script to
simply echo the arguments passed to it into a txt file. I am aware that
in windows I only have access to the first nine args at a time. So I
echo args 1 - 9 and then shifted 9 times and echoed all 9 args again
(just to make sure I got them all).

The results on my first run were very surprising. I got the kdiff
complaint dialogue box!

Checking over my svn config revealed that diff-cmd and diff3-cmd also
need to be set to invoke my wrapper script as well as merge_cmd in order
for it to stop complaining. So now I need to write three different
wrappers to capture which args are being passed for each possible
invocation.

With that done I finally get a list of what args are being passed in
each scenario. Although it only appears to be calling the diff3_cmd
command during the merge and nothing else.

So the following is what I discovered the parameters are (in order):

-E
-m
-L
.working
-L
.merge-left.r63029
-L
.merge-right.r63498
project\.svn\tmp\tempfile.2.tmp
\tmp\tempfile.1.tmp
project\.svn\tmp\tempfile.tmp

So it seems that svn is passing the 'mine', 'theirs' and 'base' as the
last three vars as stated in the book. There is no obvious sign of a
specified result file so it seems that a cat/type is still required.
Based on these I throw them into vars (after some shifting for windows)
for passing to the kdiff3 executable:

MINE=%7 (project\.svn\tmp\tempfile.2.tmp) Target revision for
merging into. I am not sure if these are the right way round at this
point!
YOURS=%9 (project\.svn\tmp\tempfile.tmp) Source to be merged in.
BASE=%8 (\tmp\tempfile.1.tmp 63029 is the rev immediately before the
rang I am merging so this must be BASE)

So in the end the wrapper script needs to be (for kdiff3):

@ECHO OFF

REM Subversion provides the paths we need as parameters.
SET BASE=%8
SET MINE=%7
SET YOURS=%9

REM Call the merge command (change the following line to make sense for
REM your merge program).
%DIFF3% %BASE% %MINE% %YOURS% -o merged_result.tmp

type merged_result.tmp

But no Joy with this. The path \tmp\tempfile.1.tmp is causing trouble.
In windows it tries to open the file (with a dialog box appearing (what
program do you wish to use to open this)

So I hit 'l' to launch external merge prog.
This invokes the merge_cmd wrapper and passes a different set of args:

/tmp/tempfile.3.tmp
project/.svn/tmp/tempfile.tmp
project/.svn/tmp/tempfile.3.tmp
project/.svn/tmp/pom.xml.2.tmp
project/pom.xml

So now I am even more confused. I am still unable to find api docs or
anything on what the passed args should be. Could anyone hel with that?
I think I am close to making it work.

Thanks in advance

Adam D

________________________________________________________________________

PLEASE NOTE THAT WE HAVE MOVED.
Our new address is 4th Floor, Dashwood House, 69 Old Broad Street, London, EC2M 1QS. Our new telephone number is +44 (0) 20 3535 8300.

This e-mail and its attachments are confidential. If you are not the intended recipient of this e-mail message, please telephone or e-mail us immediately, delete this message from your system and do not read, copy, distribute, disclose or otherwise use this e-mail message and any attachments.

Although RI3K believes this e-mail and any attachments to be free of any virus or other defect which may affect your computer, it is the responsibility of the recipient to ensure that it is virus free and RI3K does not accept any responsibility for any loss or damage in any way from its use.

RI3K Limited is a company registered in England no: 3909745. Registered office 4th Floor, Dashwood House, 69 Old Broad Street, London, EC2M 1QS. VAT registration no: 769 0192 07
Received on 2011-05-06 12:33:41 CEST

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