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 BCD067FFC for ; Thu, 15 Sep 2011 01:59:32 +0000 (UTC) Received: (qmail 46392 invoked by uid 500); 15 Sep 2011 01:59:32 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 46365 invoked by uid 500); 15 Sep 2011 01:59:32 -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 46358 invoked by uid 99); 15 Sep 2011 01:59:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Sep 2011 01:59:32 +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; Thu, 15 Sep 2011 01:59:31 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 68501238890A for ; Thu, 15 Sep 2011 01:59:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1170924 - /subversion/trunk/subversion/libsvn_delta/compat.c Date: Thu, 15 Sep 2011 01:59:11 -0000 To: commits@subversion.apache.org From: hwright@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110915015911.68501238890A@eris.apache.org> Author: hwright Date: Thu Sep 15 01:59:11 2011 New Revision: 1170924 URL: http://svn.apache.org/viewvc?rev=1170924&view=rev Log: Add some skeleton code to facilitate Ev2 shim post-processing. (Note: this code doesn't actually run yet, since we segfault calling the NULL fetch_props_func in the delta editor part of the shim.) * subversion/libsvn_delta/compat.c (editor_baton): Add a paths hash and edit_pool. (set_props_cb): Add our path to the hash. (complete_cb): Sort the paths and iterate over them. (svn_editor_from_delta): Initialize a few baton members. Modified: subversion/trunk/subversion/libsvn_delta/compat.c Modified: subversion/trunk/subversion/libsvn_delta/compat.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/compat.c?rev=1170924&r1=1170923&r2=1170924&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_delta/compat.c (original) +++ subversion/trunk/subversion/libsvn_delta/compat.c Thu Sep 15 01:59:11 2011 @@ -561,6 +561,9 @@ struct editor_baton { const svn_delta_editor_t *deditor; void *dedit_baton; + + apr_hash_t *paths; + apr_pool_t *edit_pool; }; /* This implements svn_editor_cb_add_directory_t */ @@ -618,6 +621,10 @@ set_props_cb(void *baton, svn_boolean_t complete, apr_pool_t *scratch_pool) { + struct editor_baton *eb = baton; + apr_hash_set(eb->paths, apr_pstrdup(eb->edit_pool, relpath), + APR_HASH_KEY_STRING, (void *)0xdeadbeef); + return SVN_NO_ERROR; } @@ -684,6 +691,24 @@ complete_cb(void *baton, apr_pool_t *scratch_pool) { struct editor_baton *eb = baton; + apr_array_header_t *sorted_hash; + int i; + + /* Sort the paths touched by this edit. + * Ev2 doesn't really have any particular need for depth-first-ness, but + * we want to ensure all parent directories are handled before children in + * the case of adds (which does introduce an element of depth-first-ness). */ + sorted_hash = svn_sort__hash(eb->paths, svn_sort_compare_items_as_paths, + scratch_pool); + + for (i = 0; i < sorted_hash->nelts; i++) + { + svn_sort__item_t *item = &APR_ARRAY_IDX(sorted_hash, i, svn_sort__item_t); + const char *path = item->key; + + /* ### We should actually do something here, but for now... */ + } + return svn_error_trace(eb->deditor->close_edit(eb->dedit_baton, scratch_pool)); } @@ -726,6 +751,8 @@ svn_editor_from_delta(svn_editor_t **edi eb->deditor = deditor; eb->dedit_baton = dedit_baton; + eb->edit_pool = result_pool; + eb->paths = apr_hash_make(result_pool); SVN_ERR(svn_editor_create(&editor, eb, cancel_func, cancel_baton, result_pool, scratch_pool));