summaryrefslogtreecommitdiff
path: root/BitKeeper/triggers/post-commit
blob: 3f347e4c596a669b81114b5af12893d505f8b324 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/sh

#shift
FROM=$USER@mysql.com
INTERNALS=internals@lists.mysql.com
DOCS=docs-commit@mysql.com
LIMIT=10000
VERSION="4.1"

if [ "$REAL_EMAIL" = "" ]
then
 echo "Warning: you must set REAL_EMAIL in your profile"
else
 FROM=$REAL_EMAIL 
fi

BK_STATUS=$BK_STATUS$BK_COMMIT

if [ "$BK_STATUS" = OK ]
then 

CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet`
BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/ BUG#\1/p'`
WL=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Ww][Ll] *# *\([0-9][0-9]*\).*$/ WL#\1/p'`

if [ "$BUG" = "" ]
then
  TO=dev-public@mysql.com
else
  TO=dev-bugs@mysql.com
fi
#++
# dev-public@ / dev-bugs@
#--
 echo "Commit successful, notifying developers at $TO"
 (
   cat <<EOF
List-ID: <bk.mysql-$VERSION>
From: $FROM
To: $TO
Subject: bk commit - $VERSION tree ($CHANGESET)${BUG}${WL}

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

#++
# internals@ mail
#--
 echo "Notifying internals list at $INTERNALS"
 (
   cat <<EOF
List-ID: <bk.mysql-$VERSION>
From: $FROM
To: $INTERNALS
Subject: bk commit into $VERSION tree ($CHANGESET)

Below is the list of changes that have just been committed into a local
$VERSION repository of $USER. When $USER does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

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

#++
# docs-commit@ mail
# Picks up anything under the Docs subdirectory (relevant for docs team).
#--
 bk changes -v -r+ | grep -q "  Docs/"
 if [ $? -eq 0 ]
 then
  echo "Notifying docs list at $DOCS"
  (
    cat <<EOF
List-ID: <bk.mysql-$VERSION>
From: $FROM
To: $DOCS
Subject: bk commit - $VERSION tree (Manual) ($CHANGESET)

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

else
  echo "commit failed because '$BK_STATUS', you may need to re-clone..." 
fi