Posted on 2011-07-22 19:09
幻海蓝梦 阅读(571)
评论(0) 编辑 收藏 所属分类:
版本管理 、
配置管理
SVN里的钩子脚本(T&W)
【post-commit】S204提交之后邮件通知
#!/bin/sh
REPOS="$1"
REV="$2"
DOMAIN=twsh.com
PROJECTNAME=`basename $REPOS`
/urr/local/ActivePerl/site/bin/svnnotify
--repos-path "$1"
--revision "$2"
--to $PROJECTNAME@$DOMAIN
--user-domain $DOMAIN
--smtp 10.58.100.8
--smtp-user svn@twsh.com –
-smtp-pass 15021151553
--subject-prefix [SVN:$PROJECTNAME] -g en_US
--handler "HTML::ColorDiff"
--with-diff
--diff-encoding GBK
【post-commit】DSL库提交之后的邮件通知(DSL是一个大库,里面包含很多小项目库)
.
#!/bin/sh
REPOS="$1"
REV="$2"
DOMAIN=twsh.com
PROJECTNAME=`basename $REPOS`
PATHFILTER='4.02L.03_CT_BCM963293+TK3715_E8C_EPON\|Gewv2.3L19A-B2-V03'
SVNLOOK=/usr/bin/svnlook
if ( $SVNLOOK dirs-changed -r $REV "$REPOS" | grep "$PATHFILTER" > /dev/null ); then
/urr/local/ActivePerl/site/bin/svnnotify \
--repos-path "$REPOS" \
--revision "$REV" \
--to ponsw@twsh.com \
--user-domain $DOMAIN \
--smtp 10.58.100.8 \
--smtp-user svn@twsh.com \
--smtp-pass 15021151553 \
--subject-prefix [SVN:$PROJECTNAME] \
-g en_US \
--handler "HTML::ColorDiff" \
--with-diff \
--diff-encoding GBK
fi
【pre-commit】提交之前LOG限制
#!/bin/sh
REPOS="$1"
TXN="$2"
SVNLOOK=/usr/bin/svnlook
if ( $SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" > /dev/null ); then
exit 0;
fi
echo "Empty log message not allowed. Commit aborted!" >&2
exit 1;
【pre-revprop-chang】实例验证过,可修改:author and log message.
#!/bin/sh
REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5"