subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1781698 - /subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
Date Sat, 04 Feb 2017 18:48:39 GMT
Author: stefan2
Date: Sat Feb  4 18:48:39 2017
New Revision: 1781698

URL: http://svn.apache.org/viewvc?rev=1781698&view=rev
Log:
Update the last usage of the deprecated svn_repos_fs_get_mergeinfo API.

* subversion/libsvn_ra_local/ra_plugin.c
  (mergeinfo_receiver): New callback function.
  (svn_ra_local__get_mergeinfo): Switch to the new API.

Modified:
    subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c

Modified: subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c?rev=1781698&r1=1781697&r2=1781698&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c Sat Feb  4 18:48:39 2017
@@ -909,6 +909,28 @@ svn_ra_local__get_commit_editor(svn_ra_s
 }
 
 
+/* Implements svn_repos_mergeinfo_receiver_t.
+ * It add MERGEINFO for PATH to the svn_mergeinfo_catalog_t BATON.
+ */
+static svn_error_t *
+mergeinfo_receiver(const char *path,
+                   svn_mergeinfo_t mergeinfo,
+                   void *baton,
+                   apr_pool_t *scratch_pool)
+{
+  svn_mergeinfo_catalog_t catalog = baton;
+  apr_pool_t *result_pool = apr_hash_pool_get(catalog);
+  apr_size_t len = strlen(path);
+
+  apr_hash_set(catalog,
+               apr_pstrmemdup(result_pool, path, len),
+               len,
+               svn_mergeinfo_dup(mergeinfo, result_pool));
+
+  return SVN_NO_ERROR;
+}
+
+
 static svn_error_t *
 svn_ra_local__get_mergeinfo(svn_ra_session_t *session,
                             svn_mergeinfo_catalog_t *catalog,
@@ -919,7 +941,7 @@ svn_ra_local__get_mergeinfo(svn_ra_sessi
                             apr_pool_t *pool)
 {
   svn_ra_local__session_baton_t *sess = session->priv;
-  svn_mergeinfo_catalog_t tmp_catalog;
+  svn_mergeinfo_catalog_t tmp_catalog = svn_hash__make(pool);
   int i;
   apr_array_header_t *abs_paths =
     apr_array_make(pool, 0, sizeof(const char *));
@@ -931,9 +953,11 @@ svn_ra_local__get_mergeinfo(svn_ra_sessi
         svn_fspath__join(sess->fs_path->data, relative_path, pool);
     }
 
-  SVN_ERR(svn_repos_fs_get_mergeinfo(&tmp_catalog, sess->repos, abs_paths,
-                                     revision, inherit, include_descendants,
-                                     NULL, NULL, pool));
+  SVN_ERR(svn_repos_fs_get_mergeinfo2(sess->repos, abs_paths, revision,
+                                      inherit, include_descendants,
+                                      NULL, NULL,
+                                      mergeinfo_receiver, tmp_catalog,
+                                      pool));
   if (apr_hash_count(tmp_catalog) > 0)
     SVN_ERR(svn_mergeinfo__remove_prefix_from_catalog(catalog,
                                                       tmp_catalog,



Mime
View raw message