subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1780824 - in /subversion/trunk/subversion: include/private/svn_fs_private.h libsvn_fs/fs-loader.c libsvn_repos/repos.c
Date Sun, 29 Jan 2017 16:53:25 GMT
Author: stefan2
Date: Sun Jan 29 16:53:25 2017
New Revision: 1780824

URL: http://svn.apache.org/viewvc?rev=1780824&view=rev
Log:
Replace all usages of svn_fs_get_mergeinfo2 with the new API.

* subversion/include/private/svn_fs_private.h
  (svn_fs__get_mergeinfo_for_path): Update reference in docstring.

* subversion/libsvn_fs/fs-loader.c
  (mergeinfo_receiver_baton_t,
   mergeinfo_receiver): New callback & baton to be used with ...
  (svn_fs__get_mergeinfo_for_path): ... this when calling the new API.

* subversion/libsvn_repos/repos.c
  (dummy_mergeinfo_receiver): New callback to be used with ...
  (svn_repos_has_capability):  ... this when calling the new API.

Modified:
    subversion/trunk/subversion/include/private/svn_fs_private.h
    subversion/trunk/subversion/libsvn_fs/fs-loader.c
    subversion/trunk/subversion/libsvn_repos/repos.c

Modified: subversion/trunk/subversion/include/private/svn_fs_private.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_fs_private.h?rev=1780824&r1=1780823&r2=1780824&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_fs_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_fs_private.h Sun Jan 29 16:53:25 2017
@@ -183,7 +183,7 @@ svn_fs__editor_commit(svn_revnum_t *revi
  *
  * If there is no mergeinfo, set @a *mergeinfo to NULL.
  *
- * See svn_fs_get_mergeinfo2() but for the meanings of @a inherit and
+ * See svn_fs_get_mergeinfo3() but for the meanings of @a inherit and
  * @a adjust_inheritable_mergeinfo and other details.
  */
 svn_error_t *

Modified: subversion/trunk/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/fs-loader.c?rev=1780824&r1=1780823&r2=1780824&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/trunk/subversion/libsvn_fs/fs-loader.c Sun Jan 29 16:53:25 2017
@@ -1393,6 +1393,26 @@ svn_fs_get_mergeinfo3(svn_fs_root_t *roo
     receiver, baton, scratch_pool));
 }
 
+/* Baton type to be used with mergeinfo_receiver().  It provides some of
+ * the parameters passed to svn_fs__get_mergeinfo_for_path. */
+typedef struct mergeinfo_receiver_baton_t
+{
+  svn_mergeinfo_t *mergeinfo;
+  apr_pool_t *result_pool;
+} mergeinfo_receiver_baton_t;
+
+static svn_error_t *
+mergeinfo_receiver(const char *path,
+                   svn_mergeinfo_t mergeinfo,
+                   void *baton,
+                   apr_pool_t *scratch_pool)
+{
+  mergeinfo_receiver_baton_t *b = baton;
+  *b->mergeinfo = svn_mergeinfo_dup(mergeinfo, b->result_pool);
+
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 svn_fs__get_mergeinfo_for_path(svn_mergeinfo_t *mergeinfo,
                                svn_fs_root_t *root,
@@ -1404,15 +1424,19 @@ svn_fs__get_mergeinfo_for_path(svn_merge
 {
   apr_array_header_t *paths
     = apr_array_make(scratch_pool, 1, sizeof(const char *));
-  svn_mergeinfo_catalog_t catalog;
+
+  mergeinfo_receiver_baton_t baton;
+  baton.mergeinfo = mergeinfo;
+  baton.result_pool = result_pool;
 
   APR_ARRAY_PUSH(paths, const char *) = path;
 
-  SVN_ERR(svn_fs_get_mergeinfo2(&catalog, root, paths,
+  *mergeinfo = NULL;
+  SVN_ERR(svn_fs_get_mergeinfo3(root, paths,
                                 inherit, FALSE /*include_descendants*/,
                                 adjust_inherited_mergeinfo,
-                                result_pool, scratch_pool));
-  *mergeinfo = svn_hash_gets(catalog, path);
+                                mergeinfo_receiver, &baton,
+                                scratch_pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/repos.c?rev=1780824&r1=1780823&r2=1780824&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/repos.c (original)
+++ subversion/trunk/subversion/libsvn_repos/repos.c Sun Jan 29 16:53:25 2017
@@ -1504,6 +1504,16 @@ static const char *capability_yes = "yes
 /* Repository does not support the capability. */
 static const char *capability_no = "no";
 
+static svn_error_t *
+dummy_mergeinfo_receiver(const char *path,
+                         svn_mergeinfo_t mergeinfo,
+                         void *baton,
+                         apr_pool_t *scratch_pool)
+{
+  return SVN_NO_ERROR;
+}
+
+
 svn_error_t *
 svn_repos_has_capability(svn_repos_t *repos,
                          svn_boolean_t *has,
@@ -1525,14 +1535,13 @@ svn_repos_has_capability(svn_repos_t *re
     {
       svn_error_t *err;
       svn_fs_root_t *root;
-      svn_mergeinfo_catalog_t ignored;
       apr_array_header_t *paths = apr_array_make(pool, 1,
                                                  sizeof(char *));
 
       SVN_ERR(svn_fs_revision_root(&root, repos->fs, 0, pool));
       APR_ARRAY_PUSH(paths, const char *) = "";
-      err = svn_fs_get_mergeinfo2(&ignored, root, paths, FALSE, FALSE,
-                                  TRUE, pool, pool);
+      err = svn_fs_get_mergeinfo3(root, paths, FALSE, FALSE, TRUE,
+                                  dummy_mergeinfo_receiver, NULL, pool);
 
       if (err)
         {



Mime
View raw message