TortoiseSVN 从不运行 post-commit.bat
我已经在 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%"
trac-post-commit-hook:
从 http://trac.edgewall.org/browser/branches/0.11-stable/contrib/trac-post-commit-hook
我已经测试了脚本一个cmd窗口,它们就可以一直工作。但是在 TortoiseSVN 提交上,没有任何反应,这让我相信 Tortoise 永远不会运行 post-commit.bat。
我还测试了一个简单的预提交,并且有效。 奇怪的是,它以前工作过,但我想我当时使用的是 VisualSVN 的早期版本。
有人知道这里发生了什么事吗?
多谢! /马丁
I have set up my subversion/trac environment on Windows (Now Win7, previously tried on Vista) and all works perfectly. But I can't get my post-commit to work.
Here's the setup (using VisualSVN and Trac running on Apache):
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%"
trac-post-commit-hook:
Grabbed from http://trac.edgewall.org/browser/branches/0.11-stable/contrib/trac-post-commit-hook
I have tested the scripts in a cmd window and they work all the way. But on a TortoiseSVN commit, nothing happens, which makes me believe that Tortoise never runs the post-commit.bat.
I have also tested a simple pre-commit, and that works.
The strange thing is that is HAS worked before, but I think I used an earlier release of VisualSVN then.
Does anyone have any idea on what's going on here?
Thanks a lot!
/Martin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
提交后挂钩在服务器端运行。如果钩子实现正确,它应该适用于任何 Subversion 客户端。您需要查看 本章来自 SVN 书籍。
后续:您可以看看这个 博客条目。
The post-commit hook is run server side. If the hook is implemented correctly, it should work for any Subversion client. You'll want to take a look at this chapter from the SVN book.
Follow-up: You might take a look at this blog entry.