在centos7上配置SVN的邮件提醒功能.使用post-commit的hooks函数,详细配置请随意谷歌百度.这里上一下post-commit的代码:
REPOS="$1"
REV="$2"
/usr/share/doc/subversion-1.7.14/hook-scripts/mailer/mailer.py "$REPOS" "$REV" /var/svn/svnrepos/mailer.conf
很简单就是在提交的时候执行了一个mailer.py的函数
可是当我测试时候,发现报错:You need version 1.5.0 or better of the Subversion Python bindings.
既然是和python有关的问题那么请大家看一下这个mailer.py函数关于这个报错的部分
import tempfile # Minimal version of Subversion's bindings required _MIN_SVN_VERSION = [1,5,0] # Import the Subversion Python bindings,making sure they meet our # minimum version requirements. try: import svn.fs import svn.delta import svn.repos import svn.core except ImportError: sys.stderr.write( "You need version %s or better of the Subversion Python bindings.\n" \ % ".".join([str(x) for x in _MIN_SVN_VERSION])) sys.exit(1) if _MIN_SVN_VERSION > [svn.core.SVN_VER_MAJOR,svn.core.SVN_VER_MINOR,svn.core.SVN_VER_PATCH]: sys.stderr.write( "You need version %s or better of the Subversion Python bindings.\n" \ % ".".join([str(x) for x in _MIN_SVN_VERSION])) sys.exit(1)
stackoverflow上的大佬给的两种解释是1) svn.core cannot be imported,or 2) the version number in svn.core is too low.
这里的一种解决办法是:
yum install subversion-python
之后再测试.不再报错.发送成功!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。