You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2015/05/26 15:45:49 UTC

svn commit: r1681755 - in /subversion/branches/move-tracking-2/subversion: include/private/ libsvn_delta/

Author: julianfoad
Date: Tue May 26 13:45:48 2015
New Revision: 1681755

URL: http://svn.apache.org/r1681755
Log:
On the 'move-tracking-2' branch: Separate editor3p from editor3e a bit more
completely.

* subversion/include/private/svn_editor3e.h
  (svn_editor3_txn_path_t,
   svn_editor3_txn_path_dup): Move from editor3e to editor3p, as that is
    where it is used.

* subversion/include/private/svn_editor3p.h
  No longer include "svn_editor3e.h". Include "svn_element.h".
  (svn_editor3_txn_path_t,
   svn_editor3_txn_path_dup): Move to here.
  (svn_editor3p__shim_fetch_func_t): New, copied unchanged from
    svn_editor3__shim_fetch_func_t.
  (...elsewhere...): Use svn_editor3p__shim_fetch_func_t instead of
    svn_editor3__shim_fetch_func_t.

* subversion/include/private/svn_ra_private.h,
  Include "svn_editor3e.h".

* subversion/libsvn_delta/compat3e.c
  Include "svn_editor3e.h". Use svn_editor3p__shim_fetch_func_t instead of
  svn_editor3__shim_fetch_func_t throughout.

* subversion/libsvn_delta/editor3e.c
  (svn_editor3_txn_path_dup): Move ...

* subversion/libsvn_delta/editor3p.c
  (svn_editor3_txn_path_dup): ... to here.

Modified:
    subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h
    subversion/branches/move-tracking-2/subversion/include/private/svn_editor3p.h
    subversion/branches/move-tracking-2/subversion/include/private/svn_ra_private.h
    subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c
    subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3p.c
    subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3e.c
    subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3p.c

Modified: subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h?rev=1681755&r1=1681754&r2=1681755&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h Tue May 26 13:45:48 2015
@@ -512,24 +512,6 @@ extern "C" {
  */
 typedef struct svn_editor3_t svn_editor3_t;
 
-/** A reference to a node in a txn.
- *
- * @a peg gives a pegged location and @a peg.rev shall not be
- * #SVN_INVALID_REVNUM. @a relpath shall not be null. If @a relpath is
- * empty then @a peg identifies the node, otherwise @a relpath specifies
- * the one or more components that are newly created (includes children
- * of a copy). */
-typedef struct svn_editor3_txn_path_t
-{
-  svn_pathrev_t peg;
-  const char *relpath;
-} svn_editor3_txn_path_t;
-
-/* Return a duplicate of OLD, allocated in RESULT_POOL. */
-svn_editor3_txn_path_t
-svn_editor3_txn_path_dup(svn_editor3_txn_path_t old,
-                         apr_pool_t *result_pool);
-
 /** The kind of the checksum to be used throughout the #svn_editor3_t APIs.
  */
 #define SVN_EDITOR3_CHECKSUM_KIND svn_checksum_sha1

Modified: subversion/branches/move-tracking-2/subversion/include/private/svn_editor3p.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_editor3p.h?rev=1681755&r1=1681754&r2=1681755&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/private/svn_editor3p.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/private/svn_editor3p.h Tue May 26 13:45:48 2015
@@ -35,13 +35,32 @@
 #include "svn_error.h"
 #include "svn_delta.h"
 
-#include "private/svn_editor3e.h"
+#include "private/svn_element.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
 
+/** A reference to a node in a txn.
+ *
+ * @a peg gives a pegged location and @a peg.rev shall not be
+ * #SVN_INVALID_REVNUM. @a relpath shall not be null. If @a relpath is
+ * empty then @a peg identifies the node, otherwise @a relpath specifies
+ * the one or more components that are newly created (includes children
+ * of a copy). */
+typedef struct svn_editor3_txn_path_t
+{
+  svn_pathrev_t peg;
+  const char *relpath;
+} svn_editor3_txn_path_t;
+
+/* Return a duplicate of OLD, allocated in RESULT_POOL. */
+svn_editor3_txn_path_t
+svn_editor3_txn_path_dup(svn_editor3_txn_path_t old,
+                         apr_pool_t *result_pool);
+
+
 /*
  * TODO:
  *
@@ -536,6 +555,43 @@ svn_editor3p__get_debug_editor(svn_edito
 #endif
 
 
+/** Callback to retrieve a node's kind and content.  This is
+ * needed by the various editor shims in order to effect backwards
+ * compatibility.
+ *
+ * Implementations should set @a *kind to the node kind of @a repos_relpath
+ * in @a revision.
+ *
+ * Implementations should set @a *props to the hash of properties
+ * associated with @a repos_relpath in @a revision, allocating that hash
+ * and its contents in @a result_pool. Only the 'regular' props should be
+ * included, not special props such as 'entry props'.
+ *
+ * Implementations should set @a *filename to the name of a file
+ * suitable for use as a delta base for @a repos_relpath in @a revision
+ * (allocating @a *filename from @a result_pool), or to @c NULL if the
+ * base stream is empty.
+ *
+ * Any output argument may be NULL if the output is not wanted.
+ *
+ * @a baton is an implementation-specific closure.
+ * @a repos_relpath is relative to the repository root.
+ * The implementation should ensure that @a new_content, including any
+ * file therein, lives at least for the life time of @a result_pool.
+ * @a scratch_pool is provided for temporary allocations.
+ */
+typedef svn_error_t *(*svn_editor3p__shim_fetch_func_t)(
+  svn_node_kind_t *kind,
+  apr_hash_t **props,
+  svn_stringbuf_t **file_text,
+  apr_hash_t **children_names,
+  void *baton,
+  const char *repos_relpath,
+  svn_revnum_t revision,
+  apr_pool_t *result_pool,
+  apr_pool_t *scratch_pool
+  );
+
 /* An object for communicating out-of-band details between an Ev1-to-Ev3
  * shim and an Ev3-to-Ev1 shim. */
 typedef struct svn_editor3p__shim_connector_t svn_editor3p__shim_connector_t;
@@ -553,7 +609,7 @@ svn_delta__ev3_from_delta_for_commit(
                         void *dedit_baton,
                         const char *repos_root_url,
                         const char *base_relpath,
-                        svn_editor3__shim_fetch_func_t fetch_func,
+                        svn_editor3p__shim_fetch_func_t fetch_func,
                         void *fetch_baton,
                         svn_cancel_func_t cancel_func,
                         void *cancel_baton,
@@ -584,7 +640,7 @@ svn_delta__delta_from_ev3_for_commit(
                         svn_editor3p_t *editor,
                         const char *repos_root_url,
                         const char *base_relpath,
-                        svn_editor3__shim_fetch_func_t fetch_func,
+                        svn_editor3p__shim_fetch_func_t fetch_func,
                         void *fetch_baton,
                         const svn_editor3p__shim_connector_t *shim_connector,
                         apr_pool_t *result_pool,
@@ -608,7 +664,7 @@ svn_editor3p__insert_shims(
                         void *old_dedit_baton,
                         const char *repos_root,
                         const char *base_relpath,
-                        svn_editor3__shim_fetch_func_t fetch_func,
+                        svn_editor3p__shim_fetch_func_t fetch_func,
                         void *fetch_baton,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool);
@@ -646,7 +702,7 @@ svn_delta__ev3_from_delta_for_update(
                         void *dedit_baton,
                         const char *repos_root_url,
                         const char *base_repos_relpath,
-                        svn_editor3__shim_fetch_func_t fetch_func,
+                        svn_editor3p__shim_fetch_func_t fetch_func,
                         void *fetch_baton,
                         svn_cancel_func_t cancel_func,
                         void *cancel_baton,
@@ -662,7 +718,7 @@ svn_delta__delta_from_ev3_for_update(
                         svn_update_editor3_t *update_editor,
                         const char *repos_root_url,
                         const char *base_repos_relpath,
-                        svn_editor3__shim_fetch_func_t fetch_func,
+                        svn_editor3p__shim_fetch_func_t fetch_func,
                         void *fetch_baton,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool);

Modified: subversion/branches/move-tracking-2/subversion/include/private/svn_ra_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_ra_private.h?rev=1681755&r1=1681754&r2=1681755&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/private/svn_ra_private.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/private/svn_ra_private.h Tue May 26 13:45:48 2015
@@ -35,6 +35,7 @@
 #include "svn_editor.h"
 #include "svn_io.h"
 #include "private/svn_editor3p.h"
+#include "private/svn_editor3e.h"
 
 #ifdef __cplusplus
 extern "C" {

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c?rev=1681755&r1=1681754&r2=1681755&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c Tue May 26 13:45:48 2015
@@ -32,6 +32,7 @@
 #include "svn_pools.h"
 
 #include "private/svn_delta_private.h"
+#include "private/svn_editor3e.h"
 #include "../libsvn_delta/debug_editor.h"
 #include "svn_private_config.h"
 

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3p.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3p.c?rev=1681755&r1=1681754&r2=1681755&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3p.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3p.c Tue May 26 13:45:48 2015
@@ -117,7 +117,7 @@ svn_editor3p__insert_shims(
                         void *old_dedit_baton,
                         const char *repos_root,
                         const char *base_relpath,
-                        svn_editor3__shim_fetch_func_t fetch_func,
+                        svn_editor3p__shim_fetch_func_t fetch_func,
                         void *fetch_baton,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool)
@@ -630,7 +630,7 @@ struct ev3_edit_baton
 
   const svn_editor3p__shim_connector_t *shim_connector;
 
-  svn_editor3__shim_fetch_func_t fetch_func;
+  svn_editor3p__shim_fetch_func_t fetch_func;
   void *fetch_baton;
 
   svn_boolean_t closed;
@@ -1518,7 +1518,7 @@ svn_delta__delta_from_ev3_for_commit(
                         svn_editor3p_t *editor,
                         const char *repos_root_url,
                         const char *base_relpath,
-                        svn_editor3__shim_fetch_func_t fetch_func,
+                        svn_editor3p__shim_fetch_func_t fetch_func,
                         void *fetch_baton,
                         const svn_editor3p__shim_connector_t *shim_connector,
                         apr_pool_t *result_pool,
@@ -1579,7 +1579,7 @@ svn_delta__delta_from_ev3_for_update(
                         svn_update_editor3_t *update_editor,
                         const char *repos_root_url,
                         const char *base_repos_relpath,
-                        svn_editor3__shim_fetch_func_t fetch_func,
+                        svn_editor3p__shim_fetch_func_t fetch_func,
                         void *fetch_baton,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool)
@@ -1712,7 +1712,7 @@ typedef struct ev3_from_delta_baton_t
   void *dedit_baton;
 
   /* Callbacks */
-  svn_editor3__shim_fetch_func_t fetch_func;
+  svn_editor3p__shim_fetch_func_t fetch_func;
   void *fetch_baton;
 
   /* The Ev1 root directory baton if we have opened the root, else null. */
@@ -1832,7 +1832,7 @@ static svn_error_t *
 fetch_base_props(apr_hash_t **base_props,
                  apr_hash_t *changes,
                  const char *repos_relpath,
-                 svn_editor3__shim_fetch_func_t fetch_func,
+                 svn_editor3p__shim_fetch_func_t fetch_func,
                  void *fetch_baton,
                  apr_pool_t *result_pool,
                  apr_pool_t *scratch_pool)
@@ -2475,7 +2475,7 @@ svn_delta__ev3_from_delta_for_commit(
                         void *dedit_baton,
                         const char *repos_root_url,
                         const char *base_relpath,
-                        svn_editor3__shim_fetch_func_t fetch_func,
+                        svn_editor3p__shim_fetch_func_t fetch_func,
                         void *fetch_baton,
                         svn_cancel_func_t cancel_func,
                         void *cancel_baton,
@@ -2537,7 +2537,7 @@ svn_delta__ev3_from_delta_for_update(
                         void *dedit_baton,
                         const char *repos_root_url,
                         const char *base_repos_relpath,
-                        svn_editor3__shim_fetch_func_t fetch_func,
+                        svn_editor3p__shim_fetch_func_t fetch_func,
                         void *fetch_baton,
                         svn_cancel_func_t cancel_func,
                         void *cancel_baton,

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3e.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3e.c?rev=1681755&r1=1681754&r2=1681755&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3e.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3e.c Tue May 26 13:45:48 2015
@@ -360,23 +360,6 @@ svn_editor3_abort(svn_editor3_t *editor)
 }
 
 
-/*
- * ===================================================================
- * Minor data types
- * ===================================================================
- */
-
-svn_editor3_txn_path_t
-svn_editor3_txn_path_dup(svn_editor3_txn_path_t p,
-                         apr_pool_t *result_pool)
-{
-  /* The object P is passed by value so we can modify it in place */
-  p.peg = svn_pathrev_dup(p.peg, result_pool);
-  p.relpath = apr_pstrdup(result_pool, p.relpath);
-  return p;
-}
-
-
 #ifdef SVN_DEBUG
 
 /*

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3p.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3p.c?rev=1681755&r1=1681754&r2=1681755&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3p.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3p.c Tue May 26 13:45:48 2015
@@ -39,6 +39,27 @@
 #endif
 
 
+/*
+ * ===================================================================
+ * Minor data types
+ * ===================================================================
+ */
+
+svn_editor3_txn_path_t
+svn_editor3_txn_path_dup(svn_editor3_txn_path_t p,
+                         apr_pool_t *result_pool)
+{
+  /* The object P is passed by value so we can modify it in place */
+  p.peg = svn_pathrev_dup(p.peg, result_pool);
+  p.relpath = apr_pstrdup(result_pool, p.relpath);
+  return p;
+}
+
+
+/*
+ * ===================================================================
+ */
+
 struct svn_editor3p_t
 {
   void *baton;