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

Re: [PATCH] Issue 443 : post-commit hook (error) output lost: Step 6

From: Madan U Sreenivasan <madan_at_collab.net>
Date: 2005-10-20 01:31:04 CEST

On Thu, 2005-10-20 at 02:30, Garrett Rooney wrote:
> On 10/19/05, Madan U Sreenivasan <madan@collab.net> wrote:
> > Hi,
> > Pl. find attached the final step for issue no. 443(oh, well, actually,
> > the pre-revprop part has not been fixed yet).
>
> I haven't actually tried the patch yet, but here are a few comments
> that occurred to me as I was reading over it.
>
>
> + /* get the post-commit hook stderr, if any */
>
> + if (post_commit_err)
>
> + {
>
> + post_commit_header_info = apr_psprintf (pool,
>
> + " xmlns:S=\"%s\"",
>
> + SVN_XML_NAMESPACE);
>
> + post_commit_err_elem = apr_psprintf (pool,
>
> + "<S:post-commit-err>%s"
>
> + "</S:post-commit-err>",
>
> + post_commit_err);
>
> + }
>
> + else
>
> + {
>
> + post_commit_header_info = "" ;
>
> + post_commit_err_elem = "" ;
>
> Kind of weird having a space before the semicolons there, don't think
> I've seen that in any other svn code.
heh, my own typing practise ;) will correct this.
>
>
>
>
> Index: subversion/tests/clients/cmdline/commit_tests.py
>
> ===================================================================
>
> --- subversion/tests/clients/cmdline/commit_tests.py (revision 16776)
>
> +++ subversion/tests/clients/cmdline/commit_tests.py (working copy)
>
> @@ -1955,6 +1955,47 @@
>
> os.path.join(wc_dir, 'A', 'yu'))
>
>
>
>
>
> +#----------------------------------------------------------------------
>
> +# Test if the post-commit error message is returned back to the svn
>
> +# client and is displayed as a warning.
>
> +#
>
> +def post_commit_hook_test(sbox):
>
> + "post commit hook failure case testing"
>
> +
>
> + sbox.build()
>
> +
>
> + # Get paths to the working copy and repository
>
> + wc_dir = sbox.wc_dir
>
> + repo_dir = sbox.repo_dir
>
> +
>
> + # Setup the hook configs to echo data back
>
> + post_commit_hook = svntest.main.get_post_commit_hook_path (repo_dir)
>
> + svntest.main.file_append (post_commit_hook,
>
> + """#!/bin/sh
>
> + echo "Post-commit Hook says nothing doing
> on stderr" > /dev/stderr
>
> + exit -1
>
> + """)
>
> + os.chmod (post_commit_hook, 0755)
>
>
> This test won't work on windows... I'm not sure how other tests that
> include hook scripts work, but looking at what they do seems like a
> reasonable place to start.
IIRC the I did base this test on one other existing test ( I dont
remember off-hand, it has been a long time since I wrote this test).Let
me check and get back. Thanks for pointing out.
> Also, the echo line is wrapping past 80
> columns, that should probably be fixed.
yes, thanks.
> @@ -899,7 +902,10 @@
>
> apr_array_header_t *params, void *baton)
>
> {
>
> server_baton_t *b = baton;
>
> - const char *log_msg, *date, *author;
>
> + const char *log_msg = NULL,
>
> + *date = NULL,
>
> + *author = NULL,
>
> + *post_commit_err = NULL;
>
> Any reason these are now being initialized to NULL?
Good practice, is it not?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Oct 20 01:23:00 2005

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.