Mercurial > hg > easyhg
diff easyhg-extdiff.sh @ 269:f6b71fda5957
* Rename the -osx.sh files to plain .sh, since we could use them elsewhere too. Rely on bundled kdiff3 if it exists.
author | Chris Cannam |
---|---|
date | Thu, 20 Jan 2011 13:37:00 +0000 |
parents | easyhg-extdiff-osx.sh@43ecb0dcc44e |
children | 24820581e532 |
line wrap: on
line diff
--- /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