# HG changeset patch # User Thomas Arendsen Hein # Date 1118386220 -3600 # Node ID 15a9e55e7ea58a5fea96a91d832eecdb9fbe1d9e # Parent 7c239fad0f27861bf180048583fdeabe4ebce896 Check if $DISPLAY is set before using tkdiff or kdiff3. diff -r 7c239fad0f27 -r 15a9e55e7ea5 hgmerge --- a/hgmerge Thu Jun 09 09:48:50 2005 -0800 +++ b/hgmerge Fri Jun 10 07:50:20 2005 +0100 @@ -29,21 +29,23 @@ cp $LOCAL.orig $LOCAL fi -# try using kdiff3, which is fairly nice -if which kdiff3 > /dev/null ; then - if kdiff3 --auto $BASE $LOCAL $OTHER -o $LOCAL ; then - exit 0 - else - exit 1 +if [ -n "$DISPLAY" ]; then + # try using kdiff3, which is fairly nice + if which kdiff3 > /dev/null ; then + if kdiff3 --auto $BASE $LOCAL $OTHER -o $LOCAL ; then + exit 0 + else + exit 1 + fi fi -fi -# try using tkdiff, which is a bit less sophisticated -if which tkdiff > /dev/null ; then - if tkdiff $LOCAL $OTHER -a $BASE -o $LOCAL ; then - exit 0 - else - exit 1 + # try using tkdiff, which is a bit less sophisticated + if which tkdiff > /dev/null ; then + if tkdiff $LOCAL $OTHER -a $BASE -o $LOCAL ; then + exit 0 + else + exit 1 + fi fi fi