Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 296F599D0 for ; Fri, 6 Apr 2012 19:03:55 +0000 (UTC) Received: (qmail 78498 invoked by uid 500); 6 Apr 2012 19:03:55 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 78481 invoked by uid 500); 6 Apr 2012 19:03:55 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 78472 invoked by uid 99); 6 Apr 2012 19:03:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Apr 2012 19:03:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Apr 2012 19:03:51 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3662623888EA; Fri, 6 Apr 2012 19:03:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1310552 - in /subversion/branches/ev2-export/subversion: libsvn_client/copy.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h Date: Fri, 06 Apr 2012 19:03:30 -0000 To: commits@subversion.apache.org From: hwright@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120406190330.3662623888EA@eris.apache.org> Author: hwright Date: Fri Apr 6 19:03:29 2012 New Revision: 1310552 URL: http://svn.apache.org/viewvc?rev=1310552&view=rev Log: On the ev2-export branch: Fetch an Ev2 editor from the RA layer for repos->repos copies, rather than building one locally from an Ev1 editor. To enable this, we also need to store and use the Ev2 shim callbacks in libsvn_ra, so we do. * subversion/libsvn_ra/ra_loader.c (svn_ra_get_commit_editor4): Use the stored callbacks when constructing the Ev2 editor. (svn_ra__register_editor_shim_callbacks): Save the callbacks locally, in addition to providing them to the lower layers. * subversion/libsvn_ra/ra_loader.h (svn_ra_session_t): Add a member to stash the shim callbacks. * subversion/libsvn_client/copy.c (fetch_remote_kind_func, fetch_remote_props_func): Remove. (drive_editor): Take and use an Ev2 editor, rather than constructing it locally. (repos_to_repos_copy): Fetch an Ev2 editor, and use it. Modified: subversion/branches/ev2-export/subversion/libsvn_client/copy.c subversion/branches/ev2-export/subversion/libsvn_ra/ra_loader.c subversion/branches/ev2-export/subversion/libsvn_ra/ra_loader.h Modified: subversion/branches/ev2-export/subversion/libsvn_client/copy.c URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/copy.c?rev=1310552&r1=1310551&r2=1310552&view=diff ============================================================================== --- subversion/branches/ev2-export/subversion/libsvn_client/copy.c (original) +++ subversion/branches/ev2-export/subversion/libsvn_client/copy.c Fri Apr 6 19:03:29 2012 @@ -617,30 +617,6 @@ find_absent_parents2(svn_ra_session_t *r return SVN_NO_ERROR; } -/* This should probably be smarter... */ -static svn_error_t * -fetch_remote_kind_func(svn_kind_t *kind, - void *baton, - const char *path, - svn_revnum_t base_revision, - apr_pool_t *scratch_pool) -{ - *kind = svn_kind_unknown; - return SVN_NO_ERROR; -} - -/* This should probably be smarter... */ -static svn_error_t * -fetch_remote_props_func(apr_hash_t **props, - void *baton, - const char *path, - svn_revnum_t base_revision, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool) -{ - *props = apr_hash_make(result_pool); - return SVN_NO_ERROR; -} static svn_error_t * drive_single_path(svn_editor_t *editor, @@ -723,36 +699,17 @@ drive_single_path(svn_editor_t *editor, } static svn_error_t * -drive_editor(const svn_delta_editor_t *deditor, - void *dedit_baton, +drive_editor(svn_editor_t *editor, apr_array_header_t *paths, apr_hash_t *action_hash, svn_boolean_t is_move, svn_revnum_t youngest, - svn_cancel_func_t cancel_func, - void *cancel_baton, apr_pool_t *scratch_pool) { - svn_editor_t *editor; - struct svn_delta__extra_baton *exb; - svn_delta_unlock_func_t unlock_func; - void *unlock_baton; - svn_boolean_t send_abs_paths; svn_error_t *err = SVN_NO_ERROR; apr_pool_t *iterpool; int i; - /* Create the Ev2 editor from the Ev1 editor provided by the RA layer. */ - SVN_ERR(svn_delta__editor_from_delta(&editor, &exb, - &unlock_func, &unlock_baton, - deditor, dedit_baton, &send_abs_paths, - cancel_func, cancel_baton, - fetch_remote_kind_func, NULL, - fetch_remote_props_func, NULL, - scratch_pool, scratch_pool)); - if (exb->start_edit) - SVN_ERR(exb->start_edit(exb->baton, youngest)); - iterpool = svn_pool_create(scratch_pool); for (i = 0; i < paths->nelts; i++) { @@ -798,8 +755,7 @@ repos_to_repos_copy(const apr_array_head const char *message, *repos_root; svn_revnum_t youngest = SVN_INVALID_REVNUM; svn_ra_session_t *ra_session = NULL; - const svn_delta_editor_t *editor; - void *edit_baton; + svn_editor_t *editor; apr_array_header_t *new_dirs = NULL; apr_hash_t *commit_revprops; int i; @@ -1150,16 +1106,16 @@ repos_to_repos_copy(const apr_array_head SVN_ERR(svn_ra__register_editor_shim_callbacks(ra_session, svn_client__get_shim_callbacks(ctx->wc_ctx, NULL, pool))); - SVN_ERR(svn_ra_get_commit_editor3(ra_session, &editor, &edit_baton, + SVN_ERR(svn_ra_get_commit_editor4(ra_session, &editor, commit_revprops, commit_callback, commit_baton, NULL, TRUE, /* No lock tokens */ - pool)); + ctx->cancel_func, ctx->cancel_baton, + pool, pool)); - return svn_error_trace(drive_editor(editor, edit_baton, paths, action_hash, - is_move, youngest, ctx->cancel_func, - ctx->cancel_baton, pool)); + return svn_error_trace(drive_editor(editor, paths, action_hash, + is_move, youngest, pool)); } /* Baton for check_url_kind */ Modified: subversion/branches/ev2-export/subversion/libsvn_ra/ra_loader.c URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_ra/ra_loader.c?rev=1310552&r1=1310551&r2=1310552&view=diff ============================================================================== --- subversion/branches/ev2-export/subversion/libsvn_ra/ra_loader.c (original) +++ subversion/branches/ev2-export/subversion/libsvn_ra/ra_loader.c Fri Apr 6 19:03:29 2012 @@ -771,11 +771,14 @@ svn_ra_get_commit_editor4(svn_ra_session /* Create the Ev2 editor from the Ev1 editor provided by the RA layer. */ SVN_ERR(svn_delta__editor_from_delta(editor, &exb, - &unlock_func, &unlock_baton, - deditor, dedit_baton, &send_abs_paths, - cancel_func, cancel_baton, - NULL, NULL, NULL, NULL, - scratch_pool, result_pool)); + &unlock_func, &unlock_baton, + deditor, dedit_baton, &send_abs_paths, + cancel_func, cancel_baton, + session->shim_callbacks->fetch_kind_func, + session->shim_callbacks->fetch_baton, + session->shim_callbacks->fetch_props_func, + session->shim_callbacks->fetch_baton, + scratch_pool, result_pool)); /* Since we're (currently) just wrapping an existing Ev1 editor, we have to call any start_edit handler it may provide. We've got a couple of @@ -1365,8 +1368,11 @@ svn_error_t * svn_ra__register_editor_shim_callbacks(svn_ra_session_t *session, svn_delta_shim_callbacks_t *callbacks) { - SVN_ERR(session->vtable->register_editor_shim_callbacks(session, callbacks)); - return SVN_NO_ERROR; + /* We save these locally, as well as provide them to the RA layers. */ + session->shim_callbacks = callbacks; + + return svn_error_trace(session->vtable->register_editor_shim_callbacks( + session, callbacks)); } Modified: subversion/branches/ev2-export/subversion/libsvn_ra/ra_loader.h URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_ra/ra_loader.h?rev=1310552&r1=1310551&r2=1310552&view=diff ============================================================================== --- subversion/branches/ev2-export/subversion/libsvn_ra/ra_loader.h (original) +++ subversion/branches/ev2-export/subversion/libsvn_ra/ra_loader.h Fri Apr 6 19:03:29 2012 @@ -307,6 +307,9 @@ struct svn_ra_session_t { /* Private data for the RA implementation. */ void *priv; + + /* A set of shim callbacks for use by libsvn_ra. */ + svn_delta_shim_callbacks_t *shim_callbacks; }; /* Each libsvn_ra_foo defines a function named svn_ra_foo__init of this type.