svn commit: r44993 - svnadmin/hooks/scripts

Peter Wemm <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
Author: peter (src committer)
Date: Mon Jun  2 07:19:04 2014
New Revision: 44993
URL: http://svnweb.freebsd.org/changeset/doc/44993

Log:
  Add post-commit -> bugzilla notifier
  
  Approved by:	doceng (not really, but this is time sensitive)

Added:
  svnadmin/hooks/scripts/notify_bz.sh   (contents, props changed)

Added: svnadmin/hooks/scripts/notify_bz.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ svnadmin/hooks/scripts/notify_bz.sh	Mon Jun  2 07:19:04 2014	(r44993)
@@ -0,0 +1,41 @@
+#! /bin/sh
+# $FreeBSD$
+
+# A trivial stop-gap script to send a cross-reference for commits to bugzilla.
+
+TZ=UTC
+export TZ
+
+REPO="$1"
+REV="$2"
+
+if [ -z "$REV" -o -z "$REPO" -o ! -d "$REPO" ]; then
+  echo "Bad args: repo rev" 1>&2
+  exit 1
+fi
+
+PR="$(svnlook info "$REPO" -r "$REV" | sed -nE -e 's/^[ 	]*[pP][rR]:[ 	]*[a-zA-Z]+\/([0-9]+)/\1/p' -e 's/^[ 	]*[pP][rR]:[ 	]*([0-9]+)/\1/p')"
+
+if [ -z "$PR" ]; then
+  exit 0
+fi
+WHO="$(svnlook author "$REPO" -r "$REV")"
+
+(
+echo "From: [email protected]"
+echo "To: [email protected]"
+echo "Subject: [Bug $PR]"
+echo ""
+echo "A commit references this bug:"
+echo ""
+echo "Author: $WHO"
+echo "Date: $(date)"
+echo "New revision: $REV"
+echo "URL: http://svnweb.freebsd.org/changeset/doc/$REV"
+echo ""
+echo "Log:"
+svnlook log "$REPO" -r "$REV" | sed -e 's/^/  /'
+echo ""
+echo "Changes:"
+svnlook changed "$REPO" -r "$REV" | sed -E -e 's/^[A-Z]*[ 	]+/  /'
+) | sed -e 's/^[ 	]*$//' | cat -s | /usr/sbin/sendmail -oi -f [email protected] [email protected]
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-doc-all
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.