Windows and SVN hooks

Aug 16, 2007 10:23

If you ever need to allow edits to commit logs, all you need to do is create a pre-revprop-change hook.
Here's a simple windows hook. )

svn, work

Leave a comment

Seems to be working anonymous July 2 2008, 12:57:15 UTC
Hello,
it seems to be working, but I have an Issue.
When I try to change an existing log to an empty string via TortoiseSVN or via svn command line client than I get this error:

DAV request failed; it's possible that the repository's pre-revprop-change hook
either failed or is non-existent
At least one property change failed; repository is unchanged
Error setting property 'log':
Could not execute PROPPATCH.

But I should get instead an "Empty svn:log messages are not allowed" error message.

I did additional test and I've discovered, that the pre-revprop-change.bat is called twice.
At the first time it is called for the new empty log message, the result is 1 because empty is not allowed (exit 1)
At the second time it is called for the previous non-empty log message, the result is 0 becaus non-empty is allowed (exit 0)

It seems that SVN gets an error (empty is no alowed) and that it tries to set back the previous svn:log value. In that case there are errors, but nothing is in the stderror, so no custom error message is displayed.

Does anyone get the same error?

Reply

Re: Seems to be working anonymous July 2 2008, 13:07:41 UTC
An addition:

I've tried to set an empty log on a revision that is already empty.
In this case the hook is called twice too, but in both the return value is 1 and the user can see "Empty svn:log messages are not allowed" error message.

Regards Tomas Bihary

Reply

Re: Seems to be working anonymous July 3 2008, 18:42:26 UTC
I guess the ">&2" parts should be replaced by "1>&2" on some win32 platforms (namely w2k3 server).

Reply

Re: Seems to be working anonymous July 3 2008, 18:44:27 UTC
For example:

:ERROR_EMPTY
echo "Empty revision properties are not allowed." 1>&2
goto ERROR_EXIT

Reply

Re: Seems to be working anonymous June 25 2010, 14:12:43 UTC
Thank you, The script works great, but I still can't get the correct error messages to display when I use tortoiseSVN on a remote client. I get the DAV error for an empty log message. I added the echo double quotes and 1>&2, the server is a w2k3. Any other suggestions, Thanks for the help.

Reply


Leave a comment

Up