Author: ivan
Date: Wed Sep 23 18:08:06 2026
New Revision: 1938463

Log:
On the 'reparentless' branch: Implement svn_ra_get_file2, svn_ra_list2,
svn_ra_get_locations2, svn_ra_get_location_segments2, svn_ra_get_file_revs3,
svn_ra_get_deleted_rev2, svn_ra_get_inherited_props2,
svn_ra_fetch_file_contents2 in libsvn_ra_serf.

* subversion/libsvn_ra_serf/blame.c
  (svn_ra_serf__get_file_revs): Rename PATH argument to REPOS_RELPATH and
   use svn_ra_serf__get_stable_url2() to obtain request URL. 

* subversion/libsvn_ra_serf/get_deleted_rev.c
  (svn_ra_serf__get_deleted_rev): Rename PATH argument to REPOS_RELPATH and
   use svn_ra_serf__get_stable_url2() to obtain request URL.

* subversion/libsvn_ra_serf/get_file.c
  (svn_ra_serf__get_file): Rename PATH argument to REPOS_RELPATH. Use
   svn_ra_serf__resolve_path() and svn_ra_serf__get_stable_url2() to obtain
   request URL.
  (svn_ra_serf__fetch_file_contents): Rename PATH argument to REPOS_RELPATH
   and use svn_ra_serf__get_stable_url2() to obtain request URL.

* subversion/libsvn_ra_serf/getlocations.c
  (svn_ra_serf__get_locations): Rename PATH argument to REPOS_RELPATH
   and use svn_ra_serf__get_stable_url2() to obtain request URL.

* subversion/libsvn_ra_serf/getlocationsegments.c
  (svn_ra_serf__get_location_segments): Rename PATH argument to REPOS_RELPATH
   and use svn_ra_serf__get_stable_url2() to obtain request URL.

* subversion/libsvn_ra_serf/inherited_props.c
  (get_iprops_via_more_requests): Update to work with repository relative
   path.
  (svn_ra_serf__get_inherited_props): Rename PATH argument to REPOS_RELPATH
   and use svn_ra_serf__get_stable_url2() to obtain request URL. Do not
   reparent session when server doesn't support inherited props request and
   we fallback to multiple PROPFIND requests.
 
* subversion/libsvn_ra_serf/list.c
  (svn_ra_serf__list): Rename PATH argument to REPOS_RELPATH and use
   svn_ra_serf__get_stable_url2() to obtain request URL.

Modified:
   subversion/branches/reparentless/subversion/libsvn_ra_serf/blame.c
   subversion/branches/reparentless/subversion/libsvn_ra_serf/get_deleted_rev.c
   subversion/branches/reparentless/subversion/libsvn_ra_serf/get_file.c
   subversion/branches/reparentless/subversion/libsvn_ra_serf/getlocations.c
   
subversion/branches/reparentless/subversion/libsvn_ra_serf/getlocationsegments.c
   subversion/branches/reparentless/subversion/libsvn_ra_serf/inherited_props.c
   subversion/branches/reparentless/subversion/libsvn_ra_serf/list.c

Modified: subversion/branches/reparentless/subversion/libsvn_ra_serf/blame.c
==============================================================================
--- subversion/branches/reparentless/subversion/libsvn_ra_serf/blame.c  Wed Sep 
23 14:13:28 2026        (r1938462)
+++ subversion/branches/reparentless/subversion/libsvn_ra_serf/blame.c  Wed Sep 
23 18:08:06 2026        (r1938463)
@@ -336,7 +336,7 @@ setup_headers(serf_bucket_t *headers,
 
 svn_error_t *
 svn_ra_serf__get_file_revs(svn_ra_session_t *ra_session,
-                           const char *path,
+                           const char *repos_relpath,
                            svn_revnum_t start,
                            svn_revnum_t end,
                            svn_boolean_t include_merged_revisions,
@@ -353,7 +353,7 @@ svn_ra_serf__get_file_revs(svn_ra_sessio
 
   blame_ctx = apr_pcalloc(pool, sizeof(*blame_ctx));
   blame_ctx->pool = pool;
-  blame_ctx->path = path;
+  blame_ctx->path = "";
   blame_ctx->file_rev = rev_handler;
   blame_ctx->file_rev_baton = rev_handler_baton;
   blame_ctx->start = start;
@@ -368,10 +368,10 @@ svn_ra_serf__get_file_revs(svn_ra_sessio
   else
     peg_rev = start;
 
-  SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
-                                      session,
-                                      NULL /* url */, peg_rev,
-                                      pool, pool));
+  SVN_ERR(svn_ra_serf__get_stable_url2(&req_url, NULL /* latest_revnum */,
+                                       session,
+                                       repos_relpath, peg_rev,
+                                       pool, pool));
 
   xmlctx = svn_ra_serf__xml_context_create(blame_ttable,
                                            blame_opened,

Modified: 
subversion/branches/reparentless/subversion/libsvn_ra_serf/get_deleted_rev.c
==============================================================================
--- 
subversion/branches/reparentless/subversion/libsvn_ra_serf/get_deleted_rev.c    
    Wed Sep 23 14:13:28 2026        (r1938462)
+++ 
subversion/branches/reparentless/subversion/libsvn_ra_serf/get_deleted_rev.c    
    Wed Sep 23 18:08:06 2026        (r1938463)
@@ -129,7 +129,7 @@ create_getdrev_body(serf_bucket_t **body
 
 svn_error_t *
 svn_ra_serf__get_deleted_rev(svn_ra_session_t *session,
-                             const char *path,
+                             const char *repos_relpath,
                              svn_revnum_t peg_revision,
                              svn_revnum_t end_revision,
                              svn_revnum_t *revision_deleted,
@@ -143,14 +143,14 @@ svn_ra_serf__get_deleted_rev(svn_ra_sess
   svn_error_t *err;
 
   drev_ctx = apr_pcalloc(pool, sizeof(*drev_ctx));
-  drev_ctx->path = path;
+  drev_ctx->path = "";
   drev_ctx->peg_revision = peg_revision;
   drev_ctx->end_revision = end_revision;
   drev_ctx->revision_deleted = revision_deleted;
 
-  SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
-                                      ras, NULL /* url */, peg_revision,
-                                      pool, pool));
+  SVN_ERR(svn_ra_serf__get_stable_url2(&req_url, NULL /* latest_revnum */,
+                                       ras, repos_relpath, peg_revision,
+                                       pool, pool));
 
   xmlctx = svn_ra_serf__xml_context_create(getdrev_ttable,
                                            NULL, getdrev_closed, NULL,

Modified: subversion/branches/reparentless/subversion/libsvn_ra_serf/get_file.c
==============================================================================
--- subversion/branches/reparentless/subversion/libsvn_ra_serf/get_file.c       
Wed Sep 23 14:13:28 2026        (r1938462)
+++ subversion/branches/reparentless/subversion/libsvn_ra_serf/get_file.c       
Wed Sep 23 18:08:06 2026        (r1938463)
@@ -316,7 +316,7 @@ get_file_prop_cb(void *baton,
 
 svn_error_t *
 svn_ra_serf__get_file(svn_ra_session_t *ra_session,
-                      const char *path,
+                      const char *repos_relpath,
                       svn_revnum_t revision,
                       svn_stream_t *stream,
                       svn_revnum_t *fetched_rev,
@@ -332,20 +332,22 @@ svn_ra_serf__get_file(svn_ra_session_t *
 
   /* Fetch properties. */
 
-  fetch_url = svn_path_url_add_component2(session->session_url.path, path,
-                                          scratch_pool);
-
-  /* The simple case is if we want HEAD - then a GET on the fetch_url is fine.
-   *
-   * Otherwise, we need to get the baseline version for this particular
-   * revision and then fetch that file.
-   */
-  if (SVN_IS_VALID_REVNUM(revision) || fetched_rev)
+  if (!SVN_IS_VALID_REVNUM(revision) && fetched_rev == NULL)
     {
-      SVN_ERR(svn_ra_serf__get_stable_url(&fetch_url, fetched_rev,
-                                          session,
-                                          fetch_url, revision,
-                                          scratch_pool, scratch_pool));
+      /* The simple case is if we want HEAD - then a GET on the fetch_url is
+       * fine. */
+      SVN_ERR(svn_ra_serf__resolve_path(ra_session, &fetch_url, repos_relpath,
+                                        scratch_pool));
+    }
+  else
+    {
+      /*
+       * Otherwise, we need to get the baseline version for this particular
+       * revision and then fetch that file.
+       */
+      SVN_ERR(svn_ra_serf__get_stable_url2(&fetch_url, fetched_rev, session,
+                                           repos_relpath, revision,
+                                           scratch_pool, scratch_pool));
       revision = SVN_INVALID_REVNUM;
     }
   /* REVISION is always SVN_INVALID_REVNUM  */
@@ -431,7 +433,7 @@ svn_ra_serf__get_file(svn_ra_session_t *
 
 svn_error_t *
 svn_ra_serf__fetch_file_contents(svn_ra_session_t *ra_session,
-                                 const char *path,
+                                 const char *repos_relpath,
                                  svn_revnum_t revision,
                                  svn_stream_t *stream,
                                  apr_pool_t *scratch_pool)
@@ -442,12 +444,9 @@ svn_ra_serf__fetch_file_contents(svn_ra_
   svn_ra_serf__handler_t *handler;
   svn_error_t *err;
 
-  fetch_url = svn_path_url_add_component2(session->session_url.path, path,
-                                          scratch_pool);
-
-  SVN_ERR(svn_ra_serf__get_stable_url(&fetch_url, NULL, session,
-                                      fetch_url, revision,
-                                      scratch_pool, scratch_pool));
+  SVN_ERR(svn_ra_serf__get_stable_url2(&fetch_url, NULL, session,
+                                       repos_relpath, revision,
+                                       scratch_pool, scratch_pool));
 
   /* Create the fetch context. */
   stream_ctx = apr_pcalloc(scratch_pool, sizeof(*stream_ctx));

Modified: 
subversion/branches/reparentless/subversion/libsvn_ra_serf/getlocations.c
==============================================================================
--- subversion/branches/reparentless/subversion/libsvn_ra_serf/getlocations.c   
Wed Sep 23 14:13:28 2026        (r1938462)
+++ subversion/branches/reparentless/subversion/libsvn_ra_serf/getlocations.c   
Wed Sep 23 18:08:06 2026        (r1938463)
@@ -155,7 +155,7 @@ create_get_locations_body(serf_bucket_t
 svn_error_t *
 svn_ra_serf__get_locations(svn_ra_session_t *ra_session,
                            apr_hash_t **locations,
-                           const char *path,
+                           const char *repos_relpath,
                            svn_revnum_t peg_revision,
                            const apr_array_header_t *location_revisions,
                            apr_pool_t *pool)
@@ -168,16 +168,16 @@ svn_ra_serf__get_locations(svn_ra_sessio
 
   loc_ctx = apr_pcalloc(pool, sizeof(*loc_ctx));
   loc_ctx->pool = pool;
-  loc_ctx->path = path;
+  loc_ctx->path = "";
   loc_ctx->peg_revision = peg_revision;
   loc_ctx->location_revisions = location_revisions;
   loc_ctx->paths = apr_hash_make(loc_ctx->pool);
 
   *locations = loc_ctx->paths;
 
-  SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
-                                      session,  NULL /* url */, peg_revision,
-                                      pool, pool));
+  SVN_ERR(svn_ra_serf__get_stable_url2(&req_url, NULL /* latest_revnum */,
+                                       session, repos_relpath, peg_revision,
+                                       pool, pool));
 
   xmlctx = svn_ra_serf__xml_context_create(getloc_ttable,
                                            NULL, getloc_closed, NULL,

Modified: 
subversion/branches/reparentless/subversion/libsvn_ra_serf/getlocationsegments.c
==============================================================================
--- 
subversion/branches/reparentless/subversion/libsvn_ra_serf/getlocationsegments.c
    Wed Sep 23 14:13:28 2026        (r1938462)
+++ 
subversion/branches/reparentless/subversion/libsvn_ra_serf/getlocationsegments.c
    Wed Sep 23 18:08:06 2026        (r1938463)
@@ -155,7 +155,7 @@ create_gls_body(serf_bucket_t **body_bkt
 
 svn_error_t *
 svn_ra_serf__get_location_segments(svn_ra_session_t *ra_session,
-                                   const char *path,
+                                   const char *repos_relpath,
                                    svn_revnum_t peg_revision,
                                    svn_revnum_t start_rev,
                                    svn_revnum_t end_rev,
@@ -171,16 +171,16 @@ svn_ra_serf__get_location_segments(svn_r
   svn_error_t *err;
 
   gls_ctx = apr_pcalloc(pool, sizeof(*gls_ctx));
-  gls_ctx->path = path;
+  gls_ctx->path = "";
   gls_ctx->peg_revision = peg_revision;
   gls_ctx->start_rev = start_rev;
   gls_ctx->end_rev = end_rev;
   gls_ctx->receiver = receiver;
   gls_ctx->receiver_baton = receiver_baton;
 
-  SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
-                                      session, NULL /* url */, peg_revision,
-                                      pool, pool));
+  SVN_ERR(svn_ra_serf__get_stable_url2(&req_url, NULL /* latest_revnum */,
+                                       session, repos_relpath, peg_revision,
+                                       pool, pool));
 
   xmlctx = svn_ra_serf__xml_context_create(gls_ttable,
                                            NULL, gls_closed, NULL,

Modified: 
subversion/branches/reparentless/subversion/libsvn_ra_serf/inherited_props.c
==============================================================================
--- 
subversion/branches/reparentless/subversion/libsvn_ra_serf/inherited_props.c    
    Wed Sep 23 14:13:28 2026        (r1938462)
+++ 
subversion/branches/reparentless/subversion/libsvn_ra_serf/inherited_props.c    
    Wed Sep 23 18:08:06 2026        (r1938463)
@@ -233,14 +233,12 @@ typedef struct iprop_rq_info_t
 static svn_error_t *
 get_iprops_via_more_requests(svn_ra_session_t *ra_session,
                              apr_array_header_t **iprops,
-                             const char *session_url,
-                             const char *path,
+                             const char *repos_relpath,
                              svn_revnum_t revision,
                              apr_pool_t *result_pool,
                              apr_pool_t *scratch_pool)
 {
   svn_ra_serf__session_t *session = ra_session->priv;
-  const char *url;
   const char *relpath;
   apr_array_header_t *rq_info;
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
@@ -250,12 +248,7 @@ get_iprops_via_more_requests(svn_ra_sess
 
   rq_info = apr_array_make(scratch_pool, 16, sizeof(iprop_rq_info_t *));
 
-  if (!svn_path_is_empty(path))
-    url = svn_path_url_add_component2(session_url, path, scratch_pool);
-  else
-    url = session_url;
-
-  relpath = svn_uri_skip_ancestor(session->repos_root_str, url, scratch_pool);
+  relpath = repos_relpath;
 
   /* Create all requests */
   while (relpath[0] != '\0')
@@ -267,12 +260,9 @@ get_iprops_via_more_requests(svn_ra_sess
       rq->relpath = relpath;
       rq->props = apr_hash_make(scratch_pool);
 
-      SVN_ERR(svn_ra_serf__get_stable_url(&rq->urlpath, NULL, session,
-                                          svn_path_url_add_component2(
-                                                session->repos_root.path,
-                                                relpath, scratch_pool),
-                                          revision,
-                                          scratch_pool, scratch_pool));
+      SVN_ERR(svn_ra_serf__get_stable_url2(&rq->urlpath, NULL, session,
+                                           relpath, revision, scratch_pool,
+                                           scratch_pool));
 
       SVN_ERR(svn_ra_serf__create_propfind_handler(
                                           &rq->handler, session,
@@ -348,7 +338,7 @@ get_iprops_via_more_requests(svn_ra_sess
 svn_error_t *
 svn_ra_serf__get_inherited_props(svn_ra_session_t *ra_session,
                                  apr_array_header_t **iprops,
-                                 const char *path,
+                                 const char *repos_relpath,
                                  svn_revnum_t revision,
                                  apr_pool_t *result_pool,
                                  apr_pool_t *scratch_pool)
@@ -366,40 +356,19 @@ svn_ra_serf__get_inherited_props(svn_ra_
 
   if (!iprop_capable)
     {
-      svn_error_t *err;
-      const char *reparent_uri = NULL;
-      const char *session_uri;
-      const char *repos_root_url;
-
-      SVN_ERR(svn_ra_serf__get_repos_root(ra_session, &repos_root_url,
-                                          scratch_pool));
-
-      session_uri = apr_pstrdup(scratch_pool, session->session_url_str);
-      if (strcmp(repos_root_url, session->session_url_str) != 0)
-        {
-          reparent_uri  = session_uri;
-          SVN_ERR(svn_ra_serf__reparent(ra_session, repos_root_url,
-                                        scratch_pool));
-        }
-
-      err = get_iprops_via_more_requests(ra_session, iprops, session_uri, path,
-                                         revision, result_pool, scratch_pool);
-
-      if (reparent_uri)
-        err = svn_error_compose_create(err,
-                                       svn_ra_serf__reparent(ra_session,
-                                                             reparent_uri ,
-                                                             scratch_pool));
+      SVN_ERR(get_iprops_via_more_requests(ra_session, iprops, repos_relpath,
+                                           revision, result_pool,
+                                           scratch_pool));
 
-      return svn_error_trace(err);
+      return SVN_NO_ERROR;
     }
 
-  SVN_ERR(svn_ra_serf__get_stable_url(&req_url,
-                                      NULL /* latest_revnum */,
-                                      session,
-                                      NULL /* url */,
-                                      revision,
-                                      scratch_pool, scratch_pool));
+  SVN_ERR(svn_ra_serf__get_stable_url2(&req_url,
+                                       NULL /* latest_revnum */,
+                                       session,
+                                       repos_relpath,
+                                       revision,
+                                       scratch_pool, scratch_pool));
 
   SVN_ERR_ASSERT(session->repos_root_str);
 
@@ -410,7 +379,7 @@ svn_ra_serf__get_inherited_props(svn_ra_
   iprops_ctx->curr_iprop = NULL;
   iprops_ctx->iprops = apr_array_make(result_pool, 1,
                                        sizeof(svn_prop_inherited_item_t *));
-  iprops_ctx->path = path;
+  iprops_ctx->path = "";
   iprops_ctx->revision = revision;
 
   xmlctx = svn_ra_serf__xml_context_create(iprops_table,

Modified: subversion/branches/reparentless/subversion/libsvn_ra_serf/list.c
==============================================================================
--- subversion/branches/reparentless/subversion/libsvn_ra_serf/list.c   Wed Sep 
23 14:13:28 2026        (r1938462)
+++ subversion/branches/reparentless/subversion/libsvn_ra_serf/list.c   Wed Sep 
23 18:08:06 2026        (r1938463)
@@ -230,7 +230,7 @@ create_list_body(serf_bucket_t **body_bk
 
 svn_error_t *
 svn_ra_serf__list(svn_ra_session_t *ra_session,
-                  const char *path,
+                  const char *repos_relpath,
                   svn_revnum_t revision,
                   const apr_array_header_t *patterns,
                   svn_depth_t depth,
@@ -249,7 +249,7 @@ svn_ra_serf__list(svn_ra_session_t *ra_s
   list_ctx->pool = scratch_pool;
   list_ctx->receiver = receiver;
   list_ctx->receiver_baton = receiver_baton;
-  list_ctx->path = path;
+  list_ctx->path = "";
   list_ctx->revision = revision;
   list_ctx->patterns = patterns;
   list_ctx->depth = depth;
@@ -261,10 +261,10 @@ svn_ra_serf__list(svn_ra_session_t *ra_s
   /* At this point, we may have a deleted file.  So, we'll match ra_neon's
    * behavior and use the larger of start or end as our 'peg' rev.
    */
-  SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
-                                      session,
-                                      NULL /* url */, revision,
-                                      scratch_pool, scratch_pool));
+  SVN_ERR(svn_ra_serf__get_stable_url2(&req_url, NULL /* latest_revnum */,
+                                       session, repos_relpath,
+                                       revision,
+                                       scratch_pool, scratch_pool));
 
   xmlctx = svn_ra_serf__xml_context_create(log_ttable,
                                            NULL, item_closed, NULL,

Reply via email to