TortoiseSVN 从不运行 post-commit.bat

发布于 2024-08-09 09:04:06 字数 1790 浏览 3 评论 0原文

我已经在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜警司 2024-08-16 09:04:06

提交后挂钩在服务器端运行。如果钩子实现正确,它应该适用于任何 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文