#!/bin/sh -e
# extract changesets from a bk repo, produce email body

PARENT=$1
DIRBASE=`basename $PWD`

cat <<EOT
Please do a

	bk pull http://oss.sgi.com:8090/$DIRBASE

This will update the following files:

EOT

bk changes -L -d'$unless(:MERGE:){:CSETREV:\n}' $PARENT |
while read rev; do
  bk export -tpatch -r$rev
done | diffstat -p1 2>/dev/null

cat <<EOT

through these ChangeSets:

EOT

bk changes -L $PARENT
