post-commit 2.02 KB
Newer Older
1 2
#!/bin/sh

3
#shift
4
FROM=$USER@mysql.com
5
INTERNALS=internals@lists.mysql.com
6
DOCS=docs-commit@mysql.com
7
LIMIT=10000
8
VERSION="4.0"
9

10 11 12 13 14 15 16
if [ "$REAL_EMAIL" = "" ]
then
 echo "Warning: you must set REAL_EMAIL in your profile"
else
 FROM=$REAL_EMAIL 
fi

17 18
BK_STATUS=$BK_STATUS$BK_COMMIT

19
if [ "$BK_STATUS" = OK ]
20
then 
21

serg@serg.mylan's avatar
serg@serg.mylan committed
22
CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet`
23
BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/\1/p'`
24

25 26 27
if [ "$BUG" = "" ]
then
  TO=dev-public@mysql.com
28 29
  BS=""
  BH=""
30 31
else
  TO=dev-bugs@mysql.com
32 33 34 35
  BS=" BUG#$BUG"
# need newline here
  BH="X-Bug: $BUG
"
36
fi
37
#++
38
# dev-public@ / dev-bugs@
39
#--
40 41 42
 echo "Commit successful, notifying developers at $TO"
 (
   cat <<EOF
43
List-ID: <bk.mysql-$VERSION>
44 45
From: $FROM
To: $TO
46 47
Subject: bk commit - $VERSION tree ($CHANGESET)$BS
$BH
48 49 50 51
EOF
  bk changes -v -r+
  bk cset -r+ -d
 ) | head -n $LIMIT | /usr/sbin/sendmail -t
52 53 54 55

#++
# internals@ mail
#--
56 57 58
 echo "Notifying internals list at $INTERNALS"
 (
   cat <<EOF
59
List-ID: <bk.mysql-$VERSION>
60 61
From: $FROM
To: $INTERNALS
62 63
Subject: bk commit into $VERSION tree ($CHANGESET)$BS
$BH
64
Below is the list of changes that have just been committed into a local
65
$VERSION repository of $USER. When $USER does a push these changes will
66 67
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
68
For information on how to access the public repository
69
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
70 71 72

EOF
  bk changes -v -r+
73
  bk cset -r+ -d
74
 ) | head -n $LIMIT | /usr/sbin/sendmail -t
75 76

#++
77
# docs-commit@ mail
78
# Picks up anything under the Docs subdirectory (relevant for docs team).
79
#--
80
 bk changes -v -r+ | grep -q "  Docs/"
serg@serg.mysql.com's avatar
serg@serg.mysql.com committed
81
 if [ $? -eq 0 ]
82 83 84 85
 then
  echo "Notifying docs list at $DOCS"
  (
    cat <<EOF
86
List-ID: <bk.mysql-$VERSION>
87 88
From: $FROM
To: $DOCS
89
Subject: bk commit - $VERSION tree (Manual) ($CHANGESET)$BS
90 91 92 93 94 95 96

EOF
  bk changes -v -r+
  bk cset -r+ -d
 ) | head -n $LIMIT | /usr/sbin/sendmail -t
 fi

97
else
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
98
  echo "commit failed because '$BK_STATUS', you may need to re-clone..." 
99
fi