#!/usr/bin/sh
#
# Copyright (c) 2006 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# Author: Zack Cerza
#
# Show differences since the last tag

if [ $# -gt 1 ]; then
	usage
	exit 1
fi

if [ $# == 1 ]; then
	pushd $1 > /dev/null
fi

CURRENT_TAG=`rhts-mk-get-current-tag`

if [ -d "CVS" ]; then
    cvs diff -r $CURRENT_TAG
fi

if svn info &> /dev/null; then
    echo "SVN not supported yet!"
    exit 1
fi

if git log -1 &>/dev/null; then
    git diff $CURRENT_TAG .
fi

if [ $# == 1 ]; then
	popd > /dev/null
fi
