Hi all,
how is it possible (or is it not yet?) to display in tortoisesvn an
error-message, which is generated by a pre-commit-hook-script like the
following:
#------------------------------------Snippet-----------------------------------
#REPOS="$1"
#TXN="$2"
# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" > /dev/null
#Prepare an error-message
if [ $? -ne 0 ] ; then
echo "You must give a meaningful comment for commits" > /dev/stderr
exit 1
fi
# Check that the author of this commit has the rights to perform
# the commit on the files and directories being modified.
commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1
# All checks passed, so allow the commit.
exit 0
#---------------------------------End-Snippet---------------------------------
or like this:
#------------------------------------Snippet-----------------------------------
REPOS="$1"
TXN="$2"
# Check for modification of tags.
# Reject tag modifications except creation and deletion
SVNLOOK=/usr/bin/svnlook
echo "=============== changed ================" >>/tmp/pre-commit.log
$SVNLOOK changed -t "$TXN" "$REPOS" >>/tmp/pre-commit.log
$SVNLOOK changed -t "$TXN" "$REPOS" | grep "tags/" >/dev/null
if [ $? -eq 0 ] ; then
$SVNLOOK changed -t "$TXN" "$REPOS" | egrep
"^[AD][[:space:]]+(.*/)?tags/[^/]+/$" >/dev/null
if [ $? -ne 0 ] ; then
echo >&2 "Modification of tags is not allowed"
exit 1
fi
fi
#
# Make sure that the log message contains some text.
$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" > /dev/null
if [ $? -ne 0 ] ; then
echo >&2 "You must give a meaningful comment for commits"
exit 1
fi
exit 0
#---------------------------------End-Snippet---------------------------------
Does anybody know, if possibly the scripts are wrong or if this is
currently not implemented or if i have something misconfigured?
The scripts seem to work, because when i try to do a commit in tortoise,
i will get an error-popup, but the generated error-message is not returned.
thank you very much for your answer,
best regards,
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Thu Sep 30 14:50:03 2004