当我从运行SVN和Trac的服务器提交更改时,post-commit挂钩工作正常。然而,当我从我的Mac远程提交时,活动显示在Trac的时间线上,但工单没有更新。
我已经在Netbeans 7和命令行中尝试过了--结果是一样的。我在服务器和Mac上使用相同的用户名登录,尽管使用的密码不同。我知道这应该无关紧要,因为直到几天前,一切都工作得很好,直到几天前。
我不确定我的Mac或服务器上可能发生了什么变化,从而破坏了这一功能。
更多信息,添加了2011年7月26日:
在我的Mac上,我使用svn+ssh://,在服务器上使用file:///
我确实将Trac日志级别设置为DEBUG,但我不太确定我应该寻找什么。
我的提交后脚本如下所示。请注意,我知道post-commit本身是有效的,因为QA更新和Campfire post都可以工作。我还尝试将$TRAC_ENV、$REPOS和$REV输出到一个文件中,并且所有变量都设置正确。
#!/bin/sh
# POST-COMMIT HOOK
#
# 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:
#
<<<more comments, yada, yada>>>
#
# 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.collab.net/repos/svn/trunk/tools/hook-scripts/ and
# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
REPOS="$1"
REV="$2"
TRAC_ENV=/usr/share/trac/projects/main
#commit-email.pl "$REPOS" "$REV" commit-watchers@example.org
#log-commit.py --repository "$REPOS" --revision "$REV"
# update the qa working copy
/usr/bin/ruby /usr/local/svn-repo/hooks/scripts/svn-dev-wc-update.rb $REPOS $REV
# send a message to Trac concerning this commit
/usr/bin/trac-admin $TRAC_ENV changeset added $REPOS $REV
# send a message to Campfire's Engineering room
/usr/bin/ruby /usr/local/svn-repo/hooks/scripts/campfire-announce.rb $REPOS $REV 发布于 2011-07-26 07:51:34
你能发布提交后钩子脚本的内容吗?
当您从服务器提交时,您将如何访问存储库?您是使用存储库的file://语法,还是使用远程提交时使用的相同svn+ssh:// URL?如果您同时尝试这两种访问方法,是否会得到相同的结果?
此外,尝试将Trac的日志记录选项调高到最大值,并查看日志文件中是否包含有用的内容。
发布于 2012-05-24 18:19:30
这是个老问题,但我也有同样的问题,很快就解决了。我只收到一条错误消息:
Warning: post-commit hook failed (exit code 2) with output:
Error: Command not found找不到的命令不是tracadmin可执行文件。当我通过https提交时,这并没有发生。但是有什么不同呢?不同之处在于https commit将调用挂钩,因为用户'www-data‘和svn+ssh commit将使用实际用户的帐户。
我创建了一个名为svnwrite的组,将我自己添加到其中,并将该组的写入权限添加到我的trac项目目录中,从而解决了这个问题。
https://stackoverflow.com/questions/6805824
复制相似问题