2

我已经在 Windows 上设置了我的 subversion/trac 环境(现在是 Win7,以前在 Vista 上尝试过)并且一切正常。但我无法让我的后提交工作。这是设置(使用在 Apache 上运行的 VisualSVN 和 Trac):

C:\Users\Martin\Repositories\test_svn\hooks:

post-commit.bat:

call %~dp0\trac-post-commit-hook.cmd %1 %2

trac-post-commit-hook.cmd:

@ECHO OFF
::
:: Trac post-commit-hook script for Windows
::
:: Contributed by markus, modified by cboos.

:: Usage:
::
:: 1) Insert the following line in your post-commit.bat script
::
:: call %~dp0\trac-post-commit-hook.cmd %1 %2
::
:: 2) Check the 'Modify paths' section below, be sure to set at least TRAC_ENV


:: ----------------------------------------------------------
:: Modify paths here:

:: -- this one *must* be set
SET TRAC_ENV=C:\Users\Martin\Trac\test_svn

:: -- set if Python is not in the system path
SET PYTHON_PATH=

:: -- set to the folder containing trac/ if installed in a non-standard location
SET TRAC_PATH=
:: ----------------------------------------------------------

:: Do not execute hook if trac environment does not exist
IF NOT EXIST %TRAC_ENV% GOTO :EOF

set PATH=%PYTHON_PATH%;%PATH%
set PYTHONPATH=%TRAC_PATH%;%PYTHONPATH%

SET REV=%2

Python "%~dp0\trac-post-commit-hook" -p "%TRAC_ENV%" -r "%REV%" 

跟踪提交后挂钩:

取自http://trac.edgewall.org/browser/branches/0.11-stable/contrib/trac-post-commit-hook

我已经在 cmd 窗口中测试了这些脚本,它们一直在工作。但是在 TortoiseSVN 提交时,什么都没有发生,这让我相信 Tortoise 永远不会运行 post-commit.bat。

我还测试了一个简单的预提交,并且有效。奇怪的是,它以前曾工作过,但我想我当时使用的是 VisualSVN 的早期版本。

有人知道这里发生了什么吗?

非常感谢!/马丁

4

1 回答 1

2

提交后挂钩在服务器端运行。如果钩子被正确实现,它应该适用于任何 Subversion 客户端。你会想看看SVN 书中的这一章

跟进:您可以查看博客条目。

于 2009-11-12T00:09:20.267 回答