subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1188256 - in /subversion/trunk/subversion: include/ libsvn_client/ libsvn_delta/ libsvn_ra_neon/ libsvn_ra_serf/ libsvn_ra_svn/ libsvn_repos/ libsvn_wc/ svnrdump/ svnsync/
Date Mon, 24 Oct 2011 17:48:07 GMT
Author: hwright
Date: Mon Oct 24 17:48:06 2011
New Revision: 1188256

URL: http://svn.apache.org/viewvc?rev=1188256&view=rev
Log:
Create a struct to hold the ever-growing collection of Ev2 shim callbacks.

* subversion/include/svn_delta.h
  (svn_delta_shim_callbacks_t, svn_delta_shim_callbacks_default): New.
  (svn_editor__insert_shims): Use the struct in place of individual params.
 
* subversion/libsvn_ra_svn/editorp.c,
  subversion/libsvn_ra_neon/commit.c,
  subversion/svnsync/main.c,
  subversion/svnrdump/dump_editor.c,
  subversion/libsvn_wc/diff_editor.c,
  subversion/libsvn_wc/update_editor.c,
  subversion/libsvn_wc/status.c,
  subversion/libsvn_client/repos_diff.c,
  subversion/libsvn_client/mergeinfo.c,
  subversion/libsvn_client/export.c,
  subversion/libsvn_ra_serf/commit.c,
  subversion/libsvn_repos/commit.c,
  subversion/libsvn_repos/dump.c:
    Use the new struct and update callers to the shim API.

* subversion/libsvn_delta/compat.c
  (svn_delta_shim_callbacks_default): New.
  (svn_editor__insert_shims): Use the new datatype.

Modified:
    subversion/trunk/subversion/include/svn_delta.h
    subversion/trunk/subversion/libsvn_client/export.c
    subversion/trunk/subversion/libsvn_client/mergeinfo.c
    subversion/trunk/subversion/libsvn_client/repos_diff.c
    subversion/trunk/subversion/libsvn_delta/compat.c
    subversion/trunk/subversion/libsvn_ra_neon/commit.c
    subversion/trunk/subversion/libsvn_ra_serf/commit.c
    subversion/trunk/subversion/libsvn_ra_svn/editorp.c
    subversion/trunk/subversion/libsvn_repos/commit.c
    subversion/trunk/subversion/libsvn_repos/dump.c
    subversion/trunk/subversion/libsvn_wc/diff_editor.c
    subversion/trunk/subversion/libsvn_wc/status.c
    subversion/trunk/subversion/libsvn_wc/update_editor.c
    subversion/trunk/subversion/svnrdump/dump_editor.c
    subversion/trunk/subversion/svnsync/main.c

Modified: subversion/trunk/subversion/include/svn_delta.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_delta.h?rev=1188256&r1=1188255&r2=1188256&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_delta.h (original)
+++ subversion/trunk/subversion/include/svn_delta.h Mon Oct 24 17:48:06 2011
@@ -1111,6 +1111,28 @@ typedef svn_error_t *(*svn_delta_fetch_k
   apr_pool_t *scratch_pool
   );
 
+/** Collection of callbacks used for the shim code.  To enable this struct
+ * to grow, always use svn_delta_shim_callbacks_default()
+ * to allocate new instances of it.
+ *
+ * @since New in 1.8.
+ */
+typedef struct svn_delta_shim_callbacks_t
+{
+  svn_delta_fetch_props_func_t fetch_props_func;
+  void *fetch_props_baton;
+  svn_delta_fetch_kind_func_t fetch_kind_func;
+  void *fetch_kind_baton;
+} svn_delta_shim_callbacks_t;
+
+/** Return a collection of default shim functions in @a result_pool.
+ *
+ * @since New in 1.8.
+ */
+svn_delta_shim_callbacks_t *
+svn_delta_shim_callbacks_default(apr_pool_t *result_pool);
+
+
 /* Return a delta editor and baton which will forward calls to @a editor,
  * allocated in @a pool.
  *
@@ -1166,10 +1188,7 @@ svn_editor__insert_shims(const svn_delta
                          void **dedit_baton_out,
                          const svn_delta_editor_t *deditor_in,
                          void *dedit_baton_in,
-                         svn_delta_fetch_props_func_t fetch_props_func,
-                         void *fetch_props_baton,
-                         svn_delta_fetch_kind_func_t fetch_kind_func,
-                         void *fetch_kind_baton,
+                         svn_delta_shim_callbacks_t *shim_callbacks,
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool);
 

Modified: subversion/trunk/subversion/libsvn_client/export.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/export.c?rev=1188256&r1=1188255&r2=1188256&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/export.c (original)
+++ subversion/trunk/subversion/libsvn_client/export.c Mon Oct 24 17:48:06 2011
@@ -1160,6 +1160,8 @@ svn_client_export5(svn_revnum_t *result_
           void *report_baton;
           svn_delta_editor_t *editor = svn_delta_default_editor(pool);
           svn_boolean_t use_sleep = FALSE;
+          svn_delta_shim_callbacks_t *shim_callbacks =
+                                    svn_delta_shim_callbacks_default(pool);
 
           editor->set_target_revision = set_target_revision;
           editor->open_root = open_root;
@@ -1180,8 +1182,7 @@ svn_client_export5(svn_revnum_t *result_
 
           SVN_ERR(svn_editor__insert_shims(&export_editor, &edit_baton,
                                            export_editor, edit_baton,
-                                           NULL, NULL, NULL, NULL,
-                                           pool, pool));
+                                           shim_callbacks, pool, pool));
 
           /* Manufacture a basic 'report' to the update reporter. */
           SVN_ERR(svn_ra_do_update2(ra_session,

Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.c?rev=1188256&r1=1188255&r2=1188256&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_client/mergeinfo.c Mon Oct 24 17:48:06 2011
@@ -1177,6 +1177,8 @@ svn_client__elide_mergeinfo_catalog(svn_
   struct elide_mergeinfo_catalog_cb_baton cb = { 0 };
   void *eb;
   int i;
+  svn_delta_shim_callbacks_t *shim_callbacks =
+                                     svn_delta_shim_callbacks_default(pool);
 
   cb.elidable_paths = elidable_paths;
   cb.mergeinfo_catalog = mergeinfo_catalog;
@@ -1187,8 +1189,7 @@ svn_client__elide_mergeinfo_catalog(svn_
 
   eb = mergeinfo_catalog;
   SVN_ERR(svn_editor__insert_shims((const svn_delta_editor_t **)&editor, &eb,
-                                   editor, eb, NULL, NULL, NULL, NULL,
-                                   pool, pool));
+                                   editor, eb, shim_callbacks, pool, pool));
 
   /* Walk over the paths, and build up a list of elidable ones. */
   SVN_ERR(svn_hash_keys(&paths, mergeinfo_catalog, pool));

Modified: subversion/trunk/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/repos_diff.c?rev=1188256&r1=1188255&r2=1188256&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/repos_diff.c Mon Oct 24 17:48:06 2011
@@ -1348,6 +1348,8 @@ svn_client__get_diff_editor(const svn_de
   apr_pool_t *editor_pool = svn_pool_create(result_pool);
   svn_delta_editor_t *tree_editor = svn_delta_default_editor(editor_pool);
   struct edit_baton *eb = apr_pcalloc(editor_pool, sizeof(*eb));
+  svn_delta_shim_callbacks_t *shim_callbacks =
+                                svn_delta_shim_callbacks_default(editor_pool);
 
   eb->pool = editor_pool;
   eb->depth = depth;
@@ -1388,7 +1390,7 @@ svn_client__get_diff_editor(const svn_de
                                             eb->pool));
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   NULL, NULL, NULL, NULL,
+                                   shim_callbacks,
                                    result_pool, result_pool));
 
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/libsvn_delta/compat.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/compat.c?rev=1188256&r1=1188255&r2=1188256&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_delta/compat.c (original)
+++ subversion/trunk/subversion/libsvn_delta/compat.c Mon Oct 24 17:48:06 2011
@@ -1060,6 +1060,13 @@ svn_editor_from_delta(svn_editor_t **edi
   return SVN_NO_ERROR;
 }
 
+svn_delta_shim_callbacks_t *
+svn_delta_shim_callbacks_default(apr_pool_t *result_pool)
+{
+  svn_delta_shim_callbacks_t *shim_callbacks = apr_pcalloc(result_pool,
+                                                     sizeof(*shim_callbacks));
+  return shim_callbacks;
+}
 
 /* Uncomment below to add editor shims throughout Subversion.  In it's
  * current state, that will likely break The World. */
@@ -1070,10 +1077,7 @@ svn_editor__insert_shims(const svn_delta
                          void **dedit_baton_out,
                          const svn_delta_editor_t *deditor_in,
                          void *dedit_baton_in,
-                         svn_delta_fetch_props_func_t fetch_props_func,
-                         void *fetch_props_baton,
-                         svn_delta_fetch_kind_func_t fetch_kind_func,
-                         void *fetch_kind_baton,
+                         svn_delta_shim_callbacks_t *shim_callbacks,
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool)
 {
@@ -1088,10 +1092,12 @@ svn_editor__insert_shims(const svn_delta
   svn_editor_t *editor;
 
   SVN_ERR(svn_editor_from_delta(&editor, deditor_in, dedit_baton_in,
-                                NULL, NULL, fetch_kind_func, fetch_kind_baton,
+                                NULL, NULL, shim_callbacks->fetch_kind_func,
+                                shim_callbacks->fetch_kind_baton,
                                 result_pool, scratch_pool));
   SVN_ERR(svn_delta_from_editor(deditor_out, dedit_baton_out, editor,
-                                fetch_props_func, fetch_props_baton,
+                                shim_callbacks->fetch_props_func,
+                                shim_callbacks->fetch_props_baton,
                                 result_pool));
 
 #endif

Modified: subversion/trunk/subversion/libsvn_ra_neon/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_neon/commit.c?rev=1188256&r1=1188255&r2=1188256&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_neon/commit.c (original)
+++ subversion/trunk/subversion/libsvn_ra_neon/commit.c Mon Oct 24 17:48:06 2011
@@ -1572,6 +1572,8 @@ svn_error_t * svn_ra_neon__get_commit_ed
   svn_delta_editor_t *commit_editor;
   commit_ctx_t *cc;
   apr_hash_index_t *hi;
+  svn_delta_shim_callbacks_t *shim_callbacks =
+                                svn_delta_shim_callbacks_default(pool);
 
   /* Build the main commit editor's baton. */
   cc = apr_pcalloc(pool, sizeof(*cc));
@@ -1622,7 +1624,7 @@ svn_error_t * svn_ra_neon__get_commit_ed
   *edit_baton = cc;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   NULL, NULL, NULL, NULL, pool, pool));
+                                   shim_callbacks, pool, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/commit.c?rev=1188256&r1=1188255&r2=1188256&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/commit.c Mon Oct 24 17:48:06 2011
@@ -2320,6 +2320,8 @@ svn_ra_serf__get_commit_editor(svn_ra_se
   svn_delta_editor_t *editor;
   commit_context_t *ctx;
   apr_hash_index_t *hi;
+  svn_delta_shim_callbacks_t *shim_callbacks =
+                                    svn_delta_shim_callbacks_default(pool);
 
   ctx = apr_pcalloc(pool, sizeof(*ctx));
 
@@ -2367,8 +2369,7 @@ svn_ra_serf__get_commit_editor(svn_ra_se
   *edit_baton = ctx;
 
   SVN_ERR(svn_editor__insert_shims(ret_editor, edit_baton, *ret_editor,
-                                   *edit_baton, NULL, NULL, NULL, NULL,
-                                   pool, pool));
+                                   *edit_baton, shim_callbacks, pool, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_ra_svn/editorp.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/editorp.c?rev=1188256&r1=1188255&r2=1188256&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/editorp.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/editorp.c Mon Oct 24 17:48:06 2011
@@ -408,6 +408,8 @@ void svn_ra_svn_get_editor(const svn_del
 {
   svn_delta_editor_t *ra_svn_editor = svn_delta_default_editor(pool);
   ra_svn_edit_baton_t *eb;
+  svn_delta_shim_callbacks_t *shim_callbacks =
+                                    svn_delta_shim_callbacks_default(pool);
 
   eb = apr_palloc(pool, sizeof(*eb));
   eb->conn = conn;
@@ -437,8 +439,8 @@ void svn_ra_svn_get_editor(const svn_del
   *edit_baton = eb;
 
   svn_error_clear(svn_editor__insert_shims(editor, edit_baton, *editor,
-                                           *edit_baton, NULL, NULL,
-                                           NULL, NULL, pool, pool));
+                                           *edit_baton, shim_callbacks,
+                                           pool, pool));
 }
 
 /* --- DRIVING AN EDITOR --- */

Modified: subversion/trunk/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/commit.c?rev=1188256&r1=1188255&r2=1188256&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/commit.c (original)
+++ subversion/trunk/subversion/libsvn_repos/commit.c Mon Oct 24 17:48:06 2011
@@ -802,6 +802,8 @@ svn_repos_get_commit_editor5(const svn_d
   svn_delta_editor_t *e;
   apr_pool_t *subpool = svn_pool_create(pool);
   struct edit_baton *eb;
+  svn_delta_shim_callbacks_t *shim_callbacks =
+                                    svn_delta_shim_callbacks_default(pool);
 
   /* Do a global authz access lookup.  Users with no write access
      whatsoever to the repository don't get a commit editor. */
@@ -854,7 +856,7 @@ svn_repos_get_commit_editor5(const svn_d
   *editor = e;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   NULL, NULL, NULL, NULL, pool, pool));
+                                   shim_callbacks, pool, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/dump.c?rev=1188256&r1=1188255&r2=1188256&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/dump.c (original)
+++ subversion/trunk/subversion/libsvn_repos/dump.c Mon Oct 24 17:48:06 2011
@@ -870,6 +870,8 @@ get_dump_editor(const svn_delta_editor_t
      root baton. */
   struct edit_baton *eb = apr_pcalloc(pool, sizeof(*eb));
   svn_delta_editor_t *dump_editor = svn_delta_default_editor(pool);
+  svn_delta_shim_callbacks_t *shim_callbacks =
+                                svn_delta_shim_callbacks_default(pool);
 
   /* Set up the edit baton. */
   eb->stream = stream;
@@ -897,7 +899,7 @@ get_dump_editor(const svn_delta_editor_t
   *editor = dump_editor;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   NULL, NULL, NULL, NULL, pool, pool));
+                                   shim_callbacks, pool, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/diff_editor.c?rev=1188256&r1=1188255&r2=1188256&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/diff_editor.c Mon Oct 24 17:48:06 2011
@@ -1880,6 +1880,8 @@ svn_wc_get_diff_editor6(const svn_delta_
   void *inner_baton;
   svn_delta_editor_t *tree_editor;
   const svn_delta_editor_t *inner_editor;
+  svn_delta_shim_callbacks_t *shim_callbacks =
+                                svn_delta_shim_callbacks_default(result_pool);
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(anchor_abspath));
 
@@ -1932,8 +1934,7 @@ svn_wc_get_diff_editor6(const svn_delta_
                                             result_pool));
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   NULL, NULL, NULL, NULL,
-                                   result_pool, scratch_pool));
+                                   shim_callbacks, result_pool, scratch_pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=1188256&r1=1188255&r2=1188256&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/status.c Mon Oct 24 17:48:06 2011
@@ -2456,6 +2456,8 @@ svn_wc_get_status_editor5(const svn_delt
   svn_delta_editor_t *tree_editor = svn_delta_default_editor(result_pool);
   void *inner_baton;
   const svn_delta_editor_t *inner_editor;
+  svn_delta_shim_callbacks_t *shim_callbacks =
+                                svn_delta_shim_callbacks_default(result_pool);
 
   /* Construct an edit baton. */
   eb = apr_pcalloc(result_pool, sizeof(*eb));
@@ -2544,7 +2546,7 @@ svn_wc_get_status_editor5(const svn_delt
     *set_locks_baton = eb;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   NULL, NULL, NULL, NULL,
+                                   shim_callbacks,
                                    result_pool, scratch_pool));
 
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1188256&r1=1188255&r2=1188256&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Mon Oct 24 17:48:06 2011
@@ -4806,6 +4806,8 @@ make_editor(svn_revnum_t *target_revisio
   const svn_delta_editor_t *inner_editor;
   const char *repos_root, *repos_uuid;
   struct fetch_baton *fpb;
+  svn_delta_shim_callbacks_t *shim_callbacks =
+                                svn_delta_shim_callbacks_default(edit_pool);
 
   /* An unknown depth can't be sticky. */
   if (depth == svn_depth_unknown)
@@ -5036,9 +5038,14 @@ make_editor(svn_revnum_t *target_revisio
   fpb = apr_palloc(result_pool, sizeof(*fpb));
   fpb->db = db;
   fpb->target_abspath = eb->target_abspath;
+
+  shim_callbacks->fetch_kind_func = fetch_kind_func;
+  shim_callbacks->fetch_kind_baton = fpb;
+  shim_callbacks->fetch_props_func = fetch_props_func;
+  shim_callbacks->fetch_props_baton = fpb;
+
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   fetch_props_func, fpb, fetch_kind_func, fpb,
-                                   result_pool, scratch_pool));
+                                   shim_callbacks, result_pool, scratch_pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/dump_editor.c?rev=1188256&r1=1188255&r2=1188256&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/dump_editor.c (original)
+++ subversion/trunk/subversion/svnrdump/dump_editor.c Mon Oct 24 17:48:06 2011
@@ -856,6 +856,8 @@ svn_rdump__get_dump_editor(const svn_del
 {
   struct dump_edit_baton *eb;
   svn_delta_editor_t *de;
+  svn_delta_shim_callbacks_t *shim_callbacks =
+                                        svn_delta_shim_callbacks_default(pool);
 
   eb = apr_pcalloc(pool, sizeof(struct dump_edit_baton));
   eb->stream = stream;
@@ -892,7 +894,7 @@ svn_rdump__get_dump_editor(const svn_del
                                             de, eb, editor, edit_baton, pool));
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   NULL, NULL, NULL, NULL, pool, pool));
+                                   shim_callbacks, pool, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/svnsync/main.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnsync/main.c?rev=1188256&r1=1188255&r2=1188256&view=diff
==============================================================================
--- subversion/trunk/subversion/svnsync/main.c (original)
+++ subversion/trunk/subversion/svnsync/main.c Mon Oct 24 17:48:06 2011
@@ -1051,6 +1051,8 @@ replay_rev_started(svn_revnum_t revision
   apr_hash_t *filtered;
   int filtered_count;
   int normalized_count;
+  svn_delta_shim_callbacks_t *shim_callbacks =
+                                    svn_delta_shim_callbacks_default(pool);
 
   /* We set this property so that if we error out for some reason
      we can later determine where we were in the process of
@@ -1119,7 +1121,7 @@ replay_rev_started(svn_revnum_t revision
   *edit_baton = cancel_baton;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   NULL, NULL, NULL, NULL, pool, pool));
+                                   shim_callbacks, pool, pool));
 
   return SVN_NO_ERROR;
 }



Mime
View raw message