svn:钩子post-commit

# The post-commit hook is invoked(调用) after a commit.  Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-commit' (for which this file is a template) with(使用) the 
# following ordered(命令) arguments:
#
#   [1] REPOS-PATH   (the path to this repository)
#   [2] REV          (the number of the revision(版本) just committed)
#
# The default working directory for the invocation(调用) is undefined, so
# the program should set one explicitly(明确的) if it cares(真的在乎).
#
# Because the commit has already completed and cannot be undone,
# the exit(退出) code of the hook program is ignored.  The hook program
# can use the 'svnlook' utility(工具) to help it examine the
# newly-committed tree.
#
# On a Unix system, the normal procedure is to have 'post-commit'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# Note that 'post-commit' must be executable(可执行) by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'post-commit.bat' or 'post-commit.exe',
# but the basic idea is the same.

# The hook program typically(一般) does not inherit(继承) the environment of
# its parent process.  For example, a common problem is for the
# PATH environment variable to not be set to its usual value, so
# that subprograms fail to launch(启用) unless invoked via absolute(绝对) path.
# If you're having unexpected problems with a hook program, the
# culprit(罪魁祸首) may be unusual(异常) (or missing) environment variables.

# Here is an example hook script, for a Unix /bin/sh interpreter(解释).
# For more examples and pre-written hooks, see those in
# the Subversion repository at
# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and
# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/




REPOS="$1"
REV="$2"


mailer.py commit "$REPOS" "$REV" /path/to/mailer.conf
总结:
1、post-commit的作用
The post-commit hook is invoked after a commit.
2、参数
#   [1] REPOS-PATH   (the path to this repository)
#   [2] REV          (the number of the revision just committed)
3、svnlook
4、使用的user对post-commit可执行权限和对要操作的库有access权限。
5、windows下重命名为'post-commit.bat' or 'post-commit.exe'。
6、子程序不能继承父程序的环境变量。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23890223/viewspace-2143094/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/23890223/viewspace-2143094/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值