Opened 17 years ago
Closed 15 years ago
#6370 closed defect (worksforme)
Contrib post-commit for Win has issues with quotes in project name, failing
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | version control | Version: | devel |
Severity: | minor | Keywords: | trac-post-commit-hook multirepos |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
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.cmd
(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.
Attachments (1)
Change History (7)
by , 17 years ago
Attachment: | fix-postcommit-quotes-in-tracenv-on-windows.patch added |
---|
comment:1 by , 17 years ago
Actually, it would be nice to have a note in there that TRAC_ENV needs to not have the trailing slash. If you say -p c:\trac-sites\Krocsyldiphithic\
then a similar error will occur, and it will append a space to the name, leaving the path as:
c:\\trac-sites\\Krocsyldiphithic \\VERSION
comment:2 by , 17 years ago
Keywords: | trac-post-commit-hook added |
---|---|
Milestone: | → 0.11.1 |
Version: | → devel |
comment:3 by , 16 years ago
Keywords: | multirepos added |
---|---|
Milestone: | 0.11-retriage → 0.12 |
Take this into account when working on source:sandbox/multirepos/contrib/trac-svn-hook.cmd.
comment:4 by , 15 years ago
Milestone: | 0.12 → 0.12-multirepos |
---|
comment:5 by , 15 years ago
Milestone: | 0.12-multirepos → 0.12.1 |
---|
The main hook source:sandbox/multirepos/contrib/trac-svn-hook works on Windows via cygwin, and that's enough for me… especially that I'm not that fluent in BAT programming.
Waiting for contributions.
comment:6 by , 15 years ago
Milestone: | 0.12.1 |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
Actually there is already a minimal script, source:sandbox/multirepos/contrib/trac-svn-post-commit-hook.cmd.
It uses trac-admin
, which should already deal correctly with the quotes.
If not, please reopen.
Patch for post commit contrib files. Not sure about cr/lf issues with the py one