当我从运行 SVN 和 Trac 的服务器提交更改时,提交后挂钩工作正常。然而,当我从我的 Mac 远程提交时,该活动显示在 Trac 的时间线中,但票证没有得到更新。
我已经在 Netbeans 7 以及命令行中尝试过这个 - 结果相同。我在服务器和 Mac 上使用相同的用户名登录,但密码不同。我知道这应该没关系,因为几个月前一切都运行良好,直到几天前。
我不确定我的 Mac 或服务器上可能发生了什么更改以破坏此功能。
更多信息,于 2011 年 7 月 26 日添加:
在我的 Mac 上我使用 svn+ssh://,在服务器上使用 file:///
我确实将 Trac 日志级别设置为 DEBUG,但我不太确定我应该寻找什么。
我的提交后脚本如下所示。请注意,我知道提交后本身是有效的,因为 QA 更新和 Campfire 发布都有效。我还尝试将 $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