Contrib post-commit for Win has issues with quotes in project name, failing
|Reported by:||Owned by:||Christian Boos|
The .cmd file used by the post-commit process for windows quotes both the revision number and trac environment. The revision # does not need to be quoted, but it is the quoting of the trac environment that causes a problem.
To see this you need to move the
-r option before the
-p. In the original order (
script -p .. -r ...) the script complains about # of arguments. If you put the -r before the -P, you can see the issue described below:
The python script that is called from
trac-post-commit-hook) receives the argument complete with quotes, which it then tries to interpret as part of the project path. This leads to a command like:
trac-post-commit-hook -P "c:\trac-sites\funky" -r "107"
generating an error about not being able to find/read/etc the file
"IOError: [Errno 2] No such file or directory: 'e:\\trac-sites\\funky" \\VERSION'
I don't know where the first quote went, though. The fix to this, allowing for quotes in the trac site name, is to remove the quotes from the project name inside the post commit python script. Alternatly, if that is not possible, one could remove them from the ".cmd" file and require that the trac env path have no spaces.
I have also included a few comments in the post-commit hook, primarly to clarify for us new to this. The construct
%~dp0 is unfamiliar to most, even those familar with dos batch files, but it is very useful.
Change History (7)
comment:2 by , 12 years ago