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 46D52FE3E for ; Thu, 9 May 2013 16:58:39 +0000 (UTC) Received: (qmail 2312 invoked by uid 500); 9 May 2013 16:58:39 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 2287 invoked by uid 500); 9 May 2013 16:58:39 -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 2280 invoked by uid 99); 9 May 2013 16:58:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 May 2013 16:58:39 +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, 09 May 2013 16:58:37 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 854482388962; Thu, 9 May 2013 16:58:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1480723 - /subversion/trunk/subversion/libsvn_client/log.c Date: Thu, 09 May 2013 16:58:17 -0000 To: commits@subversion.apache.org From: pburba@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130509165817.854482388962@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: pburba Date: Thu May 9 16:58:17 2013 New Revision: 1480723 URL: http://svn.apache.org/r1480723 Log: More cleanup to issue #4355 'svn_client_log5 broken with multiple revisions which span a rename' fix in r1478220. Suggested by: cmpilato, julianfoad * subversion/libsvn_client/log.c (svn_client_log5): Fix typo in doc string. We know what size the output array will be, so just initialize it to that size. Remove an unnecessary dereference. (convert_opt_rev_array_to_rev_range_array): Replace memcmp comparison of two structures with proper member-wise comparison. Modified: subversion/trunk/subversion/libsvn_client/log.c Modified: subversion/trunk/subversion/libsvn_client/log.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/log.c?rev=1480723&r1=1480722&r2=1480723&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_client/log.c (original) +++ subversion/trunk/subversion/libsvn_client/log.c Thu May 9 16:58:17 2013 @@ -279,7 +279,7 @@ limit_receiver(void *baton, svn_log_entr that URL and *RELATIVE_TARGETS to an array with a single element "". If TARGETS contains a single URL and one or more relative paths, then - set *RA_TARGET to a copy of that URL and *CONDENSED_PATHS to a copy of + set *RA_TARGET to a copy of that URL and *RELATIVE_TARGETS to a copy of each relative path after the URL. If *PEG_REVISION is svn_opt_revision_unspecified, then *PEG_REVISION is @@ -308,15 +308,19 @@ resolve_log_targets(apr_array_header_t * return svn_error_create(SVN_ERR_ILLEGAL_TARGET, NULL, _("No valid target found")); - /* Initialize the output array. */ - *relative_targets = apr_array_make(result_pool, 1, sizeof(const char *)); + /* Initialize the output array. At a minimum, we need room for one + (possibly empty) relpath. Otherwise, we have to hold a relpath + for every item in TARGETS except the first. */ + *relative_targets = apr_array_make(result_pool, + MAX(1, targets->nelts - 1), + sizeof(const char *)); if (svn_path_is_url(url_or_path)) { /* An unspecified PEG_REVISION for a URL path defaults to svn_opt_revision_head. */ if (peg_revision->kind == svn_opt_revision_unspecified) - (*peg_revision).kind = svn_opt_revision_head; + peg_revision->kind = svn_opt_revision_head; /* The logic here is this: If we get passed one argument, we assume it is the full URL to a file/dir we want log info for. If we get @@ -365,7 +369,7 @@ resolve_log_targets(apr_array_header_t * /* An unspecified PEG_REVISION for a working copy path defaults to svn_opt_revision_working. */ if (peg_revision->kind == svn_opt_revision_unspecified) - (*peg_revision).kind = svn_opt_revision_working; + peg_revision->kind = svn_opt_revision_working; /* Get URLs for each target */ target = APR_ARRAY_IDX(targets, 0, const char *); @@ -418,8 +422,6 @@ find_youngest_and_oldest_revs(svn_revnum if (! SVN_IS_VALID_REVNUM(*oldest_rev) || rev < *oldest_rev) *oldest_rev = rev; - - return; } typedef struct rev_range_t @@ -521,9 +523,24 @@ convert_opt_rev_array_to_rev_range_array _("Missing required revision specification")); } - if (memcmp(&(range->start), &(range->end), - sizeof(svn_opt_revision_t)) == 0) - start_same_as_end = TRUE; + /* Does RANGE describe a single svn_opt_revision_t? */ + if (range->start.kind == range->end.kind) + { + if (range->start.kind == svn_opt_revision_number) + { + if (range->start.value.number == range->end.value.number) + start_same_as_end = TRUE; + } + else if (range->start.kind == svn_opt_revision_date) + { + if (range->start.value.date == range->end.value.date) + start_same_as_end = TRUE; + } + else + { + start_same_as_end = TRUE; + } + } rev_range = apr_palloc(result_pool, sizeof(*rev_range)); SVN_ERR(svn_client__get_revision_number(