Hooks on Windows generally seem to work fine. And as far as I can tell,
normal program hooks (.exe's) work fine all the time. However, when
using .cmd or .bat scripts, the stderr output is not captured correctly.
Instead you get something like:
D:\Temp\test\uh2>svn commit -m "test"
Sending UnmanagedHost.sln
Transmitting file data .svn: A repository hook failed.
svn: Commit failed (details follow):
svn: 'pre-commit' hook failed with error output:
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
If you were using a pre-commit hook script that does nothing except
'exit 1'.
If the script calls programs that write to stderr, their output appears
in the middle and looks fine, like:
D:\Temp\test\uh2>svn commit -m "test"
Sending UnmanagedHost.sln
Transmitting file data .svn: A repository hook failed.
svn: Commit failed (details follow):
svn: 'pre-commit' hook failed with error output:
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
Blah blah bad commit.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
The handle is invalid.
I am not a commandline expert, but as I was investigating this I could
not figure out how to get a script to write to stderr (echo can't seem
to do it) and I was wondering if maybe scripts don't have stderr on
Windows (thus all the invalid handle lines which exactly correspond to
the FormatMessage text of an ERROR_INVALID_HANDLE (6)).
Can someone enlighten me as to how stderr works with scripts on Windows,
or perhaps confirm that there is no such thing and recommend a strategy
to deal with it?
DJ
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Aug 11 21:32:17 2003