Configure P4merge as my SVN diff tool on OSX
Asked Answered
V

2

11

I want to use P4merge as my external diff tool for files in SVN when comparing local to unchanged. I just spent several hours on this when I should have been coding.

What do I need to do on OSX platform?

Vidal answered 9/1, 2015 at 10:20 Comment(4)
Info at semicrazy.wordpress.com/2009/10/08/… might help? Hope it does.Jillianjillie
I am also interested in a short answer to this particular question. So if anybody has a solution, do not hesitate to post a response here. Thanks in advance.Lacrimatory
we should bounty thisVidal
for the record my team now uses git.Vidal
C
4

This is kind of hacky and only replaces the diff tool, not the merge tool but here it goes:

Create a python script named p4merge-diff-cmd:

#!/usr/bin/env python

import sys
import os.path

P4MERGE = '/Applications/p4merge.app/Contents/Resources/launchp4merge'

p4merge_args= [P4MERGE]
for arg in sys.argv[1:]:
  if os.path.exists(arg):
    p4merge_args.append(os.path.abspath(arg))

os.execv(P4MERGE, p4merge_args)

and make it executable

chmod a+x p4merge-diff-cmd

Then, in your ~/.subversion/config file change the line

# diff-cmd = diff_program (diff, gdiff, etc.)

to

diff-cmd = /full/path/to/p4merge-diff-cmd

Now svn diff <file> should launch p4merge.

Curbstone answered 18/8, 2015 at 17:40 Comment(0)
R
0

Picking up on Stefan's answer, you can check what the parameters are that svn passes through and then write the script to pick out the right ones. I'm on bash, so:

#! /bin/sh
left=$6
right=$7
/Applications/p4merge.app/Contents/MacOS/p4merge $left $right

# Uncomment this to see what svn passes as parameters
# for i in $(seq 1 11)
#   do echo $i : ${!i}
# done

Resale answered 27/4, 2021 at 16:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.