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

Re: svn commit: r28502 - in trunk/subversion: libsvn_repos tests/cmdline

From: David Glasser <glasser_at_davidglasser.net>
Date: 2007-12-15 20:48:56 CET

On Dec 15, 2007 11:28 AM, <epg@tigris.org> wrote:
> Author: epg
> Date: Sat Dec 15 11:28:44 2007
> New Revision: 28502
>
> Log:
> Non-zero exit codes from start- and pre- hooks indicate the action is
> blocked by the administrator, not that the hook *failed*. Make the
> error message more accurate in such cases.
>
> * subversion/libsvn_repos/hooks.c
> (check_hook_result): Continue reporting failure for the pre-/start-
> hooks if they fail to execute, but if they just exited non-zero,
> report the action as blocked.
>
> * subversion/tests/cmdline/commit_tests.py
> (hook_failure_message): Adapt to new hook failure messages.
>
>
> Modified:
> trunk/subversion/libsvn_repos/hooks.c
> trunk/subversion/tests/cmdline/commit_tests.py
>
> Modified: trunk/subversion/libsvn_repos/hooks.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_repos/hooks.c?pathrev=28502&r1=28501&r2=28502
> ==============================================================================
> --- trunk/subversion/libsvn_repos/hooks.c (original)
> +++ trunk/subversion/libsvn_repos/hooks.c Sat Dec 15 11:28:44 2007
> @@ -119,23 +119,38 @@
> }
> else
> {
> - failure_message = svn_stringbuf_createf(pool,
> - _("'%s' hook failed (exited with a non-zero exitcode of %d). "),
> - name, exitcode);
> + const char *action;
> + if (strcmp(name, "start-commit") == 0
> + || strcmp(name, "pre-commit") == 0)
> + action = "commit";
> + else if (strcmp(name, "pre-revprop-change") == 0)
> + action = "revprop change";
> + else if (strcmp(name, "pre-lock") == 0)
> + action = "lock";
> + else if (strcmp(name, "pre-unlock") == 0)
> + action = "unlock";
> + else
> + action = NULL;
> + if (action == NULL)
> + failure_message = svn_stringbuf_createf(
> + pool, _("%s hook failed (exit code %d)"),
> + name, exitcode);
> + else
> + failure_message = svn_stringbuf_createf(
> + pool, _("%s blocked by %s hook (exit code %d)"),
> + action, name, exitcode);

I like the idea of the change, but I'd start the error message (that
is, the "action") with a capital letter.

I also suspect you should _(I18Nalize) the action names. And maybe
keep the hook names quoted?

--dave

-- 
David Glasser | glasser_at_davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Dec 15 20:52:07 2007

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.