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 D3D22E088 for ; Tue, 12 Feb 2013 10:12:46 +0000 (UTC) Received: (qmail 38970 invoked by uid 500); 12 Feb 2013 10:12:46 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 38858 invoked by uid 500); 12 Feb 2013 10:12:46 -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 38834 invoked by uid 99); 12 Feb 2013 10:12:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Feb 2013 10:12:45 +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; Tue, 12 Feb 2013 10:12:42 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0539A23888D2; Tue, 12 Feb 2013 10:12:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1445083 - in /subversion/trunk/subversion: include/svn_dav.h libsvn_ra_serf/options.c mod_dav_svn/version.c Date: Tue, 12 Feb 2013 10:12:21 -0000 To: commits@subversion.apache.org From: ivan@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130212101222.0539A23888D2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ivan Date: Tue Feb 12 10:12:20 2013 New Revision: 1445083 URL: http://svn.apache.org/r1445083 Log: Report repository merge tracking capability using HTTPv2 like header 'SVN-Repository-MergeInfo'. * subversion/include/svn_dav.h (SVN_DAV_REPOSITORY_MERGEINFO): New. * subversion/libsvn_ra_serf/options.c (capabilities_headers_iterator_callback): Set SVN_RA_CAPABILITY_MERGEINFO to CAPABILITY_SERVER_YES only if didn't receive explicit repository merge tracking capability. Handle new SVN_DAV_REPOSITORY_MERGEINFO header. (options_response_handler): Reset SVN_RA_CAPABILITY_MERGEINFO to NULL before iterating headers. * subversion/mod_dav_svn/version.c (get_option): Report repository merge tracking capability using SVN_DAV_REPOSITORY_MERGEINFO header. Modified: subversion/trunk/subversion/include/svn_dav.h subversion/trunk/subversion/libsvn_ra_serf/options.c subversion/trunk/subversion/mod_dav_svn/version.c Modified: subversion/trunk/subversion/include/svn_dav.h URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_dav.h?rev=1445083&r1=1445082&r2=1445083&view=diff ============================================================================== --- subversion/trunk/subversion/include/svn_dav.h (original) +++ subversion/trunk/subversion/include/svn_dav.h Tue Feb 12 10:12:20 2013 @@ -198,6 +198,13 @@ extern "C" { * @since New in 1.8. */ #define SVN_DAV_ALLOW_BULK_UPDATES "SVN-Allow-Bulk-Updates" +/** Assuming the OPTIONS was performed against a resource within a + * Subversion repository, then this header indicates the whether repository + * is capable to store merge tracking information ("yes") or it + * does not ("no"). + * @since New in 1.8. */ +#define SVN_DAV_REPOSITORY_MERGEINFO "SVN-Repository-MergeInfo" + /** * @name Fulltext MD5 headers * Modified: subversion/trunk/subversion/libsvn_ra_serf/options.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/options.c?rev=1445083&r1=1445082&r2=1445083&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_ra_serf/options.c (original) +++ subversion/trunk/subversion/libsvn_ra_serf/options.c Tue Feb 12 10:12:20 2013 @@ -177,8 +177,11 @@ capabilities_headers_iterator_callback(v { /* The server doesn't know what repository we're referring to, so it can't just say capability_yes. */ - svn_hash_sets(session->capabilities, - SVN_RA_CAPABILITY_MERGEINFO, capability_server_yes); + if (!svn_hash_gets(session->capabilities, SVN_RA_CAPABILITY_MERGEINFO)) + { + svn_hash_sets(session->capabilities, SVN_RA_CAPABILITY_MERGEINFO, + capability_server_yes); + } } if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_LOG_REVPROPS, vals)) { @@ -300,6 +303,19 @@ capabilities_headers_iterator_callback(v svn_hash_sets(session->supported_posts, post_val, (void *)1); } } + else if (svn_cstring_casecmp(key, SVN_DAV_REPOSITORY_MERGEINFO) == 0) + { + if (svn_cstring_casecmp(val, "yes") == 0) + { + svn_hash_sets(session->capabilities, SVN_RA_CAPABILITY_MERGEINFO, + capability_yes); + } + else if (svn_cstring_casecmp(val, "no") == 0) + { + svn_hash_sets(session->capabilities, SVN_RA_CAPABILITY_MERGEINFO, + capability_no); + } + } } return 0; @@ -329,7 +345,7 @@ options_response_handler(serf_request_t svn_hash_sets(session->capabilities, SVN_RA_CAPABILITY_DEPTH, capability_no); svn_hash_sets(session->capabilities, SVN_RA_CAPABILITY_MERGEINFO, - capability_no); + NULL); svn_hash_sets(session->capabilities, SVN_RA_CAPABILITY_LOG_REVPROPS, capability_no); svn_hash_sets(session->capabilities, SVN_RA_CAPABILITY_ATOMIC_REVPROPS, @@ -343,6 +359,12 @@ options_response_handler(serf_request_t serf_bucket_headers_do(hdrs, capabilities_headers_iterator_callback, opt_ctx); + /* Assume mergeinfo capability unsupported, if didn't recieve information + about server or repository mergeinfo capability. */ + if (!svn_hash_gets(session->capabilities, SVN_RA_CAPABILITY_MERGEINFO)) + svn_hash_sets(session->capabilities, SVN_RA_CAPABILITY_MERGEINFO, + capability_no); + opt_ctx->headers_processed = TRUE; } Modified: subversion/trunk/subversion/mod_dav_svn/version.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/version.c?rev=1445083&r1=1445082&r2=1445083&view=diff ============================================================================== --- subversion/trunk/subversion/mod_dav_svn/version.c (original) +++ subversion/trunk/subversion/mod_dav_svn/version.c Tue Feb 12 10:12:20 2013 @@ -242,6 +242,24 @@ get_option(const dav_resource *resource, } } + if (resource->info->repos->repos) + { + svn_error_t *serr; + svn_boolean_t has; + + serr = svn_repos_has_capability(resource->info->repos->repos, &has, + SVN_REPOS_CAPABILITY_MERGEINFO, + r->pool); + if (serr) + return dav_svn__convert_err + (serr, HTTP_INTERNAL_SERVER_ERROR, + "Error fetching repository capabilities", + resource->pool); + + apr_table_set(r->headers_out, SVN_DAV_REPOSITORY_MERGEINFO, + has ? "yes" : "no"); + } + /* Welcome to the 2nd generation of the svn HTTP protocol, now DeltaV-free! If we're configured to advise this support, do so. */ if (resource->info->repos->v2_protocol)