subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1640309 - in /subversion/branches/move-tracking-2/subversion: include/private/svn_editor3.h libsvn_delta/compat3.c libsvn_delta/compat3b.c libsvn_delta/editor3.c
Date Tue, 18 Nov 2014 11:09:16 GMT
Author: julianfoad
Date: Tue Nov 18 11:09:15 2014
New Revision: 1640309

URL: http://svn.apache.org/r1640309
Log:
On the 'move-tracking-2' branch: Simplify the editor constructor interface.

* subversion/include/private/svn_editor3.h,
  subversion/libsvn_delta/editor3.c
  (svn_editor3_create): Return the new editor directly. Remove the unused
    scratch pool parameter.
  (svn_editor3__get_debug_editor): Track the changes.

* subversion/libsvn_delta/compat3b.c
  (svn_delta__ev3_from_delta_for_commit2): Track the changes.

* subversion/libsvn_delta/compat3.c
  (svn_delta__ev3_from_delta_for_commit): Track the changes.

Modified:
    subversion/branches/move-tracking-2/subversion/include/private/svn_editor3.h
    subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3.c
    subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3b.c
    subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3.c

Modified: subversion/branches/move-tracking-2/subversion/include/private/svn_editor3.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_editor3.h?rev=1640309&r1=1640308&r2=1640309&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/private/svn_editor3.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/private/svn_editor3.h Tue Nov 18
11:09:15 2014
@@ -1364,23 +1364,18 @@ typedef struct svn_editor3_cb_funcs_t
 
 /** Allocate an #svn_editor3_t instance from @a result_pool, store
  * @a *editor_funcs, @a editor_baton, @a cancel_func and @a cancel_baton
- * in the new instance and return it in @a *editor.
+ * in the new instance and return it.
  *
  * @a cancel_func / @a cancel_baton may be NULL / NULL if not wanted.
  *
- * @a scratch_pool is used for temporary allocations (if any). Note that
- * this is NOT the same @a scratch_pool that is passed to callback functions.
- *
  * @see #svn_editor3_t
  */
-svn_error_t *
-svn_editor3_create(svn_editor3_t **editor,
-                   const svn_editor3_cb_funcs_t *editor_funcs,
+svn_editor3_t *
+svn_editor3_create(const svn_editor3_cb_funcs_t *editor_funcs,
                    void *editor_baton,
                    svn_cancel_func_t cancel_func,
                    void *cancel_baton,
-                   apr_pool_t *result_pool,
-                   apr_pool_t *scratch_pool);
+                   apr_pool_t *result_pool);
 
 /** Return an editor's private baton.
  *

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3.c?rev=1640309&r1=1640308&r2=1640309&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3.c Tue Nov 18 11:09:15
2014
@@ -2507,9 +2507,8 @@ svn_delta__ev3_from_delta_for_commit(
 
   eb->edit_pool = result_pool;
 
-  SVN_ERR(svn_editor3_create(editor_p, &editor_funcs, eb,
-                             cancel_func, cancel_baton,
-                             result_pool, scratch_pool));
+  *editor_p = svn_editor3_create(&editor_funcs, eb,
+                                 cancel_func, cancel_baton, result_pool);
 
   if (shim_connector)
     {

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3b.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3b.c?rev=1640309&r1=1640308&r2=1640309&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3b.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3b.c Tue Nov 18 11:09:15
2014
@@ -1658,9 +1658,8 @@ svn_delta__ev3_from_delta_for_commit2(
 
   eb->edit_pool = result_pool;
 
-  SVN_ERR(svn_editor3_create(editor_p, &editor_funcs, eb,
-                             cancel_func, cancel_baton,
-                             result_pool, scratch_pool));
+  *editor_p = svn_editor3_create(&editor_funcs, eb,
+                                 cancel_func, cancel_baton, result_pool);
 
   /* Find what branch we are editing, based on BASE_RELPATH, and capture
      its initial state.

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3.c?rev=1640309&r1=1640308&r2=1640309&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3.c Tue Nov 18 11:09:15
2014
@@ -86,30 +86,28 @@ struct svn_editor3_t
 #endif /* ENABLE_ORDERING_CHECK */
 
 
-svn_error_t *
-svn_editor3_create(svn_editor3_t **editor,
-                   const svn_editor3_cb_funcs_t *editor_funcs,
+svn_editor3_t *
+svn_editor3_create(const svn_editor3_cb_funcs_t *editor_funcs,
                    void *editor_baton,
                    svn_cancel_func_t cancel_func,
                    void *cancel_baton,
-                   apr_pool_t *result_pool,
-                   apr_pool_t *scratch_pool)
+                   apr_pool_t *result_pool)
 {
-  *editor = apr_pcalloc(result_pool, sizeof(**editor));
+  svn_editor3_t *editor = apr_pcalloc(result_pool, sizeof(*editor));
 
-  (*editor)->funcs = *editor_funcs;
-  (*editor)->baton = editor_baton;
-  (*editor)->cancel_func = cancel_func;
-  (*editor)->cancel_baton = cancel_baton;
-  (*editor)->scratch_pool = svn_pool_create(result_pool);
+  editor->funcs = *editor_funcs;
+  editor->baton = editor_baton;
+  editor->cancel_func = cancel_func;
+  editor->cancel_baton = cancel_baton;
+  editor->scratch_pool = svn_pool_create(result_pool);
 
 #ifdef ENABLE_ORDERING_CHECK
-  (*editor)->within_callback = FALSE;
-  (*editor)->finished = FALSE;
-  (*editor)->state_pool = result_pool;
+  editor->within_callback = FALSE;
+  editor->finished = FALSE;
+  editor->state_pool = result_pool;
 #endif
 
-  return SVN_NO_ERROR;
+  return editor;
 }
 
 
@@ -938,7 +936,6 @@ svn_editor3__get_debug_editor(svn_editor
                               svn_editor3_t *wrapped_editor,
                               apr_pool_t *result_pool)
 {
-  apr_pool_t *scratch_pool = result_pool;
   static const svn_editor3_cb_funcs_t wrapper_funcs = {
     wrap_mk,
     wrap_cp,
@@ -973,9 +970,9 @@ svn_editor3__get_debug_editor(svn_editor
     eb->prefix = apr_pstrdup(result_pool, "DBG: ");
   }
 
-  SVN_ERR(svn_editor3_create(editor_p, &wrapper_funcs, eb,
-                             NULL, NULL, /* cancellation */
-                             result_pool, scratch_pool));
+  *editor_p = svn_editor3_create(&wrapper_funcs, eb,
+                                 NULL, NULL, /* cancellation */
+                                 result_pool);
 
   return SVN_NO_ERROR;
 }



Mime
View raw message