Help! How to configure DiffMerge for svn conflicts?

Support for our DiffMerge utility.

Moderator: SourceGear

Post Reply
CaptSaltyJack
Posts: 6
Joined: Thu Apr 09, 2009 1:21 pm

Help! How to configure DiffMerge for svn conflicts?

Post by CaptSaltyJack » Fri May 22, 2009 2:24 pm

I'm using svn command line version on the Mac. I figured out how to get 'svn diff' to use DiffMerge properly: I basically make my own shell script and set the diff-cmd to that. I'll share it here in case anyone else finds it useful:

Code: Select all

#!/bin/sh
diffmerge -u -t1="$3" -t2="$5" $6 $7
But I for the life of me can't figure out how to integrate DiffMerge with svn when there's a merge conflict. I do an svn merge and get this message:

Code: Select all

Conflict discovered in 'Admin/SA_prod_edit.asp'.
Select: (p) postpone, (df) diff-full, (e) edit,
        (mc) mine-conflict, (tc) theirs-conflict,
        (s) show all options: 
Someone PLEASE tell me how to set this up so when this happens, DiffMerge comes up and I can resolve the conflict there. Thanks!

CaptSaltyJack
Posts: 6
Joined: Thu Apr 09, 2009 1:21 pm

Re: Help! How to configure DiffMerge for svn conflicts?

Post by CaptSaltyJack » Fri May 22, 2009 4:28 pm

Figured it out. Was *not* easy, either!

Create a shell script called svnmerge and set your SVN_MERGE env var to that, or use the merge-tool-cmd option in your ~/.subversion/config file.

Here's svnmerge:

Code: Select all

#!/bin/sh
diffmerge -m -t1="Theirs" -t2="Merged" -t3="Mine" -r=$4 $2 $1 $3
So you just merge conflicts and your center window is what your end result will be. Save the changes, mark the file as resolved, and you're good to go.

jeffhostetler
Posts: 534
Joined: Tue Jun 05, 2007 11:37 am
Location: SourceGear
Contact:

Re: Help! How to configure DiffMerge for svn conflicts?

Post by jeffhostetler » Tue May 26, 2009 7:37 am

Thanks for the info. I've not used SVN in a while, so I can't comment on what you've
already said.

You'll want to make sure that you are using the 3.3.0 version of DiffMerge. In that
version, the -r option causes it to exit with an exit-status that reflects the state
of the merge. (Prior to that we always exited with 0.) This is important if you do
periodic saves (to the result file) as you are merging but then decide to abort the
merge.

jeff

CaptSaltyJack
Posts: 6
Joined: Thu Apr 09, 2009 1:21 pm

Re: Help! How to configure DiffMerge for svn conflicts?

Post by CaptSaltyJack » Tue May 26, 2009 8:32 am

Forgot to mention an important point: when this prompt comes up in SVN:
Conflict discovered in 'Admin/SA_prod_edit.asp'.
Select: (p) postpone, (df) diff-full, (e) edit,
(mc) mine-conflict, (tc) theirs-conflict,
(s) show all options:
You need to hit the 'L' key and hit enter to bring up the merge tool. Not too intuitive. At first I thought 'E' for edit would do it, but it doesn't.

mltownsend
Posts: 1
Joined: Fri Jul 17, 2009 4:46 pm

Re: Help! How to configure DiffMerge for svn conflicts?

Post by mltownsend » Fri Jul 17, 2009 4:49 pm

I tried what was suggested for the svnmerge script and I get a --title1 and --title2 much have valid path names or some such thing. Any ideas?
Thanks,
Mark

jeffhostetler
Posts: 534
Joined: Tue Jun 05, 2007 11:37 am
Location: SourceGear
Contact:

Re: Help! How to configure DiffMerge for svn conflicts?

Post by jeffhostetler » Mon Jul 20, 2009 3:24 pm

I'm not sure I understand what you're asking. Maybe if you could paste the script
into your response and maybe a screenshot of what you're getting, I could be more
helpful.

One thing to check is that you have double quotes around the title arguments. You
might also put double quotes around the pathnames too, if they have spaces in them.

jeff

ferozisch
Posts: 1
Joined: Tue Nov 15, 2011 3:40 am

Re: Help! How to configure DiffMerge for svn conflicts?

Post by ferozisch » Tue Nov 15, 2011 3:43 am

Hey,

unfortunately, it does not work for me.
DiffMerge is opening, but it mostly says “File (TEMP FROM SVN IN TEMP DIR) not found.
File (FILE FROM PROJECT) not found – but them are there and accessable :(
Last edited by ferozisch on Thu Jun 14, 2012 1:17 am, edited 2 times in total.

jeffhostetler
Posts: 534
Joined: Tue Jun 05, 2007 11:37 am
Location: SourceGear
Contact:

Re: Help! How to configure DiffMerge for svn conflicts?

Post by jeffhostetler » Tue Nov 15, 2011 10:20 am

Not sure why you're getting this. Could you
tell us which platform you're on and which
versions of svn and diffmerge you have?
If you're on Windows, are you using a command
line based version, a tortoise-based version, or a
cygwin-based version?

also, if you needed to use an interlude script,
could you post it too?

thanks
jeff

Post Reply