#!/bin/sh

exit_with_usage () {
    echo "Usage: $0 <svn commit args>"
    echo "Set \$ticket to the name of a ticket to put in the commit message"
    echo "or explicitly set \$ticket to the empty string if no ticket is associated with the commit"
    exit 0
}

case ${1-} in
    -h*) exit_with_usage ;;
    --h*) exit_with_usage ;;
esac

param_unset=true
param_unset=${ticket+false}

if $param_unset; then
    SVN_TEMPLATE_MESSAGE="(SOFTWARE-"
elif test X"$ticket" = X; then
    SVN_TEMPLATE_MESSAGE=""
else
    SVN_TEMPLATE_MESSAGE="($ticket)"
fi
export SVN_TEMPLATE_MESSAGE

exec svn-commit-wrapper "$@"
