【发布时间】:2010-11-09 22:12:39
【问题描述】:
所以我在设置时遇到了一些问题。让我解释一下。
我的 d:\svn\hooks 文件中有三个文件(D:\ 不是 Windows 驱动器)
提交后.bat
trac-post-commit-hook.cmd
trac-post-commit-hook
我在 d:\svn\hooks 文件中设置了 post-commit.bat 文件,内容如下
%~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=D:\trac\project
:: -- set if Python is not in the system path
SET PYTHON_PATH=D:\trac\Python25
:: -- set to the folder containing trac/ if installed in a non-standard location
SET TRAC_PATH=D:\trac\Python25\Lib\site-packages\trac
:: ----------------------------------------------------------
:: 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/trunk/contrib/trac-post-commit-hook?rev=920 的标准脚本
== 问题==
当我在 cmd 提示符下运行 post-commit.bat - 它工作正常 - 不会产生错误。
但是,当我在 SVN 中为我在 Trac 中创建的测试票提交某些内容时 - #1 已修复。 - Trac 上没有任何变化。没有任何更新。
当我将 'trac-post-commit-hook' 更改为 'trac-post-commit-hook.py' 并从 d:\svn\hooks\python trac-post-commit-hook.py 运行时,我得到
File "trac-post-commit-hook.py", line 104, in <module>
os.environ{'PYTHON_EGG_CACHE'] = os.path.join(options.project, '.egg-cache')
File "D:\trac\Python25\lib\ntpath.py", line 90, in join
assert len(path) > 0
TypeError: object of type 'NoneType' has no len()
我不知道到底出了什么问题?任何人都可以提供任何帮助吗?
【问题讨论】:
标签: svn trac post-commit