Return-Path: Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: (qmail 55866 invoked from network); 6 Apr 2010 16:25:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Apr 2010 16:25:44 -0000 Received: (qmail 30801 invoked by uid 500); 6 Apr 2010 16:25:44 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 30784 invoked by uid 500); 6 Apr 2010 16:25:44 -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 30777 invoked by uid 99); 6 Apr 2010 16:25:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Apr 2010 16:25:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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, 06 Apr 2010 16:25:42 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 54F0423888E3; Tue, 6 Apr 2010 16:25:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r931209 - /subversion/trunk/subversion/libsvn_ra/ra_loader.c Date: Tue, 06 Apr 2010 16:25:21 -0000 To: commits@subversion.apache.org From: cmpilato@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100406162521.54F0423888E3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: cmpilato Date: Tue Apr 6 16:25:21 2010 New Revision: 931209 URL: http://svn.apache.org/viewvc?rev=931209&view=rev Log: Add compat code to work around pre-1.7 servers' messy handling of mergeinfo paths. * subversion/libsvn_ra/ra_loader.c (svn_ra_get_mergeinfo): Strip leading slashes from catalog keys returned by the RA provider. Modified: subversion/trunk/subversion/libsvn_ra/ra_loader.c Modified: subversion/trunk/subversion/libsvn_ra/ra_loader.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/ra_loader.c?rev=931209&r1=931208&r2=931209&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_ra/ra_loader.c (original) +++ subversion/trunk/subversion/libsvn_ra/ra_loader.c Tue Apr 6 16:25:21 2010 @@ -689,6 +689,8 @@ svn_error_t *svn_ra_get_mergeinfo(svn_ra { svn_error_t *err; int i; + apr_hash_index_t *hi; + svn_mergeinfo_catalog_t tmp_catalog; /* Validate path format. */ for (i = 0; i < paths->nelts; i++) @@ -705,9 +707,40 @@ svn_error_t *svn_ra_get_mergeinfo(svn_ra return err; } - return session->vtable->get_mergeinfo(session, catalog, paths, - revision, inherit, - include_descendants, pool); + SVN_ERR(session->vtable->get_mergeinfo(session, &tmp_catalog, paths, + revision, inherit, + include_descendants, pool)); + + if (tmp_catalog == NULL) + { + *catalog = NULL; + return SVN_NO_ERROR; + } + + /* Work around a bug in pre-1.7 servers that caused CATALOG's keys + to be a mix of absolute and relative paths (when they were all + supposed to be relative. */ + *catalog = apr_hash_make(pool); + for (hi = apr_hash_first(pool, tmp_catalog); hi; hi = apr_hash_next(hi)) + { + const void *key; + apr_ssize_t klen; + void *val; + const char *path; + + apr_hash_this(hi, &key, &klen, &val); + path = key; + if (path[0] == '/') + { + apr_hash_set(*catalog, path + 1, klen - 1, val); + } + else + { + apr_hash_set(*catalog, path, klen, val); + } + } + + return SVN_NO_ERROR; } svn_error_t *svn_ra_do_update2(svn_ra_session_t *session,