J'ai donc quelques problèmes avec les réglages. Laisse-moi expliquer.Crochet Post Commit avec Trac et SVN
J'ai trois fichiers dans mon d: \ svn \ crochets fichier (D: \ est pas le lecteur windows)
post-commit.bat
TRAC-post-commit-hook.cmd
TRAC- fichier post-commit-hook
je installer le post-commit.bat dans d: \ svn \ file crochets avec le suivant
%~dp0\trac-post-commit-hook.cmd %1 %2
Dans mon TRAC-post-commit-hook.cmd - Je
@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%"
Dans mon dossier commit-trac post-crochet - est juste le script standard de http://trac.edgewall.org/browser/trunk/contrib/trac-post-commit-hook?rev=920
== Problèmes ==
Lorsque j'exécute post-commit.bat dans l'invite cmd - cela fonctionne très bien - aucune erreur n'est générée.
Cependant, lorsque je commets quelque chose dans le SVN pour un ticket de test que j'ai créé dans Trac - # 1 fixe. - Rien ne change sur Trac. Rien ne se met à jour du tout.
Lorsque je change le 'trac-post-commit-hook' en 'trac-post-commit-hook.py' et que je lance depuis d: \ svn \ hooks \ python trac-post-commit-hook.py I obtenir
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()
Je ne sais pas ce qui se passe réellement? Quelqu'un peut-il fournir de l'aide?
hey merci pour la réponse - je l'ai fait mais rien ne figure dans le fichier .log. Des idées pour lesquelles j'obtiendrais l'erreur dans PYTHON_EGG_CACHE etc? –
Juste mis à jour la réponse; s'il vous plaît voir ça. Essayez également la sortie de journalisation du fichier de validation. – ars
cela aurait-il quelque chose à voir avec le #!/Usr/bin/env python - puisque mon installation python et trac (par bloc de code ci-dessus) se trouve dans des répertoires non standard? –