I have a working Subversion Post Commit working OK - how do I add in the comments made by the user performing the commit?
My code is
REPOS="$1"
REV="$2"
AUTHOR="$(svnlook author -r $REV $REPOS)"
mailer.py commit "$REPOS" "$REV" /path/to/mailer.conf
# Script to send simple email when SVN is updated
# email subject
SUBJECT="[Project Name goes here] - new commit made in Subversion"
# Email To
EMAIL="[email addresses go here]"
# Date and time
DATE="$(date)"
# Email text/message
EMAILMESSAGE="/tmp/buildingcontrolmessage.txt"
echo "The commit happened: " $DATE > $EMAILMESSAGE
echo "Repository: " $1 >> $EMAILMESSAGE
echo "Reveision: " $2 >> $EMAILMESSAGE
echo "The commit was made by: $AUTHOR" >> $EMAILMESSAGE
# send an email using /bin/mail
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE
I'd just like to add a line in the e-mail to say:
echo "Comment: $MSG" >> $EMAILMESSAGE
But I'm not sure how to get the message from the commit.
Thanks for any help and advice.
You have to parse the commit message from the output of svnlook info. Documentation:
Print the author, datestamp, log message size (in bytes), and log message, followed by a newline character.