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

[PATCH] V2 Partial Fix for Issue #443: post-commit hook script (error) output lost

From: Madan US <madan_at_collab.net>
Date: 2005-05-20 20:30:58 CEST

Yet to be done :
1. XML escaping for the post-commit hook's stderr
2. Test case for testing XML escaping
3. Test case for commands like mv, cp etc., which do implicit commit

[[[
   Partial Fix for Issue #443: post-commit hook script (error) output lost

   * subversion/libsvn_ra/wrapper_template.h
     (compat_get_commit_editor): Changed to use svn_commit_callback2_t

   * subversion/libsvn_ra/ra_loader.c
     (svn_ra_get_commit_editor2): New version of svn_ra_get_commit_editor
     which takes svn_commit_callback2_t as the callback type

   * subversion/libsvn_ra/ra_loader.h
     (svn_ra__vtable_t): Using svn_commit_callback2_t instead of
     svn_commit_callback2_t for get_commit_editor.

   * subversion/include/svn_repos.h
     (svn_repos_get_commit_editor3): New version of
     svn_repos_get_commit_editor2, which takes svn_commit_callback2_t
     as the callback type
     (svn_repos_get_commit_editor2): Deprecated

   * subversion/include/svn_types.h
     (svn_commit_callback2_t): New version of svn_commit_callback_t
     with a new parameter post_commit_err.
     (svn_commit_callback_t): Deprecated.

   * subversion/include/svn_client.h
     (svn_client_commit_info2_t): New version of
     svn_client_commit_info_t now containing the post_commit_err
     parameter to hold the post-commit hook's stderr
     (svn_client_commit_info_t): Deprecated
     (svn_client_mkdir2): New version of svn_client_mkdir now taking
     svn_client_commit_info2_t as the commit_info type
     (svn_client_mkdir): Deprecated
     (svn_client_delete2): New version of svn_client_delete
     which now takes svn_client_commit_info2_t as commit_info type
     (svn_client_delete): Deprecated
     (svn_client_import2): New version of svn_client_import
     which now takes svn_client_commit_info2_t as type for
     the commit_info parameter.
     (svn_client_import): Deprecated
     (svn_client_commit3): New version of svn_client_commit
     which now takes svn_client_commit_info2_t for commit_info
     (svn_client_commit2): Deprecated
     (svn_client_copy2): New version of svn_client_copy which now takes
     svn_client_commit_info2_t as the commit_info type.
     (svn_client_copy): Deprecated.
     (svn_client_move3): New version of svn_client_move but now
     uses svn_client_commit_info2_t for the commit_info parameter type
     (svn_client_move2): Deprecated

   * subversion/include/svn_ra.h
     (svn_ra_get_commit_editor2): New version of svn_ra_get_commit_editor
     which takes svn_commit_callback2_t as the callback type
     (svn_ra_get_commit_editor): Deprecated
     (svn_ra_plugin_t): Changed to take svn_commit_callback2_t
     as parameter for get_commit_editor.

   * subversion/libsvn_ra_local/ra_plugin.c
     (deltify_etc_baton): Now takes svn_commit_callback2_t for callback
     (deltify_etc): Now takes an extra parameter - post_commit_err
     and passes it on to the callback.
     (svn_ra_local__get_commit_editor): Now takes svn_commit_callback2_t
     for the callback parameter. Also call svn_repos_get_commit_editor3
     instead of svn_repos_get_commit_editor2

   * subversion/libsvn_client/delete.c
     (delete_urls2): New version of delete_urls which uses
     svn_client_commit_info2_t as commit_info type, thus making is
     post-commit hook's stderr aware.
     (svn_client_delete2): New version of svn_client_delete
     now using svn_client_commit_info2_t as commit_info type.

   * subversion/libsvn_client/client.h
     (svn_client__commit_get_baton2): New version of
     svn_client__commit_get_baton, which takes svn_client_commit_info2_t
     as the type for the info parameter.
     (svn_client__commit_get_baton): Deprecated.
     (svn_client__commit_callback2): New version of
     svn_client__commit_callback, now providing for the stderr output
     of the post-commit hook.
     (svn_client__commit_callback): Deprecated

   * subversion/libsvn_client/copy.c
     (repos_to_repos_copy2): New version of repos_to_repos_copy
     svn_client_commit_info2_t for commit_info.
     (repos_to_repos_copy): Deprecated
     (wc_to_repos_copy2): New version of
     wc_to_repos_copy, which takes svn_client_commit_info2_t as
     commit_info type.
     (wc_to_repos_copy): Deprecated
     (setup_copy2): New version of setup_copy, but now takes
     svn_client_commit_info2_t as commit_info type.
     (setup_copy): Deprecated
     (svn_client_copy2): New version of svn_client_copy which now
     takes svn_client_commit_info2_t for the commit_info parameter.
     (svn_client_copy): Deprecated
     (svn_client_move3): New version of svn_client_move2 which now
     takes svn_client_commit_info2_t for the commit_info parameter.
     (svn_client_move2): Deprecated

   * subversion/libsvn_client/commit_util.c
     (commit_baton2): New version of commit_baton using
     svn_client_commit_info2_t for the info type.
     (commit_baton): Deprecated
     (svn_client__commit_get_baton2): New version of
     svn_client__commit_get_baton, which takes svn_client_commit_info2_t
     as the info type
     (svn_client__commit_get_baton): Deprecated
     (svn_client__commit_callback2): New version of
     svn_client__commit_callback, which takes the post_commit_err
     parameter.

   * subversion/libsvn_client/commit.c
     (get_ra_editor2): New version of get_ra_editor, but is aware of
     the post-commit hook's stderr. Takes svn_client_commit_info2_t
     as parameter and calls svn_client__commit_get_baton2 and
     svn_ra_get_commit_editor2.
     (get_ra_editor): Deprecated.
     (svn_client_import2): New version of svn_client_import
     using svn_client_commit_info2_t for the commit_info parameter.
     This new function is post-commit hook's stderr aware.
     (svn_client_commit3): New version of svn_client_commit
     using svn_client_commit_info2_t, and calling other functions
     that passback the post-commit hook's stderr.

   * subversion/libsvn_client/add.c
     (mkdir_urls2): New version of mkdir_urls. Here, the commit_info
     parameter is of type svn_client_commit_info2_t and calls the
     svn_client__commit_get_baton2 and svn_ra_get_commit_editor2, thus
     making this aware of the post-commit hook's stderr.
     (mkdir_urls): Deprecated
     (svn_client_mkdir2): New version of svn_client_mkdir
     using svn_client_commit_info2_t for the commit_info parameter
     (svn_client_mkdir): Deprecated

   * subversion/mod_dav_svn/merge.c
     (svn_xml.h): New header #included.
     (dav_svn__merge_response2): Takes the @a post_commit_err parameter
     and forms necessary xml content, if this parameter is NOT NULL.
     (dav_svn__merge_response): Deprecated, modified to call
     dav_svn__merge_response2, with the @a post_commit_err as NULL.

   * subversion/mod_dav_svn/dav_svn.h
     (dav_svn__merge_response2): New version of dav_svn__merge_response
     that takes the post_commit_err parameter
     (dav_svn__merge_response): Deprecated.

   * subversion/mod_dav_svn/version.c
     (dav_svn_merge): Modified to handle the post-commit hook's stderr,
     if any and call the dav_svn__merge_response2 function to pass it on.

   * subversion/clients/cmdline/cl.h
     (svn_cl__print_commit_info2): New version of svn_cl__print_commit_info
     which takes svn_client_commit_info2_t for the commit_info parameter.
     (svn_cl__print_commit_info): Deprecated.

   * subversion/clients/cmdline/mkdir-cmd.c
     (svn_cl__mkdir): Modified to use post-commit stderr aware
     datatypes and functions.

   * subversion/clients/cmdline/move-cmd.c
     (svn_cl__move): Modified to use post-commit stderr aware
     datatypes and functions.

   * subversion/clients/cmdline/copy-cmd.c
     (svn_cl__copy): Modified to use post-commit stderr aware
     datatypes and functions.

   * subversion/clients/cmdline/util.c
     (svn_cl__print_commit_info2): New version of svn_cl__print_commit_info
     that displays the post-commit hook's stderr, if any.

   * subversion/clients/cmdline/commit-cmd.c
     (svn_cl__commit): Modified to use post-commit stderr aware
     datatypes and functions.

   * subversion/clients/cmdline/delete-cmd.c
     (svn_cl__delete): Modified to use post-commit stderr aware
     datatypes and functions.

   * subversion/clients/cmdline/import-cmd.c
     (svn_cl__import): Modified to use post-commit stderr aware
     datatypes and functions.

   * subversion/tests/clients/cmdline/commit_tests.py
     (post_commit_hook_test): Added new test for post-commit hook's
     stderr testing.
     (test_list): Added post_commit_hook_test to test list.

   * subversion/libsvn_repos/hooks.c
     (svn_repos__hooks_post_commit): Modified to pass TRUE for the
     read_errstream parameter of the run_hook_cmd function.

   * subversion/libsvn_repos/commit.c
     (edit_baton2): New version of the edit_baton data structure
     using svn_commit_callback2_t for callback type.
     (close_edit): Checks if the post-commit hook has returned any stderr
     and if so, pass it on the callback function.
     (svn_repos_get_commit_editor3): New version of
     svn_repos_get_commit_editor2 that takes callback of type
     svn_commit_callback2_t

   * subversion/libsvn_ra_svn/client.c
     (ra_svn_commit_callback_baton_t): Modified to use
     svn_commit_callback2_t for callback type
     (ra_svn_end_commit): Modified to accomodate the post-commit hook's
     stderr if available. If available this is passed on to the callback
     function.
     (ra_svn_commit): Modified to use the svn_commit_callback2_t
     type for the callback parameter.

   * subversion/libsvn_ra_dav/merge.c
     (merge_elements): Added new element to represent the post-commit
     status's stderr.
     (merge_ctx_t): Added new member to hold the post-commit stderr
     if any.
     (validate_element): Modified to understand the post-commit
     stderr (ELEM_post_commit_err ) as a valid tag.
     (end_element): Added case to extract post-commit hook's stderr.
     (svn_ra_dav__merge_activity): Modified to call
     svn_ra_dav__merge_activity2 with post_commit_err as NULL.
     (svn_ra_dav__merge_activity2): Added function to return the
     post-commit hook's stderr if available.

   * subversion/libsvn_ra_dav/ra_dav.h
     (svn_ra_dav__get_commit_editor2): New version of
     svn_ra_dav__get_commit_editor using svn_commit_callback2_t
     as callback type.
     (svn_ra_dav__get_commit_editor): Deprecated.
     (enum): Added enumeration for ELEM_post_commit_err.
     (svn_ra_dav__merge_activity2): New version of
     svn_ra_dav__merge_activity, taking a new post_commit_err parameter.
     (svn_ra_dav__merge_activity): Deprecated.

   * subversion/libsvn_ra_dav/session.c
     (dav_vtable): Modified to use svn_ra_dav__get_commit_editor2.

   * subversion/libsvn_ra_dav/commit.c
     (commit_ctx_t): Now uses svn_commit_callback2_t for callback.
     (commit_close_edit2): New version of commit_close_edit that
     uses svn_ra_dav__merge_activity2 and handles post-commit's
     stderr.
     (commit_close_edit): Deprecated.
     (svn_ra_dav__get_commit_editor2): New version of
     svn_ra_dav__get_commit_editor that uses callback of type
     svn_commit_callback2_t.

   * subversion/svnserve/serve.c
     (commit_callback_baton_t): Added post_commit_err member.
     (commit_done): Added post_commit_err parameter and handling.
     (commit): Extract post-commit's stderr and writes back to the client.
]]]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Fri May 20 20:35:52 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.