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 02:59:46 UTC

svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Author: gstein
Date: Mon Apr 23 00:59:46 2012
New Revision: 1329015

URL: http://svn.apache.org/viewvc?rev=1329015&view=rev
Log:
Provide a first pass at (private) APIs to fetch an EV2-based commit
editor from the RA layers. Some of this is based on Hyrum's work on
the ev2-exports branch (see editor.c below).

If an RA layer supports this new API, then it is used. Otherwise, an
Ev2 shim is inserted over its Ev1-based commit editor and returned.

* subversion/include/private/svn_ra_private.h:
  (svn_ra__provide_base_cb_t, svn_ra__provide_props_cb_t,
      svn_ra__get_copysrc_kind_cb_t): new callbacks required for
    Ev2-based commit editors. the first two enable deltified contents
    and properties over the wire, and the latter is required for RA
    layers that only provide an Ev1-based commit editor.

* subversion/libsvn_ra/ra_loader.h:
  (struct svn_ra__vtable_t): add new GET_COMMIT_EV2 entry
  (svn_ra__use_commit_shim): new helper function declaration

* subversion/libsvn_ra/ra_loader.c:
  (remap_commit_callback): new helper function for filling in a
    commit_info structure's REPOS_ROOT entry. factored out of
    svn_ra_get_commit_editor3().
  (svn_ra_get_commit_editor3): use remap_commit_callback()
  (svn_ra__get_commit_ev2): new function. uses an RA layer's Ev2
    commit editor, if available; otherwise, it sets up a shim.

* subversion/libsvn_ra/editor.c:
  (struct fp_baton): new baton for the fetch_props() helper
  (fetch_props): helper function to map from the shim's fetch_props
    callback to the RA layer's provide_props callback.
  (svn_ra__use_commit_shim): new function to wire up the Ev2/Ev1
    compatibility shim over an RA layer's Ev1-based commit editor.
    this function is similar to the svn_ra_get_commit_editor4()
    function on the ev2-exports branch (in ra_loader.c) with some
    additional commentary and setup.

Added:
    subversion/trunk/subversion/libsvn_ra/editor.c
Modified:
    subversion/trunk/subversion/include/private/svn_ra_private.h
    subversion/trunk/subversion/libsvn_ra/ra_loader.c
    subversion/trunk/subversion/libsvn_ra/ra_loader.h

Modified: subversion/trunk/subversion/include/private/svn_ra_private.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_ra_private.h?rev=1329015&r1=1329014&r2=1329015&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_ra_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_ra_private.h Mon Apr 23 00:59:46 2012
@@ -32,6 +32,8 @@
 #include "svn_error.h"
 #include "svn_ra.h"
 #include "svn_delta.h"
+#include "svn_editor.h"
+#include "svn_io.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -132,6 +134,62 @@ svn_error_t *
 svn_ra__register_editor_shim_callbacks(svn_ra_session_t *ra_session,
                                        svn_delta_shim_callbacks_t *callbacks);
 
+
+/* Using information from BATON, provide the (file's) pristine contents
+   for REPOS_RELPATH. They are returned in *CONTENTS, and correspond to
+   *REVISION. These are allocated in RESULT_POOL. SCRATCH_POOL can be used
+   for temporary allocations.  */
+typedef svn_error_t *(*svn_ra__provide_base_cb_t)(
+  svn_stream_t **contents,
+  svn_revnum_t *revision,
+  void *baton,
+  const char *repos_relpath,
+  apr_pool_t *result_pool,
+  apr_pool_t *scratch_pool);
+
+/* Using information from BATON, provide the pristine properties for
+   REPOS_RELPATH. They are returned in *PROPS, and correspond to *REVISION.
+   The properties are allocated in RESULT_POOL. SCRATCH_POOL can be used
+   for temporary allocations.  */
+typedef svn_error_t *(*svn_ra__provide_props_cb_t)(
+  apr_hash_t **props,
+  svn_revnum_t *revision,
+  void *baton,
+  const char *repos_relpath,
+  apr_pool_t *result_pool,
+  apr_pool_t *scratch_pool);
+
+/* Using information from BATON, fetch the kind of REPOS_RELPATH at revision
+   SRC_REVISION, returning it in *KIND. Temporary allocations can be made
+   in SCRATCH_POOL.  */
+typedef svn_error_t *(*svn_ra__get_copysrc_kind_cb_t)(
+  svn_kind_t *kind,
+  void *baton,
+  const char *repos_relpath,
+  svn_revnum_t src_revision,
+  apr_pool_t *scratch_pool);
+
+
+/* ### hand-wave... see svn_ra_get_commit_editor3() for the basics
+   ### of these parameters.  */
+svn_error_t *
+svn_ra__get_commit_ev2(svn_editor_t **editor,
+                       svn_ra_session_t *session,
+                       apr_hash_t *revprop_table,
+                       svn_commit_callback2_t callback,
+                       void *callback_baton,
+                       apr_hash_t *lock_tokens,
+                       svn_boolean_t keep_locks,
+                       svn_ra__provide_base_cb_t provide_base_cb,
+                       svn_ra__provide_props_cb_t provide_props_cb,
+                       svn_ra__get_copysrc_kind_cb_t get_copysrc_kind_cb,
+                       void *cb_baton,
+                       svn_cancel_func_t cancel_func,
+                       void *cancel_baton,
+                       apr_pool_t *result_pool,
+                       apr_pool_t *scratch_pool);
+
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Added: subversion/trunk/subversion/libsvn_ra/editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/editor.c?rev=1329015&view=auto
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/editor.c (added)
+++ subversion/trunk/subversion/libsvn_ra/editor.c Mon Apr 23 00:59:46 2012
@@ -0,0 +1,175 @@
+/*
+ * editor.c:  compatibility editors
+ *
+ * ====================================================================
+ *    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.
+ * ====================================================================
+ */
+
+#include <apr_pools.h>
+
+#include "svn_error.h"
+#include "svn_pools.h"
+#include "svn_ra.h"
+#include "svn_delta.h"
+#include "svn_editor.h"
+#include "svn_dirent_uri.h"
+
+#include "private/svn_ra_private.h"
+#include "private/svn_delta_private.h"
+
+#include "ra_loader.h"
+#include "svn_private_config.h"
+
+
+struct fp_baton {
+  svn_ra__provide_props_cb_t provide_props_cb;
+  void *cb_baton;
+};
+
+/* The shims currently want a callback that provides props for a given
+   REPOS_RELPATH at a given BASE_REVISION. However, the RA Ev2 interface
+   has a callback that provides properties for the REPOS_RELPATH from any
+   revision, which is returned along with the properties.
+
+   This is a little shim to map between the prototypes. The base revision
+   for the properties is discarded, and the requested revision (from the
+   shim code) is ignored.
+
+   The shim code needs to be updated to allow for an RA-style callback
+   to fetch properties.  */
+static svn_error_t *
+fetch_props(apr_hash_t **props,
+            void *baton,
+            const char *repos_relpath,
+            svn_revnum_t base_revision,
+            apr_pool_t *result_pool,
+            apr_pool_t *scratch_pool)
+{
+  struct fp_baton *fpb = baton;
+  svn_revnum_t unused_revision;
+
+  /* Ignored: BASE_REVISION.  */
+
+  return svn_error_trace(fpb->provide_props_cb(props, &unused_revision,
+                                               fpb->cb_baton,
+                                               repos_relpath,
+                                               result_pool, scratch_pool));
+}
+
+
+svn_error_t *
+svn_ra__use_commit_shim(svn_editor_t **editor,
+                        svn_ra_session_t *session,
+                        apr_hash_t *revprop_table,
+                        svn_commit_callback2_t callback,
+                        void *callback_baton,
+                        apr_hash_t *lock_tokens,
+                        svn_boolean_t keep_locks,
+                        svn_ra__provide_base_cb_t provide_base_cb,
+                        svn_ra__provide_props_cb_t provide_props_cb,
+                        svn_ra__get_copysrc_kind_cb_t get_copysrc_kind_cb,
+                        void *cb_baton,
+                        svn_cancel_func_t cancel_func,
+                        void *cancel_baton,
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool)
+{
+  const svn_delta_editor_t *deditor;
+  void *dedit_baton;
+  struct svn_delta__extra_baton *exb;
+  svn_delta__unlock_func_t unlock_func;
+  void *unlock_baton;
+  const char *repos_root;
+  const char *session_url;
+  const char *base_relpath;
+  svn_boolean_t *found_abs_paths;
+  struct fp_baton *fpb;
+
+  /* NOTE: PROVIDE_BASE_CB is currently unused by this shim. In the future,
+     we can pass it to the underlying Ev2/Ev1 shim to produce better
+     apply_txdelta drives (ie. against a base rather than <empty>).  */
+
+  /* Fetch the RA provider's Ev1 commit editor.  */
+  SVN_ERR(session->vtable->get_commit_editor(session, &deditor, &dedit_baton,
+                                             revprop_table,
+                                             callback, callback_baton,
+                                             lock_tokens, keep_locks,
+                                             result_pool));
+
+  /* Get or calculate the appropriate repos root and base relpath. */
+  SVN_ERR(svn_ra_get_repos_root2(session, &repos_root, scratch_pool));
+  SVN_ERR(svn_ra_get_session_url(session, &session_url, scratch_pool));
+  base_relpath = svn_uri_skip_ancestor(repos_root, session_url, scratch_pool);
+
+  /* We will assume that when the underlying Ev1 editor is finally driven
+     by the shim, that we will not need to prepend "/" to the paths. Place
+     this on the heap because it is examined much later. Set to FALSE.  */
+  found_abs_paths = apr_pcalloc(result_pool, sizeof(*found_abs_paths));
+
+  /* The PROVIDE_PROPS_CB callback does not match what the shims want.
+     Let's jigger things around a little bit here.  */
+  fpb = apr_palloc(result_pool, sizeof(*fpb));
+  fpb->provide_props_cb = provide_props_cb;
+  fpb->cb_baton = cb_baton;
+
+  /* Create the Ev2 editor from the Ev1 editor provided by the RA layer.
+
+     Note: GET_COPYSRC_KIND_CB is compatible in type/semantics with the
+     shim's FETCH_KIND_FUNC parameter.  */
+  SVN_ERR(svn_delta__editor_from_delta(editor, &exb,
+                                       &unlock_func, &unlock_baton,
+                                       deditor, dedit_baton,
+                                       found_abs_paths,
+                                       repos_root, base_relpath,
+                                       cancel_func, cancel_baton,
+                                       get_copysrc_kind_cb, cb_baton,
+                                       fetch_props, fpb,
+                                       result_pool, scratch_pool));
+
+  /* Note: UNLOCK_FUNC and UNLOCK_BATON are unused during commit drives.
+     We can safely drop them on the floor.  */
+
+  /* Since we're (currently) just wrapping an existing Ev1 editor, we have
+     to call any start_edit handler it may provide (the shim uses this to
+     invoke Ev1's open_root callback).  We've got a couple of options to do
+     so: Implement a wrapper editor and call the start_edit callback upon
+     the first invocation of any of the underlying editor's functions; or,
+     just assume our consumer is going to eventually use the editor it is
+     asking for, and call the start edit callback now.  For simplicity's
+     sake, we do the latter.  */
+  if (exb->start_edit)
+    {
+      /* Most commit drives pass SVN_INVALID_REVNUM for the revision.
+         All calls to svn_delta_path_driver() pass SVN_INVALID_REVNUM,
+         so this is fine for any commits done via that function.
+
+         Notably, the PROPSET command passes a specific revision. Before
+         PROPSET can use the RA Ev2 interface, we may need to make this
+         revision a parameter.
+         ### what are the exact semantics? what is the meaning of the
+         ### revision passed to the Ev1->open_root() callback?  */
+      SVN_ERR(exb->start_edit(exb->baton, SVN_INVALID_REVNUM));
+    }
+
+  /* Note: EXB also contains a TARGET_REVISION function, but that is not
+     used during commit operations. We can safely ignore it. (ie. it is
+     in EXB for use by paired-shims)  */
+
+  return SVN_NO_ERROR;
+}

Modified: subversion/trunk/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/ra_loader.c?rev=1329015&r1=1329014&r2=1329015&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/trunk/subversion/libsvn_ra/ra_loader.c Mon Apr 23 00:59:46 2012
@@ -706,6 +706,39 @@ commit_callback_wrapper(const svn_commit
   return ccwb->original_callback(ci, ccwb->original_baton, pool);
 }
 
+
+/* Some RA layers do not correctly fill in REPOS_ROOT in commit_info, or
+   they are third-party layers conforming to an older commit_info structure.
+   Interpose a utility function to ensure the field is valid.  */
+static void
+remap_commit_callback(svn_commit_callback2_t *callback,
+                      void **callback_baton,
+                      svn_ra_session_t *session,
+                      svn_commit_callback2_t original_callback,
+                      void *original_baton,
+                      apr_pool_t *result_pool)
+{
+  if (original_callback == NULL)
+    {
+      *callback = NULL;
+      *callback_baton = NULL;
+    }
+  else
+    {
+      /* Allocate this in RESULT_POOL, since the callback will be called
+         long after this function has returned. */
+      struct ccw_baton *ccwb = apr_palloc(result_pool, sizeof(*ccwb));
+
+      ccwb->session = session;
+      ccwb->original_callback = original_callback;
+      ccwb->original_baton = original_baton;
+
+      *callback = commit_callback_wrapper;
+      *callback_baton = ccwb;
+    }
+}
+
+
 svn_error_t *svn_ra_get_commit_editor3(svn_ra_session_t *session,
                                        const svn_delta_editor_t **editor,
                                        void **edit_baton,
@@ -716,20 +749,13 @@ svn_error_t *svn_ra_get_commit_editor3(s
                                        svn_boolean_t keep_locks,
                                        apr_pool_t *pool)
 {
-  /* Allocate this in a pool, since the callback will be called long after
-     this function as returned. */
-  struct ccw_baton *ccwb = apr_palloc(pool, sizeof(*ccwb));
-
-  ccwb->original_callback = callback;
-  ccwb->original_baton = callback_baton;
-  ccwb->session = session;
+  remap_commit_callback(&callback, &callback_baton,
+                        session, callback, callback_baton,
+                        pool);
 
   return session->vtable->get_commit_editor(session, editor, edit_baton,
                                             revprop_table,
-                                            callback
-                                                ? commit_callback_wrapper
-                                                : NULL,
-                                            callback ? ccwb : NULL,
+                                            callback, callback_baton,
                                             lock_tokens, keep_locks, pool);
 }
 
@@ -1241,6 +1267,67 @@ svn_ra_get_deleted_rev(svn_ra_session_t 
   return err;
 }
 
+
+svn_error_t *
+svn_ra__get_commit_ev2(svn_editor_t **editor,
+                       svn_ra_session_t *session,
+                       apr_hash_t *revprop_table,
+                       svn_commit_callback2_t callback,
+                       void *callback_baton,
+                       apr_hash_t *lock_tokens,
+                       svn_boolean_t keep_locks,
+                       svn_ra__provide_base_cb_t provide_base_cb,
+                       svn_ra__provide_props_cb_t provide_props_cb,
+                       svn_ra__get_copysrc_kind_cb_t get_copysrc_kind_cb,
+                       void *cb_baton,
+                       svn_cancel_func_t cancel_func,
+                       void *cancel_baton,
+                       apr_pool_t *result_pool,
+                       apr_pool_t *scratch_pool)
+{
+  if (session->vtable->get_commit_ev2 == NULL)
+    {
+      /* The specific RA layer does not have an implementation. Use our
+         default shim over the normal commit editor.  */
+
+      /* Remap for RA layers exposing Ev1.  */
+      remap_commit_callback(&callback, &callback_baton,
+                            session, callback, callback_baton,
+                            result_pool);
+
+      return svn_error_trace(svn_ra__use_commit_shim(
+                               editor,
+                               session,
+                               revprop_table,
+                               callback, callback_baton,
+                               lock_tokens,
+                               keep_locks,
+                               provide_base_cb,
+                               provide_props_cb,
+                               get_copysrc_kind_cb,
+                               cb_baton,
+                               cancel_func, cancel_baton,
+                               result_pool, scratch_pool));
+    }
+
+  /* Note: no need to remap the callback for Ev2. RA layers providing this
+     vtable entry should completely fill in commit_info.  */
+
+  return svn_error_trace(session->vtable->get_commit_ev2(
+                           editor,
+                           session,
+                           revprop_table,
+                           callback, callback_baton,
+                           lock_tokens,
+                           keep_locks,
+                           provide_base_cb,
+                           provide_props_cb,
+                           get_copysrc_kind_cb,
+                           cb_baton,
+                           cancel_func, cancel_baton,
+                           result_pool, scratch_pool));
+}
+
 
 
 svn_error_t *

Modified: subversion/trunk/subversion/libsvn_ra/ra_loader.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/ra_loader.h?rev=1329015&r1=1329014&r2=1329015&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/ra_loader.h (original)
+++ subversion/trunk/subversion/libsvn_ra/ra_loader.h Mon Apr 23 00:59:46 2012
@@ -32,6 +32,8 @@
 
 #include "svn_ra.h"
 
+#include "private/svn_ra_private.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -293,9 +295,29 @@ typedef struct svn_ra__vtable_t {
                                   svn_revnum_t end_revision,
                                   svn_revnum_t *revision_deleted,
                                   apr_pool_t *pool);
+
+  /* See svn_ra__register_editor_shim_callbacks() */
   svn_error_t *(*register_editor_shim_callbacks)(svn_ra_session_t *session,
                                     svn_delta_shim_callbacks_t *callbacks);
 
+  /* See svn_ra__get_commit_ev2()  */
+  svn_error_t *(*get_commit_ev2)(
+    svn_editor_t **editor,
+    svn_ra_session_t *session,
+    apr_hash_t *revprop_table,
+    svn_commit_callback2_t callback,
+    void *callback_baton,
+    apr_hash_t *lock_tokens,
+    svn_boolean_t keep_locks,
+    svn_ra__provide_base_cb_t provide_base_cb,
+    svn_ra__provide_props_cb_t provide_props_cb,
+    svn_ra__get_copysrc_kind_cb_t get_copysrc_kind_cb,
+    void *cb_baton,
+    svn_cancel_func_t cancel_func,
+    void *cancel_baton,
+    apr_pool_t *result_pool,
+    apr_pool_t *scratch_pool);
+
 } svn_ra__vtable_t;
 
 /* The RA session object. */
@@ -453,6 +475,29 @@ svn_ra__get_deleted_rev_from_log(svn_ra_
                                  svn_revnum_t *revision_deleted,
                                  apr_pool_t *pool);
 
+
+/* Utility function to provide a shim between a returned Ev2 and an RA
+   provider's Ev1-based commit editor.
+
+   See svn_ra__get_commit_ev2() for parameter semantics.  */
+svn_error_t *
+svn_ra__use_commit_shim(svn_editor_t **editor,
+                        svn_ra_session_t *session,
+                        apr_hash_t *revprop_table,
+                        svn_commit_callback2_t callback,
+                        void *callback_baton,
+                        apr_hash_t *lock_tokens,
+                        svn_boolean_t keep_locks,
+                        svn_ra__provide_base_cb_t provide_base_cb,
+                        svn_ra__provide_props_cb_t provide_props_cb,
+                        svn_ra__get_copysrc_kind_cb_t get_copysrc_kind_cb,
+                        void *cb_baton,
+                        svn_cancel_func_t cancel_func,
+                        void *cancel_baton,
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool);
+
+
 #ifdef __cplusplus
 }
 #endif



Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Greg Stein <gs...@gmail.com>.
On Apr 24, 2012 12:29 PM, "Daniel Shahaf" <da...@elego.de> wrote:
>
> Greg Stein wrote on Tue, Apr 24, 2012 at 12:20:26 -0400:
> > On Apr 24, 2012 10:08 AM, "Daniel Shahaf" <da...@elego.de> wrote:
> > >
> > > Greg Stein wrote on Mon, Apr 23, 2012 at 22:47:43 -0400:
> > > > On Apr 23, 2012 7:20 PM, "Hyrum K Wright" <hyrum.wright@wandisco.com
>
> > wrote:
> > > > >
> > > > > On Mon, Apr 23, 2012 at 4:55 PM, Greg Stein <gs...@gmail.com>
wrote:
> > > > > > On Mon, Apr 23, 2012 at 16:21, Hyrum K Wright <
> > hyrum.wright@wandisco.com>
> > > > wrote:
> > > > > >> On Mon, Apr 23, 2012 at 12:52 PM, Greg Stein <gs...@gmail.com>
> > wrote:
> > > > > >>...
> > > > > >>> Alright. It sounds like svn_ra.h has two purposes: stuff for
> > > > libsvn_client,
> > > > > >>> and stuff for all RA layers to use internally. Ugh.
> > > > > >>
> > > > > >> But the capability strings are part of the public API.
> > > > > >
> > > > > > Says who? Not server Ev2 support. The RA layer can isolate
that, so
> > it
> > > > > > should not be "part of the public API".
> > > > > >
> > > > > > Mergeinfo support? Sure. But Ev2? Nah.
> > > > >
> > > > > The entire RA interface is part of the public API.  The wire
protocols
> > > > > are the public interface to the server, particularly for those who
> > > > > want to write their own clients and server.  These strings are
part of
> > > > > that definition.
> > > >
> > > > Ah. There we go. That clinches it.
> > > >
> > > > It's too bad we don't have svn_wire.h. Right now, svn_ra serves both
> > > > purposes, so yah... I guess it makes sense to leave it there, unless
> > we'd
> > > > like to start migrating appropriate pieces to a new header.
Thoughts?
> > >
> > > Haven't followed the thread, but we generally declared only the C API
to
> > > be public, while the wire API was considered "internal".  (i.e., we'll
> > > have to make it compatible to respect our 1.x-client/1.y-server
promise,
> > > but we don't officially support people writing their own wire clients,
> > > etc, not through our libraries)
> >
> > Hmm. True. .../include/private/svn_wire.h then.
> >
>
> subversion/include/private/svn_dav_protocol.h ?
>
> (or is ra_svn involved too?)

Yah, probably ra_svn, too.

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Daniel Shahaf <da...@elego.de>.
Greg Stein wrote on Tue, Apr 24, 2012 at 12:20:26 -0400:
> On Apr 24, 2012 10:08 AM, "Daniel Shahaf" <da...@elego.de> wrote:
> >
> > Greg Stein wrote on Mon, Apr 23, 2012 at 22:47:43 -0400:
> > > On Apr 23, 2012 7:20 PM, "Hyrum K Wright" <hy...@wandisco.com>
> wrote:
> > > >
> > > > On Mon, Apr 23, 2012 at 4:55 PM, Greg Stein <gs...@gmail.com> wrote:
> > > > > On Mon, Apr 23, 2012 at 16:21, Hyrum K Wright <
> hyrum.wright@wandisco.com>
> > > wrote:
> > > > >> On Mon, Apr 23, 2012 at 12:52 PM, Greg Stein <gs...@gmail.com>
> wrote:
> > > > >>...
> > > > >>> Alright. It sounds like svn_ra.h has two purposes: stuff for
> > > libsvn_client,
> > > > >>> and stuff for all RA layers to use internally. Ugh.
> > > > >>
> > > > >> But the capability strings are part of the public API.
> > > > >
> > > > > Says who? Not server Ev2 support. The RA layer can isolate that, so
> it
> > > > > should not be "part of the public API".
> > > > >
> > > > > Mergeinfo support? Sure. But Ev2? Nah.
> > > >
> > > > The entire RA interface is part of the public API.  The wire protocols
> > > > are the public interface to the server, particularly for those who
> > > > want to write their own clients and server.  These strings are part of
> > > > that definition.
> > >
> > > Ah. There we go. That clinches it.
> > >
> > > It's too bad we don't have svn_wire.h. Right now, svn_ra serves both
> > > purposes, so yah... I guess it makes sense to leave it there, unless
> we'd
> > > like to start migrating appropriate pieces to a new header. Thoughts?
> >
> > Haven't followed the thread, but we generally declared only the C API to
> > be public, while the wire API was considered "internal".  (i.e., we'll
> > have to make it compatible to respect our 1.x-client/1.y-server promise,
> > but we don't officially support people writing their own wire clients,
> > etc, not through our libraries)
> 
> Hmm. True. .../include/private/svn_wire.h then.
> 

subversion/include/private/svn_dav_protocol.h ?

(or is ra_svn involved too?)

> ?

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Greg Stein <gs...@gmail.com>.
On Apr 24, 2012 10:08 AM, "Daniel Shahaf" <da...@elego.de> wrote:
>
> Greg Stein wrote on Mon, Apr 23, 2012 at 22:47:43 -0400:
> > On Apr 23, 2012 7:20 PM, "Hyrum K Wright" <hy...@wandisco.com>
wrote:
> > >
> > > On Mon, Apr 23, 2012 at 4:55 PM, Greg Stein <gs...@gmail.com> wrote:
> > > > On Mon, Apr 23, 2012 at 16:21, Hyrum K Wright <
hyrum.wright@wandisco.com>
> > wrote:
> > > >> On Mon, Apr 23, 2012 at 12:52 PM, Greg Stein <gs...@gmail.com>
wrote:
> > > >>...
> > > >>> Alright. It sounds like svn_ra.h has two purposes: stuff for
> > libsvn_client,
> > > >>> and stuff for all RA layers to use internally. Ugh.
> > > >>
> > > >> But the capability strings are part of the public API.
> > > >
> > > > Says who? Not server Ev2 support. The RA layer can isolate that, so
it
> > > > should not be "part of the public API".
> > > >
> > > > Mergeinfo support? Sure. But Ev2? Nah.
> > >
> > > The entire RA interface is part of the public API.  The wire protocols
> > > are the public interface to the server, particularly for those who
> > > want to write their own clients and server.  These strings are part of
> > > that definition.
> >
> > Ah. There we go. That clinches it.
> >
> > It's too bad we don't have svn_wire.h. Right now, svn_ra serves both
> > purposes, so yah... I guess it makes sense to leave it there, unless
we'd
> > like to start migrating appropriate pieces to a new header. Thoughts?
>
> Haven't followed the thread, but we generally declared only the C API to
> be public, while the wire API was considered "internal".  (i.e., we'll
> have to make it compatible to respect our 1.x-client/1.y-server promise,
> but we don't officially support people writing their own wire clients,
> etc, not through our libraries)

Hmm. True. .../include/private/svn_wire.h then.

?

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Daniel Shahaf <da...@elego.de>.
Greg Stein wrote on Mon, Apr 23, 2012 at 22:47:43 -0400:
> On Apr 23, 2012 7:20 PM, "Hyrum K Wright" <hy...@wandisco.com> wrote:
> >
> > On Mon, Apr 23, 2012 at 4:55 PM, Greg Stein <gs...@gmail.com> wrote:
> > > On Mon, Apr 23, 2012 at 16:21, Hyrum K Wright <hy...@wandisco.com>
> wrote:
> > >> On Mon, Apr 23, 2012 at 12:52 PM, Greg Stein <gs...@gmail.com> wrote:
> > >>...
> > >>> Alright. It sounds like svn_ra.h has two purposes: stuff for
> libsvn_client,
> > >>> and stuff for all RA layers to use internally. Ugh.
> > >>
> > >> But the capability strings are part of the public API.
> > >
> > > Says who? Not server Ev2 support. The RA layer can isolate that, so it
> > > should not be "part of the public API".
> > >
> > > Mergeinfo support? Sure. But Ev2? Nah.
> >
> > The entire RA interface is part of the public API.  The wire protocols
> > are the public interface to the server, particularly for those who
> > want to write their own clients and server.  These strings are part of
> > that definition.
> 
> Ah. There we go. That clinches it.
> 
> It's too bad we don't have svn_wire.h. Right now, svn_ra serves both
> purposes, so yah... I guess it makes sense to leave it there, unless we'd
> like to start migrating appropriate pieces to a new header. Thoughts?

Haven't followed the thread, but we generally declared only the C API to
be public, while the wire API was considered "internal".  (i.e., we'll
have to make it compatible to respect our 1.x-client/1.y-server promise,
but we don't officially support people writing their own wire clients,
etc, not through our libraries)

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Hyrum K Wright <hy...@wandisco.com>.
On Mon, Apr 23, 2012 at 9:47 PM, Greg Stein <gs...@gmail.com> wrote:
>
> On Apr 23, 2012 7:20 PM, "Hyrum K Wright" <hy...@wandisco.com> wrote:
>>
>> On Mon, Apr 23, 2012 at 4:55 PM, Greg Stein <gs...@gmail.com> wrote:
>> > On Mon, Apr 23, 2012 at 16:21, Hyrum K Wright
>> > <hy...@wandisco.com> wrote:
>> >> On Mon, Apr 23, 2012 at 12:52 PM, Greg Stein <gs...@gmail.com> wrote:
>> >>...
>> >>> Alright. It sounds like svn_ra.h has two purposes: stuff for
>> >>> libsvn_client,
>> >>> and stuff for all RA layers to use internally. Ugh.
>> >>
>> >> But the capability strings are part of the public API.
>> >
>> > Says who? Not server Ev2 support. The RA layer can isolate that, so it
>> > should not be "part of the public API".
>> >
>> > Mergeinfo support? Sure. But Ev2? Nah.
>>
>> The entire RA interface is part of the public API.  The wire protocols
>> are the public interface to the server, particularly for those who
>> want to write their own clients and server.  These strings are part of
>> that definition.
>
> Ah. There we go. That clinches it.
>
> It's too bad we don't have svn_wire.h. Right now, svn_ra serves both
> purposes, so yah... I guess it makes sense to leave it there, unless we'd
> like to start migrating appropriate pieces to a new header. Thoughts?

I don't have a whole lot of opinions on the subject, as it is largely
outside the scope of Ev2.

-Hyrum


-- 

uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Greg Stein <gs...@gmail.com>.
On Apr 23, 2012 7:20 PM, "Hyrum K Wright" <hy...@wandisco.com> wrote:
>
> On Mon, Apr 23, 2012 at 4:55 PM, Greg Stein <gs...@gmail.com> wrote:
> > On Mon, Apr 23, 2012 at 16:21, Hyrum K Wright <hy...@wandisco.com>
wrote:
> >> On Mon, Apr 23, 2012 at 12:52 PM, Greg Stein <gs...@gmail.com> wrote:
> >>...
> >>> Alright. It sounds like svn_ra.h has two purposes: stuff for
libsvn_client,
> >>> and stuff for all RA layers to use internally. Ugh.
> >>
> >> But the capability strings are part of the public API.
> >
> > Says who? Not server Ev2 support. The RA layer can isolate that, so it
> > should not be "part of the public API".
> >
> > Mergeinfo support? Sure. But Ev2? Nah.
>
> The entire RA interface is part of the public API.  The wire protocols
> are the public interface to the server, particularly for those who
> want to write their own clients and server.  These strings are part of
> that definition.

Ah. There we go. That clinches it.

It's too bad we don't have svn_wire.h. Right now, svn_ra serves both
purposes, so yah... I guess it makes sense to leave it there, unless we'd
like to start migrating appropriate pieces to a new header. Thoughts?

>...

Cheers,
-g

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Hyrum K Wright <hy...@wandisco.com>.
On Mon, Apr 23, 2012 at 4:55 PM, Greg Stein <gs...@gmail.com> wrote:
> On Mon, Apr 23, 2012 at 16:21, Hyrum K Wright <hy...@wandisco.com> wrote:
>> On Mon, Apr 23, 2012 at 12:52 PM, Greg Stein <gs...@gmail.com> wrote:
>>...
>>> Alright. It sounds like svn_ra.h has two purposes: stuff for libsvn_client,
>>> and stuff for all RA layers to use internally. Ugh.
>>
>> But the capability strings are part of the public API.
>
> Says who? Not server Ev2 support. The RA layer can isolate that, so it
> should not be "part of the public API".
>
> Mergeinfo support? Sure. But Ev2? Nah.

The entire RA interface is part of the public API.  The wire protocols
are the public interface to the server, particularly for those who
want to write their own clients and server.  These strings are part of
that definition.

>> svn_ra_has_capability() expects them as input, and it makes sense to
>> define them in a public place.  Consumers external to the ra libs can
>> realistically be expected to ask this question, so I don't see a
>> problem with them being in the public space.
>
> I don't see it as realistic. You just use the Ev2 interface and be done with it.

Sure.

My sense of order appreciates the fact that all the capability strings
are #define'd in the same place.  As a developer and user, it's nice
to have that stuff together, and the names consistent (you would need
the double-underscore if the macro was private).  If you feel strongly
that this should be the one exception to the rule, I won't object
further.

-Hyrum


-- 

uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Greg Stein <gs...@gmail.com>.
On Mon, Apr 23, 2012 at 16:21, Hyrum K Wright <hy...@wandisco.com> wrote:
> On Mon, Apr 23, 2012 at 12:52 PM, Greg Stein <gs...@gmail.com> wrote:
>...
>> Alright. It sounds like svn_ra.h has two purposes: stuff for libsvn_client,
>> and stuff for all RA layers to use internally. Ugh.
>
> But the capability strings are part of the public API.

Says who? Not server Ev2 support. The RA layer can isolate that, so it
should not be "part of the public API".

Mergeinfo support? Sure. But Ev2? Nah.

> svn_ra_has_capability() expects them as input, and it makes sense to
> define them in a public place.  Consumers external to the ra libs can
> realistically be expected to ask this question, so I don't see a
> problem with them being in the public space.

I don't see it as realistic. You just use the Ev2 interface and be done with it.

>...

Cheers,
-g

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Hyrum K Wright <hy...@wandisco.com>.
On Mon, Apr 23, 2012 at 12:52 PM, Greg Stein <gs...@gmail.com> wrote:
>
> On Apr 23, 2012 1:36 PM, "Hyrum K Wright" <hy...@wandisco.com> wrote:
>>
>> On Mon, Apr 23, 2012 at 12:18 PM, Greg Stein <gs...@gmail.com> wrote:
>> >
>> > On Apr 23, 2012 1:12 PM, "Hyrum K Wright" <hy...@wandisco.com>
>> > wrote:
>> >>
>> >> On Mon, Apr 23, 2012 at 12:08 PM, Greg Stein <gs...@gmail.com> wrote:
>> >> >
>> >> > On Apr 23, 2012 8:00 AM, "Hyrum K Wright" <hy...@wandisco.com>
>> >> > wrote:
>> >> >>...
>> >> >
>> >> >
>> >> >> I added an Ev2 capability to svn_ra.h on the ev2-export branch,
>> >> >> which
>> >> >> we could use to check the ability of the client and/or server to
>> >> >> receiver Ev2-encoded deltas.  Feel free to poach the one-line patch.
>> >> >
>> >> > I'm not sure it is needed. How would the client use it?
>> >>
>> >> To determine if the server is Ev2 capable?  We've got to have *some*
>> >> method of doing so, and the existing capabilities mechanism was built
>> >> just for that purpose.
>> >
>> > But is that an RA constant, or something under the covers? ie. does that
>> > need to be in svn_ra.h for client consumption, or can RA determine that
>> > privately and compensate?
>>
>> The string is globally defined, but each server (and client?)
>> advertises the capabilities it supports as part of the initial
>> connection set up.  These are then cached by the client (and server?)
>> for other libraries to consume.  In practice, these means that
>> libsvn_ra can fall back to alternative implementations of
>> functionality if talking to older servers.
>>
>> > For example, ra_dav can do everything but the symlink operations and
>> > rotate(). Those will need to query the server to determine whether to
>> > use
>> > new/old marshalling. But to the svn_ra user, it is always available.
>> >
>> > For ra_local, it is always available at both internal/client levels.
>>
>> Both correct, and the capabilities mechanism is the way for the ra
>> layers to determine if the other side supports the new marshalling
>> format.
>
> Alright. It sounds like svn_ra.h has two purposes: stuff for libsvn_client,
> and stuff for all RA layers to use internally. Ugh.

But the capability strings are part of the public API.
svn_ra_has_capability() expects them as input, and it makes sense to
define them in a public place.  Consumers external to the ra libs can
realistically be expected to ask this question, so I don't see a
problem with them being in the public space.

> I'd rather see internal stuff moved to a private header, since it is not
> part of the public API...
>
> IOW, if/when that capability hits trunk, can we put it into svn_ra_private?
> (and do so, going forward)

Given the above, I think they should stay in svn_ra.h.

-Hyrum


-- 

uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Greg Stein <gs...@gmail.com>.
On Apr 23, 2012 1:36 PM, "Hyrum K Wright" <hy...@wandisco.com> wrote:
>
> On Mon, Apr 23, 2012 at 12:18 PM, Greg Stein <gs...@gmail.com> wrote:
> >
> > On Apr 23, 2012 1:12 PM, "Hyrum K Wright" <hy...@wandisco.com>
wrote:
> >>
> >> On Mon, Apr 23, 2012 at 12:08 PM, Greg Stein <gs...@gmail.com> wrote:
> >> >
> >> > On Apr 23, 2012 8:00 AM, "Hyrum K Wright" <hy...@wandisco.com>
> >> > wrote:
> >> >>...
> >> >
> >> >
> >> >> I added an Ev2 capability to svn_ra.h on the ev2-export branch,
which
> >> >> we could use to check the ability of the client and/or server to
> >> >> receiver Ev2-encoded deltas.  Feel free to poach the one-line patch.
> >> >
> >> > I'm not sure it is needed. How would the client use it?
> >>
> >> To determine if the server is Ev2 capable?  We've got to have *some*
> >> method of doing so, and the existing capabilities mechanism was built
> >> just for that purpose.
> >
> > But is that an RA constant, or something under the covers? ie. does that
> > need to be in svn_ra.h for client consumption, or can RA determine that
> > privately and compensate?
>
> The string is globally defined, but each server (and client?)
> advertises the capabilities it supports as part of the initial
> connection set up.  These are then cached by the client (and server?)
> for other libraries to consume.  In practice, these means that
> libsvn_ra can fall back to alternative implementations of
> functionality if talking to older servers.
>
> > For example, ra_dav can do everything but the symlink operations and
> > rotate(). Those will need to query the server to determine whether to
use
> > new/old marshalling. But to the svn_ra user, it is always available.
> >
> > For ra_local, it is always available at both internal/client levels.
>
> Both correct, and the capabilities mechanism is the way for the ra
> layers to determine if the other side supports the new marshalling
> format.

Alright. It sounds like svn_ra.h has two purposes: stuff for libsvn_client,
and stuff for all RA layers to use internally. Ugh.

I'd rather see internal stuff moved to a private header, since it is not
part of the public API...

IOW, if/when that capability hits trunk, can we put it into svn_ra_private?
(and do so, going forward)

Cheers,
-g

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Hyrum K Wright <hy...@wandisco.com>.
On Mon, Apr 23, 2012 at 12:18 PM, Greg Stein <gs...@gmail.com> wrote:
>
> On Apr 23, 2012 1:12 PM, "Hyrum K Wright" <hy...@wandisco.com> wrote:
>>
>> On Mon, Apr 23, 2012 at 12:08 PM, Greg Stein <gs...@gmail.com> wrote:
>> >
>> > On Apr 23, 2012 8:00 AM, "Hyrum K Wright" <hy...@wandisco.com>
>> > wrote:
>> >>...
>> >
>> >
>> >> I added an Ev2 capability to svn_ra.h on the ev2-export branch, which
>> >> we could use to check the ability of the client and/or server to
>> >> receiver Ev2-encoded deltas.  Feel free to poach the one-line patch.
>> >
>> > I'm not sure it is needed. How would the client use it?
>>
>> To determine if the server is Ev2 capable?  We've got to have *some*
>> method of doing so, and the existing capabilities mechanism was built
>> just for that purpose.
>
> But is that an RA constant, or something under the covers? ie. does that
> need to be in svn_ra.h for client consumption, or can RA determine that
> privately and compensate?

The string is globally defined, but each server (and client?)
advertises the capabilities it supports as part of the initial
connection set up.  These are then cached by the client (and server?)
for other libraries to consume.  In practice, these means that
libsvn_ra can fall back to alternative implementations of
functionality if talking to older servers.

> For example, ra_dav can do everything but the symlink operations and
> rotate(). Those will need to query the server to determine whether to use
> new/old marshalling. But to the svn_ra user, it is always available.
>
> For ra_local, it is always available at both internal/client levels.

Both correct, and the capabilities mechanism is the way for the ra
layers to determine if the other side supports the new marshalling
format.

-Hyrum


-- 

uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Greg Stein <gs...@gmail.com>.
On Apr 23, 2012 1:12 PM, "Hyrum K Wright" <hy...@wandisco.com> wrote:
>
> On Mon, Apr 23, 2012 at 12:08 PM, Greg Stein <gs...@gmail.com> wrote:
> >
> > On Apr 23, 2012 8:00 AM, "Hyrum K Wright" <hy...@wandisco.com>
wrote:
> >>...
> >
> >
> >> I added an Ev2 capability to svn_ra.h on the ev2-export branch, which
> >> we could use to check the ability of the client and/or server to
> >> receiver Ev2-encoded deltas.  Feel free to poach the one-line patch.
> >
> > I'm not sure it is needed. How would the client use it?
>
> To determine if the server is Ev2 capable?  We've got to have *some*
> method of doing so, and the existing capabilities mechanism was built
> just for that purpose.

But is that an RA constant, or something under the covers? ie. does that
need to be in svn_ra.h for client consumption, or can RA determine that
privately and compensate?

For example, ra_dav can do everything but the symlink operations and
rotate(). Those will need to query the server to determine whether to use
new/old marshalling. But to the svn_ra user, it is always available.

For ra_local, it is always available at both internal/client levels.

Cheers,
-g

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Hyrum K Wright <hy...@wandisco.com>.
On Mon, Apr 23, 2012 at 12:08 PM, Greg Stein <gs...@gmail.com> wrote:
>
> On Apr 23, 2012 8:00 AM, "Hyrum K Wright" <hy...@wandisco.com> wrote:
>>...
>
>
>> I added an Ev2 capability to svn_ra.h on the ev2-export branch, which
>> we could use to check the ability of the client and/or server to
>> receiver Ev2-encoded deltas.  Feel free to poach the one-line patch.
>
> I'm not sure it is needed. How would the client use it?

To determine if the server is Ev2 capable?  We've got to have *some*
method of doing so, and the existing capabilities mechanism was built
just for that purpose.

-Hyrum


-- 

uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Greg Stein <gs...@gmail.com>.
On Apr 23, 2012 8:00 AM, "Hyrum K Wright" <hy...@wandisco.com> wrote:
>...
> I added an Ev2 capability to svn_ra.h on the ev2-export branch, which
> we could use to check the ability of the client and/or server to
> receiver Ev2-encoded deltas.  Feel free to poach the one-line patch.

I'm not sure it is needed. How would the client use it?

Cheers,
-g

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Hyrum K Wright <hy...@wandisco.com>.
On Sun, Apr 22, 2012 at 8:11 PM, Greg Stein <gs...@gmail.com> wrote:
> On Sun, Apr 22, 2012 at 20:59,  <gs...@apache.org> wrote:
>> Author: gstein
>> Date: Mon Apr 23 00:59:46 2012
>> New Revision: 1329015
>>
>> URL: http://svn.apache.org/viewvc?rev=1329015&view=rev
>> Log:
>> Provide a first pass at (private) APIs to fetch an EV2-based commit
>> editor from the RA layers. Some of this is based on Hyrum's work on
>> the ev2-exports branch (see editor.c below).
>>
>> If an RA layer supports this new API, then it is used. Otherwise, an
>> Ev2 shim is inserted over its Ev1-based commit editor and returned.
>
> The concept here is that we'll provide *two* commit editors out of the
> RA layers. The existing Ev1-based editor, and the new Ev2-based
> editor. Both are provided during the transition period. The Ev1 API
> will need to stick around for compatibility purposes, so I don't think
> we're really losing much by creating a second (Ev2-based) path. At
> some point in the future, we can simply deprecate the Ev1 version (as
> if we had moved from get_commit_editor3() to get_commit_editor4()).
>
> This is a different strategy from Hyrum's branch, where
> get_commit_editor3() has been deprecated in favor of an Ev2 version
> (ie. only one "valid" path).
>
> For now, the Ev2-based APIs are all private. Once we're comfortable
> with them, then we can make them public. Third parties can continue to
> use the Ev1-based commit editor.
>
> The Ev2-based commit editor can be built incrementally. For example,
> it could support *just* add_directory() and then we switch the 'svn
> mkdir URL' code over to use the Ev2 interface. Even if that gets run
> against an "old" RA layer and an Ev2/Ev2 shim is interposed, the shim
> won't create much of a problem since you're only operating on one (or
> a few) target paths. (the shims buffer all modified paths, basically,
> so we want to avoid them in "unbounded" commit sequences)

I added an Ev2 capability to svn_ra.h on the ev2-export branch, which
we could use to check the ability of the client and/or server to
receiver Ev2-encoded deltas.  Feel free to poach the one-line patch.

> Since a shim is used when needed, we can also implement the Ev2 APIs
> on one RA layer at a time. We don't have to code them all at once.
> Only when we want to avoid the Ev2/Ev1 shim and its overhead.
>
> Lastly: note that these are not bounded by any conditional
> compilation. This is unrelated to the ENABLE_EV2_SHIMS code, which
> interposes an Ev1/Ev2 and an Ev2/Ev1 shim around each delta (Ev1)
> editor created. This is true Ev2 work, only pending code that will
> make use of it.

Thanks for putting our discussion from last week in writing.  The goal
here (for folks who aren't aware) is to get as much of the ev2-export
branch on branch relatively soon, with all the attendant benefits.
The trick in doing so is making sure that performance isn't negatively
impacted by having the shims be the default path through the editor.

Even though the above technique applies primarily to the commit
editor, I think the dual editor approach will work just as well for
update editors and the like, but that work is a bit farther out.

-Hyrum



-- 

uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Stefan Sperling <st...@elego.de>.
On Sun, Apr 22, 2012 at 09:11:07PM -0400, Greg Stein wrote:
> Since a shim is used when needed, we can also implement the Ev2 APIs
> on one RA layer at a time. We don't have to code them all at once.
> Only when we want to avoid the Ev2/Ev1 shim and its overhead.

Sounds like a great migration plan!

Re: svn commit: r1329015 - in /subversion/trunk/subversion: include/private/svn_ra_private.h libsvn_ra/editor.c libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h

Posted by Greg Stein <gs...@gmail.com>.
On Sun, Apr 22, 2012 at 20:59,  <gs...@apache.org> wrote:
> Author: gstein
> Date: Mon Apr 23 00:59:46 2012
> New Revision: 1329015
>
> URL: http://svn.apache.org/viewvc?rev=1329015&view=rev
> Log:
> Provide a first pass at (private) APIs to fetch an EV2-based commit
> editor from the RA layers. Some of this is based on Hyrum's work on
> the ev2-exports branch (see editor.c below).
>
> If an RA layer supports this new API, then it is used. Otherwise, an
> Ev2 shim is inserted over its Ev1-based commit editor and returned.

The concept here is that we'll provide *two* commit editors out of the
RA layers. The existing Ev1-based editor, and the new Ev2-based
editor. Both are provided during the transition period. The Ev1 API
will need to stick around for compatibility purposes, so I don't think
we're really losing much by creating a second (Ev2-based) path. At
some point in the future, we can simply deprecate the Ev1 version (as
if we had moved from get_commit_editor3() to get_commit_editor4()).

This is a different strategy from Hyrum's branch, where
get_commit_editor3() has been deprecated in favor of an Ev2 version
(ie. only one "valid" path).

For now, the Ev2-based APIs are all private. Once we're comfortable
with them, then we can make them public. Third parties can continue to
use the Ev1-based commit editor.

The Ev2-based commit editor can be built incrementally. For example,
it could support *just* add_directory() and then we switch the 'svn
mkdir URL' code over to use the Ev2 interface. Even if that gets run
against an "old" RA layer and an Ev2/Ev2 shim is interposed, the shim
won't create much of a problem since you're only operating on one (or
a few) target paths. (the shims buffer all modified paths, basically,
so we want to avoid them in "unbounded" commit sequences)

Since a shim is used when needed, we can also implement the Ev2 APIs
on one RA layer at a time. We don't have to code them all at once.
Only when we want to avoid the Ev2/Ev1 shim and its overhead.

Lastly: note that these are not bounded by any conditional
compilation. This is unrelated to the ENABLE_EV2_SHIMS code, which
interposes an Ev1/Ev2 and an Ev2/Ev1 shim around each delta (Ev1)
editor created. This is true Ev2 work, only pending code that will
make use of it.

Cheers,
-g