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 20736477B for ; Mon, 23 May 2011 16:56:49 +0000 (UTC) Received: (qmail 77253 invoked by uid 500); 23 May 2011 16:56:49 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 77233 invoked by uid 500); 23 May 2011 16:56:49 -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 77219 invoked by uid 99); 23 May 2011 16:56:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 May 2011 16:56:49 +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; Mon, 23 May 2011 16:56:46 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D1DDE23888FD; Mon, 23 May 2011 16:56:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1126580 - /subversion/trunk/subversion/svnsync/main.c Date: Mon, 23 May 2011 16:56:25 -0000 To: commits@subversion.apache.org From: cmpilato@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110523165625.D1DDE23888FD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: cmpilato Date: Mon May 23 16:56:25 2011 New Revision: 1126580 URL: http://svn.apache.org/viewvc?rev=1126580&view=rev Log: Reduce number of RA requests during 'svnsync info'. (This is the follow-up to r1126441.) * subversion/svnsync/main.c (info_cmd): Retrieve three properties using one svn_ra_rev_proplist() call instead of requesting them one by one. Patch by: Vijayaguru G Inspired by: ivan Modified: subversion/trunk/subversion/svnsync/main.c Modified: subversion/trunk/subversion/svnsync/main.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnsync/main.c?rev=1126580&r1=1126579&r2=1126580&view=diff ============================================================================== --- subversion/trunk/subversion/svnsync/main.c (original) +++ subversion/trunk/subversion/svnsync/main.c Mon May 23 16:56:25 2011 @@ -1633,6 +1633,7 @@ info_cmd(apr_getopt_t *os, void *b, apr_ apr_array_header_t *targets; subcommand_baton_t *baton; const char *to_url; + apr_hash_t *props; svn_string_t *from_url, *from_uuid, *last_merged_rev; SVN_ERR(svn_opt__args_to_target_array(&targets, os, @@ -1654,19 +1655,20 @@ info_cmd(apr_getopt_t *os, void *b, apr_ baton = make_subcommand_baton(opt_baton, to_url, NULL, 0, 0, pool); SVN_ERR(open_target_session(&to_session, baton, pool)); - /* Verify that the repos has been initialized for synchronization. */ - SVN_ERR(svn_ra_rev_prop(to_session, 0, SVNSYNC_PROP_FROM_URL, - &from_url, pool)); + SVN_ERR(svn_ra_rev_proplist(to_session, 0, &props, pool)); + + from_url = apr_hash_get(props, SVNSYNC_PROP_FROM_URL, + APR_HASH_KEY_STRING); + if (! from_url) return svn_error_createf (SVN_ERR_BAD_URL, NULL, _("Repository '%s' is not initialized for synchronization"), to_url); - /* Fetch more of the magic properties, which are the source of our info. */ - SVN_ERR(svn_ra_rev_prop(to_session, 0, SVNSYNC_PROP_FROM_UUID, - &from_uuid, pool)); - SVN_ERR(svn_ra_rev_prop(to_session, 0, SVNSYNC_PROP_LAST_MERGED_REV, - &last_merged_rev, pool)); + from_uuid = apr_hash_get(props, SVNSYNC_PROP_FROM_UUID, + APR_HASH_KEY_STRING); + last_merged_rev = apr_hash_get(props, SVNSYNC_PROP_LAST_MERGED_REV, + APR_HASH_KEY_STRING); /* Print the info. */ SVN_ERR(svn_cmdline_printf(pool, _("Source URL: %s\n"), from_url->data));