#!/bin/sh # # post-incoming.mail - A BitKeeper trigget to send incoming ChangeSets to the # linux-ntfs-cvs mailing list, one ChangeSet per email. # # Copyright (c) 2005 Yura Pakhuchiy # Copyright (c) 2005 Anton Altaparmakov # # 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. ######################################################################### # This script should only be run on successful incoming pushes in the # repository on bkbits.net. if [ "x${BK_SIDE}" != "xserver" ]; then exit 0 fi if [ "x${BK_EVENT}" != "xincoming push" ]; then exit 0 fi if [ "x${BK_STATUS}" != "xOK" ]; then exit 0 fi if [ -z "$(echo ${BKD_HOST} | grep bkbits.net)" ]; then exit 0 fi EMAIL="ntfs-cvs " REPLYTO="ntfs-dev " # For each ChangeSet, send an email. bk changes -f -d'$unless(:MERGE:){:CSETREV:\n}' - < "${BK_CSETLIST}" 2>/dev/null | while read rev; do SUBJECT="Subject: bk-$(echo ${BKD_ROOT} 2>/dev/null | sed "s#.*/##" 2>/dev/null): ChangeSet@${rev} by ${BK_USER}@${BK_HOST}" { bk changes -f -d'$unless(:MERGE:){ChangeSet|:CSETREV:\n}' -r$rev 2>/dev/null | bk -R prs -h -d'$unless(:MERGE:){ChangeSet@:I:, 20:Dy:-:Dm:-:Dd: :T::TZ:, :P:@:HOST:\n}' - 2>/dev/null cat </dev/null | diffstat -p1 2>/dev/null cat </dev/null cat </dev/null cat </dev/null } | mail -R "\"${REPLYTO}\"" -s "\"${SUBJECT}\"" "\"${EMAIL}\"" done exit 0