# HG changeset patch # User Chris Cannam # Date 1295530620 0 # Node ID f6b71fda59577955f0f5ae17755eafbec4472a50 # Parent b8ded5213d16e095cc3582489d8a601b485db551 * Rename the -osx.sh files to plain .sh, since we could use them elsewhere too. Rely on bundled kdiff3 if it exists. diff -r b8ded5213d16 -r f6b71fda5957 easyhg-extdiff-osx.sh --- a/easyhg-extdiff-osx.sh Mon Jan 17 11:44:17 2011 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -#!/bin/bash -if [ $# -lt 2 ]; then - echo Insufficient arguments: $@ - exit 2 -fi -while [ $# -gt 2 ]; do - shift -done -/usr/bin/opendiff "$1" "$2" | cat diff -r b8ded5213d16 -r f6b71fda5957 easyhg-extdiff.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/easyhg-extdiff.sh Thu Jan 20 13:37:00 2011 +0000 @@ -0,0 +1,23 @@ +#!/bin/bash +p=`dirname $0` +if [ $# -lt 2 ]; then + echo Insufficient arguments: $@ + exit 2 +fi +while [ $# -gt 2 ]; do + shift +done +found="" +for d in kdiff3 kdiff3.exe; do + if [ -x "$p/$d" ]; then + found=true + "$p/$d" "$1" "$2" + break + fi +done +if [ -z "$found" ]; then + od=/usr/bin/opendiff + if [ -x "$od" ]; then + "$od" "$1" "$2" | cat + fi +fi diff -r b8ded5213d16 -r f6b71fda5957 easyhg-merge-osx.sh --- a/easyhg-merge-osx.sh Mon Jan 17 11:44:17 2011 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -#!/bin/bash -echo Args are: $@ 1>&2 -if [ "$#" -lt 3 ]; then - echo Insufficient arguments: $@ - exit 2 -fi -while [ "$#" -gt 3 ]; do - shift -done -/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge \ - -left "$1" -merge "$1" -ancestor "$2" -right "$3" - diff -r b8ded5213d16 -r f6b71fda5957 easyhg-merge.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/easyhg-merge.sh Thu Jan 20 13:37:00 2011 +0000 @@ -0,0 +1,28 @@ +#!/bin/bash +p=`dirname $0` +echo Args are: $@ 1>&2 +if [ "$#" -lt 3 ]; then + echo Insufficient arguments: $@ + exit 2 +fi +while [ "$#" -gt 3 ]; do + shift +done +out="$1" +left="$1" +ancestor="$2" +right="$3" +found="" +for d in kdiff3 kdiff3.exe; do + if [ -x "$p/$d" ]; then + found=true + "$p/$d" "$ancestor" "$left" "$right" -o "$out" + break + fi +done +if [ -z "$found" ]; then + fm=/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge + if [ -x "$fm" ]; then + "$fm" -left "$left" -merge "$out" -ancestor "$ancestor" -right "$right" + fi +fi diff -r b8ded5213d16 -r f6b71fda5957 settingsdialog.cpp --- a/settingsdialog.cpp Mon Jan 17 11:44:17 2011 +0000 +++ b/settingsdialog.cpp Thu Jan 20 13:37:00 2011 +0000 @@ -261,9 +261,7 @@ QString diff = settings.value("extdiffbinary", "").toString(); if (diff == "") { QStringList bases; -#ifdef Q_OS_MAC - bases << "easyhg-extdiff-osx.sh"; -#endif + bases << "easyhg-extdiff.sh"; bases << "kompare" << "kdiff3" << "meld"; bool found = false; foreach (QString base, bases) { @@ -289,13 +287,10 @@ } QString merge; QStringList bases; -#ifdef Q_OS_MAC - bases << "easyhg-merge-osx.sh"; -#endif - // I think this is too dangerous, given command line ordering - // differences and suchlike. Need to make sure the hg - // installation is configured OK instead -// bases << "meld" << "diffuse" << "kdiff3"; + bases << "easyhg-merge.sh"; + // NB it's not a good idea to add other tools here, as command + // line argument ordering varies. Configure them through hgrc + // instead bool found = false; foreach (QString base, bases) { merge = findInPath(base, m_installPath, true);