view easyhg-merge.sh @ 278:f7cdd5b31aed new-branches

Add "Start new branch" function. I'm not quite satisfied with the location of this one
author Chris Cannam
date Wed, 09 Feb 2011 12:03:15 +0000
parents f6b71fda5957
children 24820581e532
line wrap: on
line source
#!/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