You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2012/04/23 01:35:15 UTC

svn commit: r1328998 - in /subversion/trunk/subversion: include/private/svn_delta_private.h libsvn_delta/compat.c

Author: gstein
Date: Sun Apr 22 23:35:14 2012
New Revision: 1328998

URL: http://svn.apache.org/viewvc?rev=1328998&view=rev
Log:
Similar to r1231336 (on the ev2-exports branch), make the individual
shim functions non-static, but still private to svn devs.

The branch does not have/use unlock_func (only found in trunk). This
revision also semi-publicizes that typedef.

This introduces a new, private header corresponding to svn_delta.h

* subversion/include/private/svn_delta_private.h:
  (): new header
  (svn_delta__start_edit_func_t, svn_delta__target_revision_func_t,
      svn_delta__unlock_func_t, svn_delta__extra_baton,
      svn_delta__editor_from_delta, svn_delta__delta_from_editor): new

* subversion/libsvn_delta/compat.c:
  (start_edit_func_t, target_revision_func_t, unlock_func_t,
      extra_baton): removed
  (ev2_edit_baton): update extra_baton and unlock_func types
  (delta_from_editor): renamed to ...
  (svn_delta__delta_from_editor): ... this. unlock and extra param
    types have been updated
  (editor_from_delta): renamed to ...
  (svn_delta__editor_from_delta): ... this. unlock and extra param
    types have been updated
  (svn_editor__insert_shims): update extra_baton and unlock_func types

Added:
    subversion/trunk/subversion/include/private/svn_delta_private.h
Modified:
    subversion/trunk/subversion/libsvn_delta/compat.c

Added: subversion/trunk/subversion/include/private/svn_delta_private.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_delta_private.h?rev=1328998&view=auto
==============================================================================
--- subversion/trunk/subversion/include/private/svn_delta_private.h (added)
+++ subversion/trunk/subversion/include/private/svn_delta_private.h Sun Apr 22 23:35:14 2012
@@ -0,0 +1,109 @@
+/**
+ * @copyright
+ * ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
+ * @endcopyright
+ *
+ * @file svn_delta_private.h
+ * @brief The Subversion delta/diff/editor library - Internal routines
+ */
+
+#ifndef SVN_DELTA_PRIVATE_H
+#define SVN_DELTA_PRIVATE_H
+
+#include <apr_pools.h>
+
+#include "svn_types.h"
+#include "svn_error.h"
+#include "svn_delta.h"
+#include "svn_editor.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+typedef svn_error_t *(*svn_delta__start_edit_func_t)(
+  void *baton,
+  svn_revnum_t base_revision);
+
+typedef svn_error_t *(*svn_delta__target_revision_func_t)(
+  void *baton,
+  svn_revnum_t target_revision,
+  apr_pool_t *scratch_pool);
+
+typedef svn_error_t *(*svn_delta__unlock_func_t)(
+  void *baton,
+  const char *path,
+  apr_pool_t *scratch_pool);
+
+
+/* See svn_editor__insert_shims() for more information. */
+struct svn_delta__extra_baton
+{
+  svn_delta__start_edit_func_t start_edit;
+  svn_delta__target_revision_func_t target_revision;
+  void *baton;
+};
+
+
+/** A temporary API to convert from a delta editor to an Ev2 editor. */
+svn_error_t *
+svn_delta__editor_from_delta(svn_editor_t **editor_p,
+                             struct svn_delta__extra_baton **exb,
+                             svn_delta__unlock_func_t *unlock_func,
+                             void **unlock_baton,
+                             const svn_delta_editor_t *deditor,
+                             void *dedit_baton,
+                             svn_boolean_t *send_abs_paths,
+                             const char *repos_root,
+                             const char *base_relpath,
+                             svn_cancel_func_t cancel_func,
+                             void *cancel_baton,
+                             svn_delta_fetch_kind_func_t fetch_kind_func,
+                             void *fetch_kind_baton,
+                             svn_delta_fetch_props_func_t fetch_props_func,
+                             void *fetch_props_baton,
+                             apr_pool_t *result_pool,
+                             apr_pool_t *scratch_pool);
+
+
+/** A temporary API to convert from an Ev2 editor to a delta editor. */
+svn_error_t *
+svn_delta__delta_from_editor(const svn_delta_editor_t **deditor,
+                             void **dedit_baton,
+                             svn_editor_t *editor,
+                             svn_delta__unlock_func_t unlock_func,
+                             void *unlock_baton,
+                             svn_boolean_t *found_abs_paths,
+                             const char *repos_root,
+                             const char *base_relpath,
+                             svn_delta_fetch_props_func_t fetch_props_func,
+                             void *fetch_props_baton,
+                             svn_delta_fetch_base_func_t fetch_base_func,
+                             void *fetch_base_baton,
+                             struct svn_delta__extra_baton *exb,
+                             apr_pool_t *pool);
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* SVN_DELTA_PRIVATE_H */

Modified: subversion/trunk/subversion/libsvn_delta/compat.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/compat.c?rev=1328998&r1=1328997&r2=1328998&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_delta/compat.c (original)
+++ subversion/trunk/subversion/libsvn_delta/compat.c Sun Apr 22 23:35:14 2012
@@ -33,6 +33,8 @@
 
 #include "svn_private_config.h"
 
+#include "private/svn_delta_private.h"
+
 
 struct file_rev_handler_wrapper_baton {
   void *baton;
@@ -106,28 +108,6 @@ svn_compat_wrap_file_rev_handler(svn_fil
  * details.
  */
 
-typedef svn_error_t *(*start_edit_func_t)(
-    void *baton,
-    svn_revnum_t base_revision);
-
-typedef svn_error_t *(*target_revision_func_t)(
-    void *baton,
-    svn_revnum_t target_revision,
-    apr_pool_t *scratch_pool);
-
-typedef svn_error_t *(*unlock_func_t)(
-    void *baton,
-    const char *path,
-    apr_pool_t *scratch_pool);
-
-/* See svn_editor__insert_shims() for more information. */
-struct extra_baton
-{
-  start_edit_func_t start_edit;
-  target_revision_func_t target_revision;
-  void *baton;
-};
-
 struct ev2_edit_baton
 {
   svn_editor_t *editor;
@@ -143,7 +123,7 @@ struct ev2_edit_baton
   const char *base_relpath;
 
   apr_pool_t *edit_pool;
-  struct extra_baton *exb;
+  struct svn_delta__extra_baton *exb;
   svn_boolean_t closed;
 
   svn_boolean_t *found_abs_paths; /* Did we strip an incoming '/' from the
@@ -155,7 +135,7 @@ struct ev2_edit_baton
   svn_delta_fetch_base_func_t fetch_base_func;
   void *fetch_base_baton;
 
-  unlock_func_t do_unlock;
+  svn_delta__unlock_func_t do_unlock;
   void *unlock_baton;
 };
 
@@ -1071,11 +1051,11 @@ ev2_abort_edit(void *edit_baton,
  *         Its callbacks should be invoked at the appropriate time by this
  *         shim.
  */
-static svn_error_t *
-delta_from_editor(const svn_delta_editor_t **deditor,
+svn_error_t *
+svn_delta__delta_from_editor(const svn_delta_editor_t **deditor,
                   void **dedit_baton,
                   svn_editor_t *editor,
-                  unlock_func_t unlock_func,
+                  svn_delta__unlock_func_t unlock_func,
                   void *unlock_baton,
                   svn_boolean_t *found_abs_paths,
                   const char *repos_root,
@@ -1084,7 +1064,7 @@ delta_from_editor(const svn_delta_editor
                   void *fetch_props_baton,
                   svn_delta_fetch_base_func_t fetch_base_func,
                   void *fetch_base_baton,
-                  struct extra_baton *exb,
+                  struct svn_delta__extra_baton *exb,
                   apr_pool_t *pool)
 {
   /* Static 'cause we don't want it to be on the stack. */
@@ -2019,10 +1999,10 @@ do_unlock(void *baton,
  *         will be used by the shim handlers if they need to determine the
  *         existing properties on a path.
  */
-static svn_error_t *
-editor_from_delta(svn_editor_t **editor_p,
-                  struct extra_baton **exb,
-                  unlock_func_t *unlock_func,
+svn_error_t *
+svn_delta__editor_from_delta(svn_editor_t **editor_p,
+                  struct svn_delta__extra_baton **exb,
+                  svn_delta__unlock_func_t *unlock_func,
                   void **unlock_baton,
                   const svn_delta_editor_t *deditor,
                   void *dedit_baton,
@@ -2055,7 +2035,7 @@ editor_from_delta(svn_editor_t **editor_
       abort_cb
     };
   struct editor_baton *eb = apr_pcalloc(result_pool, sizeof(*eb));
-  struct extra_baton *extra_baton = apr_pcalloc(result_pool,
+  struct svn_delta__extra_baton *extra_baton = apr_pcalloc(result_pool,
                                                 sizeof(*extra_baton));
 
   eb->deditor = deditor;
@@ -2133,9 +2113,9 @@ svn_editor__insert_shims(const svn_delta
 
   /* The "extra baton" is a set of functions and a baton which allows the
      shims to communicate additional events to each other.
-     editor_from_delta() returns a pointer to this baton, which
-     delta_from_editor() should then store. */
-  struct extra_baton *exb;
+     svn_delta__editor_from_delta() returns a pointer to this baton, which
+     svn_delta__delta_from_editor() should then store. */
+  struct svn_delta__extra_baton *exb;
 
   /* The reason this is a pointer is that we don't know the appropriate
      value until we start receiving paths.  So process_actions() sets the
@@ -2143,7 +2123,7 @@ svn_editor__insert_shims(const svn_delta
   svn_boolean_t *found_abs_paths = apr_palloc(result_pool,
                                               sizeof(*found_abs_paths));
 
-  unlock_func_t unlock_func;
+  svn_delta__unlock_func_t unlock_func;
   void *unlock_baton;
 
   SVN_ERR_ASSERT(shim_callbacks->fetch_kind_func != NULL);
@@ -2155,7 +2135,8 @@ svn_editor__insert_shims(const svn_delta
   else if (base_relpath[0] == '/')
     base_relpath += 1;
 
-  SVN_ERR(editor_from_delta(&editor, &exb, &unlock_func, &unlock_baton,
+  SVN_ERR(svn_delta__editor_from_delta(&editor, &exb,
+                            &unlock_func, &unlock_baton,
                             deditor_in, dedit_baton_in,
                             found_abs_paths, repos_root, base_relpath,
                             NULL, NULL,
@@ -2164,7 +2145,7 @@ svn_editor__insert_shims(const svn_delta
                             shim_callbacks->fetch_props_func,
                             shim_callbacks->fetch_baton,
                             result_pool, scratch_pool));
-  SVN_ERR(delta_from_editor(deditor_out, dedit_baton_out, editor,
+  SVN_ERR(svn_delta__delta_from_editor(deditor_out, dedit_baton_out, editor,
                             unlock_func, unlock_baton,
                             found_abs_paths,
                             repos_root, base_relpath,



Re: svn commit: r1328998 - in /subversion/trunk/subversion: include/private/svn_delta_private.h libsvn_delta/compat.c

Posted by Greg Stein <gs...@gmail.com>.
Hyrum,

This is effectively your r1231336, but on trunk. The
svn_delta_private.h will obviously merge cleanly, but you may have a
couple conflicts in compat.c. Then some manual clean-out in
svn_delta.h. But after that merge, your branch will be "closer" to
trunk.

There are some whitespace fixes to do in compat.c (which you also
skipped), but I figured it best to wait until after you merge... I'm
not *that* cruel :-P

Cheers,
-g

On Sun, Apr 22, 2012 at 19:35,  <gs...@apache.org> wrote:
> Author: gstein
> Date: Sun Apr 22 23:35:14 2012
> New Revision: 1328998
>
> URL: http://svn.apache.org/viewvc?rev=1328998&view=rev
> Log:
> Similar to r1231336 (on the ev2-exports branch), make the individual
> shim functions non-static, but still private to svn devs.
>
> The branch does not have/use unlock_func (only found in trunk). This
> revision also semi-publicizes that typedef.
>
> This introduces a new, private header corresponding to svn_delta.h
>
> * subversion/include/private/svn_delta_private.h:
>  (): new header
>  (svn_delta__start_edit_func_t, svn_delta__target_revision_func_t,
>      svn_delta__unlock_func_t, svn_delta__extra_baton,
>      svn_delta__editor_from_delta, svn_delta__delta_from_editor): new
>
> * subversion/libsvn_delta/compat.c:
>  (start_edit_func_t, target_revision_func_t, unlock_func_t,
>      extra_baton): removed
>  (ev2_edit_baton): update extra_baton and unlock_func types
>  (delta_from_editor): renamed to ...
>  (svn_delta__delta_from_editor): ... this. unlock and extra param
>    types have been updated
>  (editor_from_delta): renamed to ...
>  (svn_delta__editor_from_delta): ... this. unlock and extra param
>    types have been updated
>  (svn_editor__insert_shims): update extra_baton and unlock_func types
>
> Added:
>    subversion/trunk/subversion/include/private/svn_delta_private.h
> Modified:
>    subversion/trunk/subversion/libsvn_delta/compat.c
>...