SVN提交强制加入注释

来源:互联网 发布:手机淘宝如何评价 编辑:程序博客网 时间:2024/06/02 22:45

主要以window版本为主:

(1)安装svn,安装完成后,生成svn目录

这里写图片描述

(2)备份文件pre-commit.tmpl

(3)添加bat文件pre-commit.bat(windows)

@echo offsetlocalset REPOS=%1set TXN=%2rem check that logmessage contains at least 10 charactersrem ..代表2个字符svnlook log "%REPOS%" -t "%TXN%" | findstr ".." > nulif %errorlevel% gtr 0 goto errexit 0:errecho Log Message at least two characters. Commit aborted! 1>&2exit 1

4:linux环境编辑pre-commit.tmpl

REPOS="$1"TXN="$2"# Make sure that the log message contains some text.SVNLOOK=/usr/local/bin/svnlookSVNLOOKlog−t"TXN" "$REPOS" | \   grep "[a-zA-Z0-9]" > /dev/null || exit 1# Check that the author of this commit has the rights to perform# the commit on the files and directories being modified.commit-access-control.pl "REPOS""TXN" commit-access-control.cfg || exit 1# All checks passed, so allow the commit.exit 0
0 0