[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: customizing the error message

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-04-26 23:20:38 CEST

On Apr 26, 2007, at 14:18, Greg Cerveny wrote:

> I would like to customize the error message display when a hook script
> rejects an action from a user.
> I've created a couple subversion hook scripts (windows batch files).
> One allows users to modify logs and the other prevents a user from
> committing changes.
> Here is what happens when I commit with no log:
> C:\dev>svn commit -m ""
> Sending locks.txt
> Transmitting file data .svn: Commit failed (details follow):
> svn: 'pre-commit' hook failed with error output:
> Here is my batch file:
> @echo OFF
> REM verifies that the commit has a log message
> set REPOS="%1"
> set TXN="%2"
> set ENTRY=""
> for /F "tokens=1*" %%a in ('svnlook log -t %TXN% %REPOS%') do set
> ENTRY="%%a %%b"
> if %ENTRY% == "" (exit 1) else (exit 0)
> Any ideas on customizing the returned error?

I think it works on Windows the same way it works on Unix:

echo "Here's my error message" 1>&2

Do that before you exit 1.


To reply to the mailing list, please use your mailer's Reply To All

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Apr 26 23:21:40 2007

This is an archived mail posted to the Subversion Users mailing list.