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

Re: [PATCH] Partial fix for Issue #443: post-commit hook script (error) output lost.

From: Madan U Sreenivasan <madan_at_collab.net>
Date: 2005-06-30 13:36:06 CEST

/me requests a review....

On Tue, 2005-06-28 at 17:31, Madan U Sreenivasan wrote:
> - Have extracted only the ra_dav part of the patch (for ease of
> review ) and fixed the factorizations.
> - Also attached are design files that help understand the patch.
> - I have tested this with a test case on all three protocols ( the
> test currently passes only over ra_dav )
>
> [[[
> Partial fix for Issue #443: post-commit hook script (error) output
> lost.
> Includes post-commit hook stderr propagation for ra_dav
> Does not include post-commit hook stderr propagation for ra_local
> and ra_svn.
> Does not include the pre-revprop-change fix.
>
> * subversion/libsvn_ra/ra_loader.c
> (svn_ra_find_protocol): New API to find out which
> schema/protocol
> would be used, given a URL.
> (svn_ra_get_commit_editor2): New version of the API to use
> the new commit_editor function and hence use the new callback.
> * subversion/libsvn_ra/ra_loader.h
> (svn_ra__vtable_t): Added comments for get_commit_editor and
> intoduced a new member get_commit_editor2 which now uses the
> svn_commit_callback2_t.
> * subversion/include/svn_repos.h
> (svn_repos_get_commit_editor3): New API to accomodate the
> svn_commit_callback2_t callback type.
> * subversion/include/svn_types.h
> (svn_commit_callback2_t): Ah, the core change. A callback that
> takes the post_commit_err parameter.
> * subversion/include/svn_client.h
> (svn_client_commit_info2_t): The structure that carries the
> commit success parameters now has to carry the post_commit_err
> too.
> (svn_client_mkdir): mkdir should now use the new structure -
> svn_client_commit_info2_t.
> (svn_client_delete): delete should now use the new structure -
> svn_client_commit_info2_t.
> (svn_client_commit3): New API that uses
> svn_client_commit_info2_t.
> (svn_client_copy2): New API that uses svn_client_commit_info2_t.
> * subversion/include/svn_ra.h
> (svn_ra_find_protocol): New API declaration added.
> (svn_ra_get_commit_editor2): New API that uses the new callback.
> * subversion/libsvn_ra_local/ra_plugin.c
> (ra_local_vtable): ra_local's vtable does NOT have callback2.
> * subversion/libsvn_client/delete.c
> (delete_urls): delete_urls now uses the
> svn_client_commit_info2_t structure.
> Call svn_ra_get_commit_editor2() if ra_dav.
> Call svn_ra_get_commit_editor() otherwise.
> (svn_client_delete): svn_client_delete should now use
> svn_client_commit_info2_t.
> * subversion/libsvn_client/client.h
> (svn_client__commit_get_baton): Should now use the new commit
> info structrure - svn_client_commit_info2_t.
> (svn_client__commit_callback2): New callback that now takes
> post_commit_err as one of its parameters.
> * subversion/libsvn_client/copy.c
> (repos_to_repos_copy): Now uses the svn_client_commit_info2_t
> structure.
> Call svn_ra_get_commit_editor2() if ra_dav.
> Call svn_ra_get_commit_editor() otherwise.
> (wc_to_repos_copy): Now uses the svn_client_commit_info2_t
> structure.
> Call svn_ra_get_commit_editor2() if ra_dav.
> Call svn_ra_get_commit_editor() otherwise.
> (setup_copy): Now uses svn_client_commit_info2_t.
> (svn_client_copy2): New version of API that takes a
> svn_client_commit_info2_t for commit_info.
> (svn_client_move3): New version of API that takes a
> svn_client_commit_info2_t for commit_info.
> * subversion/libsvn_client/commit_util.c
> (commit_baton): Now uses svn_client_commit_info2_t.
> (svn_client__commit_get_baton): Now uses
> svn_client_commit_info2_t.
> (svn_client__commit_callback2): This callback function
> fills the svn_client_commit_info2_t structure with the
> post_commit_err, if any.
> * subversion/libsvn_client/add.c
> (mkdir_urls): Now uses svn_client_commit_info2_t.
> Calls svn_ra_get_commit_editor2() if ra_dav.
> Calls svn_ra_get_commit_editor() otherwise.
> (svn_client_mkdir): Now uses svn_client_commit_info2_t.
> * subversion/libsvn_client/commit.c
> (get_ra_editor): Now uses svn_client_commit_info2_t.
> Calls svn_ra_get_commit_editor2() if ra_dav.
> Calls svn_ra_get_commit_editor() otherwise.
> (svn_client_import2): get_ra_editor now passed typecasted
> commit_info.
> (svn_client_commit3): New version of API that uses
> svn_client_commit_info2_t.
> (svn_client_commit2): A svn_client_commit_info2_t is allocated
> and passed back as svn_client_commit_info_t. This doesn't matter
> as svn_client_commit_info2_t is one member more than
> svn_client_commit_info_t.
> * subversion/mod_dav_svn/merge.c
> (#include): Included svn_xml.h
> (dav_svn__merge_response): Now takes an extra post_commit_err
> parameter. If the post_commit_err is available,
> - Adds the SVN namespace
> - post-commit-err element to hold the post_commit_err
> to the merge response.
> * subversion/mod_dav_svn/dav_svn.h
> (dav_svn__merge_response): Now takes a new post_commit_err
> parameter.
> * subversion/mod_dav_svn/version.c
> (dav_svn_merge): If post-commit hook returns an error,
> pass it along to dav_svn__merge_response.
> * subversion/clients/cmdline/cl.h
> (svn_cl__print_commit_info2): Declaration for the new function
> that ultimately prints out the post-commit hook's stderr to
> the user.
> * subversion/clients/cmdline/mkdir-cmd.c
> (svn_cl__mkdir): Now uses svn_client_commit_info2_t and
> svn_cl__print_commit_info2.
> * subversion/clients/cmdline/move-cmd.c
> (svn_cl__move): Now uses svn_client_commit_info2_t and
> svn_cl__print_commit_info2.
> * subversion/clients/cmdline/copy-cmd.c
> (svn_cl__copy): Now uses svn_client_commit_info2_t and
> svn_cl__print_commit_info2.
> * subversion/clients/cmdline/util.c
> (svn_cl__print_commit_info2): Home at last!!! New version of
> API.
> svn_cl__print_commit_info2 is the function that ultimately
> prints out the post_commit_error to the user.
> * subversion/clients/cmdline/commit-cmd.c
> (svn_cl__commit): Now uses svn_client_commit_info2_t and
> svn_cl__print_commit_info2 for callback.
> * subversion/clients/cmdline/delete-cmd.c
> (svn_cl__delete): Now uses svn_client_commit_info2_t and
> svn_cl__print_commit_info2 for callback.
> * subversion/tests/clients/cmdline/commit_tests.py
> (post_commit_hook_test): New function to test the post-commit
> hook's propogation of stderr to the client.
> (test_list): Added post_commit_hook_test to list of tests.
> * subversion/libsvn_repos/hooks.c
> (svn_repos__hooks_post_commit): Now runs the post-commit hook
> with the read_errstream parameter as TRUE.
> * subversion/libsvn_repos/commit.c
> (edit_baton): Added new member - callback2, to hold a callback
> of type svn_commit_callback2_t. Also added comments that
> callback
> should be removed once all code uses callback2.
> (close_edit): Handles the post-commit stderr. Decides whether
> to use the callback or the callback2 member of the edit baton.
> (svn_repos_get_commit_editor3): Uses svn_commit_callback2_t for
> callback type, and fills callback2 of the edit baton.
> (svn_repos_get_commit_editor2): Still uses svn_commit_callback_t
> and fills the callback member of the edit baton.
> * subversion/libsvn_ra_svn/client.c
> (ra_svn_vtable): ra_svn's vtable doesnt have a
> get_commit_editor2 member.
> * subversion/libsvn_ra_dav/merge.c
> (merge_elements): Added the post-commit-err element.
> (merge_ctx_t): Added the post_commit_err member.
> (validate_element): Make ELEM_post_commit_err a valid element.
> (end_element): Add case, and handle ELEM_post_commit_err.
> (svn_ra_dav__merge_activity2): New merge function to handle
> post-commit hook's stderr.
> * subversion/libsvn_ra_dav/ra_dav.h
> (svn_ra_dav__get_commit_editor2): New version of API, using
> svn_commit_callback2_t.
> (enum): Added ELEM_post_commit_err member.
> (svn_ra_dav__merge_activity2): Declaration for new version of
> API.
> * subversion/libsvn_ra_dav/session.c
> (dav_vtable): Now contains a get_commit_editor2 function, but no
> get_commit_editor function.
> * subversion/libsvn_ra_dav/commit.c
> (commit_ctx_t): Added the callback2 member.
> (commit_close_edit): Now uses te svn_ra_dav__merge_activity2
> function.
> (svn_ra_dav__get_commit_editor2): Now fills the callback2 member
> (svn_ra_dav__get_commit_editor): Still fills the callback member
> ]]]
>
> ______________________________________________________________________
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jun 30 14:16:24 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.