Author: rinrab
Date: Fri Sep  4 22:09:39 2026
New Revision: 1937890

Log:
On the 'reparentless' branch: Add reparentless commit.

* subversion/include/svn_ra.h
  (svn_ra_get_commit_editor4): Bump version, add repos_relpath, and update
   description.
  (svn_ra_get_commit_editor3): Deprecate.
* subversion/libsvn_ra/deprecated.c
  (svn_ra_get_commit_editor3): Implement compat func.
* subversion/libsvn_ra/ra_loader.c
  (svn_ra_get_commit_editor4): Add repos_relpath.
* subversion/libsvn_ra/editor.c
  (svn_ra__use_commit_shim): Implement using compat API - we'll figure out a
   better solution later, but for now, I'm not going to touch this code. There
   is not tests...

* subversion/libsvn_ra/ra_loader.h,
  subversion/libsvn_ra_serf/ra_serf.h
  subversion/libsvn_ra_local/ra_plugin.c,
  subversion/libsvn_ra_serf/commit.c,
  subversion/libsvn_ra_svn/client.c
  (svn_ra__vtable_t::get_commit_editor,
   svn_ra_local__get_commit_editor,
   svn_ra_serf__get_commit_editor
   ra_svn_commit): Add repos_relpath.

Modified:
   subversion/branches/reparentless/subversion/include/svn_ra.h
   subversion/branches/reparentless/subversion/libsvn_ra/deprecated.c
   subversion/branches/reparentless/subversion/libsvn_ra/editor.c
   subversion/branches/reparentless/subversion/libsvn_ra/ra_loader.c
   subversion/branches/reparentless/subversion/libsvn_ra/ra_loader.h
   subversion/branches/reparentless/subversion/libsvn_ra_local/ra_plugin.c
   subversion/branches/reparentless/subversion/libsvn_ra_serf/commit.c
   subversion/branches/reparentless/subversion/libsvn_ra_serf/ra_serf.h
   subversion/branches/reparentless/subversion/libsvn_ra_svn/client.c

Modified: subversion/branches/reparentless/subversion/include/svn_ra.h
==============================================================================
--- subversion/branches/reparentless/subversion/include/svn_ra.h        Fri Sep 
 4 21:36:08 2026        (r1937889)
+++ subversion/branches/reparentless/subversion/include/svn_ra.h        Fri Sep 
 4 22:09:39 2026        (r1937890)
@@ -976,8 +976,8 @@ svn_ra_rev_prop(svn_ra_session_t *sessio
  * changes to the repository of @a session, setting the revision
  * properties from @a revprop_table.  The revisions being committed
  * against are passed to the editor functions, starting with the rev
- * argument to @c open_root.  The path root of the commit is the @a
- * session's URL.
+ * argument to @c open_root.  The path root of the commit is a path
+ * relative to repository root.
  *
  * @a revprop_table is a hash mapping <tt>const char *</tt> property
  * names to @c svn_string_t property values.  The commit log message
@@ -1010,13 +1010,34 @@ svn_ra_rev_prop(svn_ra_session_t *sessio
  *
  * Use @a pool for memory allocation.
  *
- * @since New in 1.5.
+ * @since New in 1.16.
  *
  * @note Like most commit editors, the returned editor requires that the
  * @c copyfrom_path parameter passed to its @c add_file and @c add_directory
  * methods is a URL, not a relative path.
  */
 svn_error_t *
+svn_ra_get_commit_editor4(svn_ra_session_t *session,
+                          const svn_delta_editor_t **editor,
+                          void **edit_baton,
+                          const char *repos_relpath,
+                          apr_hash_t *revprop_table,
+                          svn_commit_callback2_t commit_callback,
+                          void *commit_baton,
+                          apr_hash_t *lock_tokens,
+                          svn_boolean_t keep_locks,
+                          apr_pool_t *pool);
+
+/**
+ * Similar to @c svn_ra_get_commit_editor4, but @a path is relative to session
+ * URL.
+ *
+ * @since New in 1.5.
+ *
+ * @deprecated Provided for compatibility with the 1.15 API.
+ */
+SVN_DEPRECATED
+svn_error_t *
 svn_ra_get_commit_editor3(svn_ra_session_t *session,
                           const svn_delta_editor_t **editor,
                           void **edit_baton,

Modified: subversion/branches/reparentless/subversion/libsvn_ra/deprecated.c
==============================================================================
--- subversion/branches/reparentless/subversion/libsvn_ra/deprecated.c  Fri Sep 
 4 21:36:08 2026        (r1937889)
+++ subversion/branches/reparentless/subversion/libsvn_ra/deprecated.c  Fri Sep 
 4 22:09:39 2026        (r1937890)
@@ -239,6 +239,27 @@ svn_error_t *svn_ra_change_rev_prop(svn_
   return svn_ra_change_rev_prop2(session, rev, name, NULL, value, pool);
 }
 
+svn_error_t *svn_ra_get_commit_editor3(svn_ra_session_t *session,
+                                       const svn_delta_editor_t **editor,
+                                       void **edit_baton,
+                                       apr_hash_t *revprop_table,
+                                       svn_commit_callback2_t commit_callback,
+                                       void *commit_baton,
+                                       apr_hash_t *lock_tokens,
+                                       svn_boolean_t keep_locks,
+                                       apr_pool_t *pool)
+{
+  const char *session_path;
+  SVN_ERR(get_session_path(session, &session_path, pool));
+
+  return svn_error_trace(
+      svn_ra_get_commit_editor4(session, editor, edit_baton,
+                                session_path, revprop_table,
+                                commit_callback, commit_baton,
+                                lock_tokens, keep_locks, pool)
+      );
+}
+
 svn_error_t *svn_ra_get_commit_editor2(svn_ra_session_t *session,
                                        const svn_delta_editor_t **editor,
                                        void **edit_baton,

Modified: subversion/branches/reparentless/subversion/libsvn_ra/editor.c
==============================================================================
--- subversion/branches/reparentless/subversion/libsvn_ra/editor.c      Fri Sep 
 4 21:36:08 2026        (r1937889)
+++ subversion/branches/reparentless/subversion/libsvn_ra/editor.c      Fri Sep 
 4 22:09:39 2026        (r1937890)
@@ -147,11 +147,11 @@ svn_ra__use_commit_shim(svn_editor_t **e
      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,
-                                             commit_callback, commit_baton,
-                                             lock_tokens, keep_locks,
-                                             result_pool));
+  SVN_ERR(svn_ra_get_commit_editor3(session, &deditor, &dedit_baton,
+                                    revprop_table,
+                                    commit_callback, commit_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));

Modified: subversion/branches/reparentless/subversion/libsvn_ra/ra_loader.c
==============================================================================
--- subversion/branches/reparentless/subversion/libsvn_ra/ra_loader.c   Fri Sep 
 4 21:36:08 2026        (r1937889)
+++ subversion/branches/reparentless/subversion/libsvn_ra/ra_loader.c   Fri Sep 
 4 22:09:39 2026        (r1937890)
@@ -604,9 +604,10 @@ svn_error_t *svn_ra_rev_prop(svn_ra_sess
   return session->vtable->rev_prop(session, rev, name, value, pool);
 }
 
-svn_error_t *svn_ra_get_commit_editor3(svn_ra_session_t *session,
+svn_error_t *svn_ra_get_commit_editor4(svn_ra_session_t *session,
                                        const svn_delta_editor_t **editor,
                                        void **edit_baton,
+                                       const char *repos_relpath,
                                        apr_hash_t *revprop_table,
                                        svn_commit_callback2_t commit_callback,
                                        void *commit_baton,
@@ -615,7 +616,7 @@ svn_error_t *svn_ra_get_commit_editor3(s
                                        apr_pool_t *pool)
 {
   return session->vtable->get_commit_editor(session, editor, edit_baton,
-                                            revprop_table,
+                                            repos_relpath, revprop_table,
                                             commit_callback, commit_baton,
                                             lock_tokens, keep_locks, pool);
 }

Modified: subversion/branches/reparentless/subversion/libsvn_ra/ra_loader.h
==============================================================================
--- subversion/branches/reparentless/subversion/libsvn_ra/ra_loader.h   Fri Sep 
 4 21:36:08 2026        (r1937889)
+++ subversion/branches/reparentless/subversion/libsvn_ra/ra_loader.h   Fri Sep 
 4 22:09:39 2026        (r1937890)
@@ -125,6 +125,7 @@ typedef struct svn_ra__vtable_t {
   svn_error_t *(*get_commit_editor)(svn_ra_session_t *session,
                                     const svn_delta_editor_t **editor,
                                     void **edit_baton,
+                                    const char *repos_relpath,
                                     apr_hash_t *revprop_table,
                                     svn_commit_callback2_t callback,
                                     void *callback_baton,

Modified: 
subversion/branches/reparentless/subversion/libsvn_ra_local/ra_plugin.c
==============================================================================
--- subversion/branches/reparentless/subversion/libsvn_ra_local/ra_plugin.c     
Fri Sep  4 21:36:08 2026        (r1937889)
+++ subversion/branches/reparentless/subversion/libsvn_ra_local/ra_plugin.c     
Fri Sep  4 22:09:39 2026        (r1937890)
@@ -866,6 +866,7 @@ static svn_error_t *
 svn_ra_local__get_commit_editor(svn_ra_session_t *session,
                                 const svn_delta_editor_t **editor,
                                 void **edit_baton,
+                                const char *repos_relpath,
                                 apr_hash_t *revprop_table,
                                 svn_commit_callback2_t callback,
                                 void *callback_baton,
@@ -909,7 +910,7 @@ svn_ra_local__get_commit_editor(svn_ra_s
   /* Get the repos commit-editor */
   return svn_repos_get_commit_editor5
          (editor, edit_baton, sess->repos, NULL,
-          svn_path_uri_decode(sess->repos_url, pool), sess->fs_path->data,
+          svn_path_uri_decode(sess->repos_url, pool), repos_relpath,
           revprop_table, deltify_etc, deb, NULL, NULL, pool);
 }
 

Modified: subversion/branches/reparentless/subversion/libsvn_ra_serf/commit.c
==============================================================================
--- subversion/branches/reparentless/subversion/libsvn_ra_serf/commit.c Fri Sep 
 4 21:36:08 2026        (r1937889)
+++ subversion/branches/reparentless/subversion/libsvn_ra_serf/commit.c Fri Sep 
 4 22:09:39 2026        (r1937890)
@@ -2346,6 +2346,7 @@ svn_error_t *
 svn_ra_serf__get_commit_editor(svn_ra_session_t *ra_session,
                                const svn_delta_editor_t **ret_editor,
                                void **edit_baton,
+                               const char *repos_relpath,
                                apr_hash_t *revprop_table,
                                svn_commit_callback2_t callback,
                                void *callback_baton,
@@ -2357,7 +2358,6 @@ svn_ra_serf__get_commit_editor(svn_ra_se
   svn_delta_editor_t *editor;
   commit_context_t *ctx;
   const char *repos_root;
-  const char *base_relpath;
   svn_boolean_t supports_ephemeral_props;
 
   ctx = apr_pcalloc(pool, sizeof(*ctx));
@@ -2416,12 +2416,8 @@ svn_ra_serf__get_commit_editor(svn_ra_se
   *ret_editor = editor;
   *edit_baton = ctx;
 
-  SVN_ERR(svn_ra_serf__get_repos_root(ra_session, &repos_root, pool));
-  base_relpath = svn_uri_skip_ancestor(repos_root, session->session_url_str,
-                                       pool);
-
   SVN_ERR(svn_editor__insert_shims(ret_editor, edit_baton, *ret_editor,
-                                   *edit_baton, repos_root, base_relpath,
+                                   *edit_baton, repos_root, repos_relpath,
                                    session->shim_callbacks, pool, pool));
 
   return SVN_NO_ERROR;

Modified: subversion/branches/reparentless/subversion/libsvn_ra_serf/ra_serf.h
==============================================================================
--- subversion/branches/reparentless/subversion/libsvn_ra_serf/ra_serf.h        
Fri Sep  4 21:36:08 2026        (r1937889)
+++ subversion/branches/reparentless/subversion/libsvn_ra_serf/ra_serf.h        
Fri Sep  4 22:09:39 2026        (r1937890)
@@ -1349,6 +1349,7 @@ svn_error_t *
 svn_ra_serf__get_commit_editor(svn_ra_session_t *session,
                                const svn_delta_editor_t **editor,
                                void **edit_baton,
+                               const char *repos_relpath,
                                apr_hash_t *revprop_table,
                                svn_commit_callback2_t callback,
                                void *callback_baton,

Modified: subversion/branches/reparentless/subversion/libsvn_ra_svn/client.c
==============================================================================
--- subversion/branches/reparentless/subversion/libsvn_ra_svn/client.c  Fri Sep 
 4 21:36:08 2026        (r1937889)
+++ subversion/branches/reparentless/subversion/libsvn_ra_svn/client.c  Fri Sep 
 4 22:09:39 2026        (r1937890)
@@ -1331,6 +1331,7 @@ static svn_error_t *ra_svn_end_commit(vo
 static svn_error_t *ra_svn_commit(svn_ra_session_t *session,
                                   const svn_delta_editor_t **editor,
                                   void **edit_baton,
+                                  const char *repos_relpath,
                                   apr_hash_t *revprop_table,
                                   svn_commit_callback2_t callback,
                                   void *callback_baton,
@@ -1388,7 +1389,7 @@ static svn_error_t *ra_svn_commit(svn_ra
     }
 
   /* Callbacks may assume that all data is relative the sessions's URL. */
-  SVN_ERR(ensure_exact_server_parent(session, pool));
+  SVN_ERR(reparent_repos_relpath_exact(session, repos_relpath, pool));
 
   /* Tell the server we're starting the commit.
      Send log message here for backwards compatibility with servers

Reply via email to