Also habe ich ein paar Probleme mit den Einstellungen dieser. Lassen Sie mich erklären.Post Commit Hook mit Trac und SVN
Ich habe drei Dateien in meinem d: \ SVN \ Haken Datei (D: \ ist nicht Windows-Laufwerk)
post-commit.bat
trac-post-commit-hook.cmd
Trak- post-Commit-hook
I Setup haben die post-commit.bat Datei in d: \ Svn \ Haken mit der folgenden
Datei%~dp0\trac-post-commit-hook.cmd %1 %2
In meinem trac-post-commit-hook.cmd - Ich habe
@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%"
In meiner trac-post-commit-Hook-Datei - die nur der Standard-Skript von http://trac.edgewall.org/browser/trunk/contrib/trac-post-commit-hook?rev=920
== Probleme ==
Wenn ich post-commit.bat in cmd-Eingabeaufforderung ausführen - es funktioniert gut - keine Fehler generiert.
Wenn ich jedoch etwas in der SVN für ein Testticket beginne, habe ich in Trac - # 1 behoben. - Auf Trac ändert sich nichts. Nichts aktualisiert sich überhaupt.
Wenn ich den 'trac-post-commit-hook' in 'trac-post-commit-hook.py' umwandle und von d: \ svn \ hooks \ python trac-post-commit-hook.py I aus führe get
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()
Ich bin ratlos, was eigentlich falsch läuft? Kann mir jemand helfen?
hey danke für die Antwort - ich tat dies, aber nichts erscheint in der .log-Datei. Irgendwelche Ideen, warum ich den Fehler in PYTHON_EGG_CACHE usw. bekommen würde? –
Nur die Antwort aktualisiert; bitte sieh das. Versuchen Sie auch, die Ausgabe aus der Festschreibungsdatei zu protokollieren. – ars
hätte es etwas mit dem #!/Usr/bin/env python zu tun - da meine Python- und trac-Installation (per Codeblock oben) in nicht-standardmäßigen Verzeichnissen erfolgt? –