Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1DF53200AC5 for ; Sun, 5 Jun 2016 16:58:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1C760160A28; Sun, 5 Jun 2016 14:58:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3D9E3160A25 for ; Sun, 5 Jun 2016 16:58:23 +0200 (CEST) Received: (qmail 17884 invoked by uid 500); 5 Jun 2016 14:58:22 -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 17873 invoked by uid 99); 5 Jun 2016 14:58:22 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Jun 2016 14:58:22 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id EB7531800EC for ; Sun, 5 Jun 2016 14:58:21 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.374 X-Spam-Level: X-Spam-Status: No, score=0.374 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id mRhemlf_0YzF for ; Sun, 5 Jun 2016 14:58:20 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 400535F2F0 for ; Sun, 5 Jun 2016 14:58:20 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id CC5B6E065E for ; Sun, 5 Jun 2016 14:58:18 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 7FFBF3A0766 for ; Sun, 5 Jun 2016 14:58:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1746926 [3/3] - in /subversion/trunk/subversion: include/private/svn_repos_private.h include/svn_repos.h libsvn_ra_local/ra_plugin.c libsvn_repos/compat.c libsvn_repos/deprecated.c libsvn_repos/log.c Date: Sun, 05 Jun 2016 14:58:17 -0000 To: commits@subversion.apache.org From: stefan2@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160605145818.7FFBF3A0766@svn01-us-west.apache.org> archived-at: Sun, 05 Jun 2016 14:58:24 -0000 Modified: subversion/trunk/subversion/libsvn_repos/deprecated.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/deprecated.c?rev=1746926&r1=1746925&r2=1746926&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_repos/deprecated.c (original) +++ subversion/trunk/subversion/libsvn_repos/deprecated.c Sun Jun 5 14:58:17 2016 @@ -35,6 +35,8 @@ #include "repos.h" +#include "private/svn_repos_private.h" + @@ -506,6 +508,30 @@ svn_repos_fs_get_locks(apr_hash_t **lock /*** From logs.c ***/ svn_error_t * +svn_repos_get_logs4(svn_repos_t *repos, + const apr_array_header_t *paths, + svn_revnum_t start, + svn_revnum_t end, + int limit, + svn_boolean_t discover_changed_paths, + svn_boolean_t strict_node_history, + svn_boolean_t include_merged_revisions, + const apr_array_header_t *revprops, + svn_repos_authz_func_t authz_read_func, + void *authz_read_baton, + svn_log_entry_receiver_t receiver, + void *receiver_baton, + apr_pool_t *pool) +{ + return svn_repos__get_logs_compat(repos, paths, start, end, limit, + discover_changed_paths, + strict_node_history, + include_merged_revisions, revprops, + authz_read_func, authz_read_baton, + receiver, receiver_baton, pool); +} + +svn_error_t * svn_repos_get_logs3(svn_repos_t *repos, const apr_array_header_t *paths, svn_revnum_t start, Modified: subversion/trunk/subversion/libsvn_repos/log.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/log.c?rev=1746926&r1=1746925&r2=1746926&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_repos/log.c (original) +++ subversion/trunk/subversion/libsvn_repos/log.c Sun Jun 5 14:58:17 2016 @@ -2414,143 +2414,3 @@ svn_repos_get_logs5(svn_repos_t *repos, include_merged_revisions, FALSE, FALSE, FALSE, revprops, descending_order, &callbacks, scratch_pool); } - -/* Baton type to be used with both log4 compatibility callbacks. - * For each revision, we collect the CHANGES and then pass them - * on to INNER. */ -typedef struct log_entry_receiver_baton_t -{ - /* Pool to use to allocate CHANGES and its entries. - * Gets cleared after each revision. */ - apr_pool_t *changes_pool; - - /* Path changes reported so far for the current revision. - * Will be NULL before the first item gets added and will be reset - * to NULL after the INNER callback has returned. */ - apr_hash_t *changes; - - /* User-provided callback to send the log entry to. */ - svn_log_entry_receiver_t inner; - void *inner_baton; -} log_entry_receiver_baton_t; - -/* Return the action character (see svn_log_changed_path2_t) for KIND. - * Returns 0 for invalid KINDs. */ -static char -path_change_kind_to_char(svn_fs_path_change_kind_t kind) -{ - const char symbol[] = "MADR"; - - if (kind < svn_fs_path_change_modify || kind > svn_fs_path_change_replace) - return 0; - - return symbol[kind]; -} - -/* Implement svn_repos_path_change_receiver_t. - * Convert CHANGE and add it to the CHANGES list in *BATON. */ -static svn_error_t * -log4_path_change_receiver(void *baton, - svn_repos_path_change_t *change, - apr_pool_t *scratch_pool) -{ - log_entry_receiver_baton_t *b = baton; - svn_log_changed_path2_t *change_copy; - const char *path = apr_pstrmemdup(b->changes_pool, change->path.data, - change->path.len); - - /* Create a deep copy of the temporary CHANGE struct. */ - change_copy = svn_log_changed_path2_create(b->changes_pool); - change_copy->action = path_change_kind_to_char(change->change_kind); - - if (change->copyfrom_path) - change_copy->copyfrom_path = apr_pstrdup(b->changes_pool, - change->copyfrom_path); - - change_copy->copyfrom_rev = change->copyfrom_rev; - change_copy->node_kind = change->node_kind; - change_copy->text_modified = change->text_mod ? svn_tristate_true - : svn_tristate_false; - change_copy->props_modified = change->prop_mod ? svn_tristate_true - : svn_tristate_false; - - /* Auto-create the CHANGES container (happens for each first change - * in any revison. */ - if (b->changes == NULL) - b->changes = svn_hash__make(b->changes_pool); - - /* Add change to per-revision collection. */ - apr_hash_set(b->changes, path, change->path.len, change_copy); - - return SVN_NO_ERROR; -} - -/* Implement svn_log_entry_receiver_t. - * Combine the data gathered in BATON for this revision and send it - * to the user-provided log4-compatible callback. */ -static svn_error_t * -log4_entry_receiver(void *baton, - svn_repos_log_entry_t *log_entry, - apr_pool_t *scratch_pool) -{ - log_entry_receiver_baton_t *b = baton; - svn_log_entry_t *entry = svn_log_entry_create(scratch_pool); - - /* Complete the ENTRY. */ - entry->changed_paths = b->changes; - entry->revision = log_entry->revision; - entry->revprops = log_entry->revprops; - entry->has_children = log_entry->has_children; - entry->changed_paths2 = b->changes; - entry->non_inheritable = log_entry->non_inheritable; - entry->subtractive_merge = log_entry->subtractive_merge; - - /* Invoke the log4-compatible callback. */ - SVN_ERR(b->inner(b->inner_baton, entry, scratch_pool)); - - /* Release per-revision data. */ - svn_pool_clear(b->changes_pool); - b->changes = NULL; - - return SVN_NO_ERROR; -} - -svn_error_t * -svn_repos_get_logs4(svn_repos_t *repos, - const apr_array_header_t *paths, - svn_revnum_t start, - svn_revnum_t end, - int limit, - svn_boolean_t discover_changed_paths, - svn_boolean_t strict_node_history, - svn_boolean_t include_merged_revisions, - const apr_array_header_t *revprops, - svn_repos_authz_func_t authz_read_func, - void *authz_read_baton, - svn_log_entry_receiver_t receiver, - void *receiver_baton, - apr_pool_t *pool) -{ - apr_pool_t *changes_pool = svn_pool_create(pool); - - log_entry_receiver_baton_t baton; - baton.changes_pool = changes_pool; - baton.changes = NULL; - baton.inner = receiver; - baton.inner_baton = receiver_baton; - - SVN_ERR(svn_repos_get_logs5(repos, paths, start, end, limit, - strict_node_history, - include_merged_revisions, - revprops, - authz_read_func, authz_read_baton, - discover_changed_paths - ? log4_path_change_receiver - : NULL, - &baton, - log4_entry_receiver, &baton, - pool)); - - svn_pool_destroy(changes_pool); - return SVN_NO_ERROR; -}