Author: rinrab
Date: Sun Sep 20 10:17:56 2026
New Revision: 1938388

Log:
On the 'reparentless' branch: Use reparentless API for cat and pristine fetch.

* subversion/libsvn_client/cat.c
  (svn_client_cat3): Resolve repos_relpath and bump svn_ra_get_file ->
   svn_ra_get_file2.
* subversion/libsvn_client/textbase.c
  (textbase_fetch_cb): Bump svn_ra_fetch_file_contents ->
   svn_ra_fetch_file_contents2 and shamelessly delete all reparenting logic.
  (svn_client__textbase_sync): More reparents gone.

Modified:
   subversion/branches/reparentless/subversion/libsvn_client/cat.c
   subversion/branches/reparentless/subversion/libsvn_client/textbase.c

Modified: subversion/branches/reparentless/subversion/libsvn_client/cat.c
==============================================================================
--- subversion/branches/reparentless/subversion/libsvn_client/cat.c     Sun Sep 
20 09:51:21 2026        (r1938387)
+++ subversion/branches/reparentless/subversion/libsvn_client/cat.c     Sun Sep 
20 10:17:56 2026        (r1938388)
@@ -191,7 +191,7 @@ svn_client_cat3(apr_hash_t **returned_pr
   svn_string_t *eol_style;
   svn_string_t *keywords;
   apr_hash_t *props = NULL;
-  const char *repos_root_url;
+  const char *repos_root_url, *repos_relpath;
   svn_stream_t *output = out;
   svn_error_t *err;
 
@@ -253,10 +253,13 @@ svn_client_cat3(apr_hash_t **returned_pr
   /* Find the repos root URL */
   SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root_url, scratch_pool));
 
+  /* Resolve relative path in a repository */
+  repos_relpath = svn_uri_skip_ancestor(repos_root_url, loc->url, 
scratch_pool);
+
   /* Grab some properties we need to know in order to figure out if anything
      special needs to be done with this file. */
-  err = svn_ra_get_file(ra_session, "", loc->rev, NULL, NULL, &props,
-                        result_pool);
+  err = svn_ra_get_file2(ra_session, repos_relpath, loc->rev, NULL, NULL,
+                         &props, result_pool);
   if (err)
     {
       if (err->apr_err == SVN_ERR_FS_NOT_FILE)
@@ -336,8 +339,8 @@ svn_client_cat3(apr_hash_t **returned_pr
       *returned_props = props;
     }
 
-  SVN_ERR(svn_ra_get_file(ra_session, "", loc->rev, output, NULL, NULL,
-                          scratch_pool));
+  SVN_ERR(svn_ra_get_file2(ra_session, repos_relpath, loc->rev, output, NULL,
+                           NULL, scratch_pool));
 
   if (out != output)
     /* Close the interjected stream */

Modified: subversion/branches/reparentless/subversion/libsvn_client/textbase.c
==============================================================================
--- subversion/branches/reparentless/subversion/libsvn_client/textbase.c        
Sun Sep 20 09:51:21 2026        (r1938387)
+++ subversion/branches/reparentless/subversion/libsvn_client/textbase.c        
Sun Sep 20 10:17:56 2026        (r1938388)
@@ -47,15 +47,13 @@ textbase_fetch_cb(void *baton,
                   apr_pool_t *scratch_pool)
 {
   struct textbase_fetch_baton_t *b = baton;
-  const char *url;
-  const char *old_url;
-
-  url = svn_path_url_add_component2(repos_root_url, repos_relpath,
-                                    scratch_pool);
 
   if (!b->ra_session)
     {
       svn_ra_session_t *session;
+      const char *url = svn_path_url_add_component2(repos_root_url,
+                                                    repos_relpath,
+                                                    scratch_pool);
 
       SVN_ERR(svn_client__open_ra_session_internal(&session, NULL,
                                                    url, b->base_abspath,
@@ -64,10 +62,9 @@ textbase_fetch_cb(void *baton,
       b->ra_session = session;
     }
 
-  SVN_ERR(svn_client__ensure_ra_session_url(&old_url, b->ra_session, url,
-                                            scratch_pool));
-  SVN_ERR(svn_ra_fetch_file_contents(b->ra_session, "", revision, contents,
-                                     scratch_pool));
+
+  SVN_ERR(svn_ra_fetch_file_contents2(b->ra_session, repos_relpath, revision,
+                                      contents, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -83,7 +80,6 @@ svn_client__textbase_sync(svn_ra_session
                           apr_pool_t *scratch_pool)
 {
   textbase_fetch_baton_t fetch_baton = {0};
-  const char *old_session_url = NULL;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
@@ -99,9 +95,6 @@ svn_client__textbase_sync(svn_ra_session
   fetch_baton.ctx = ctx;
   fetch_baton.ra_session = ra_session;
 
-  if (ra_session)
-    SVN_ERR(svn_ra_get_session_url(ra_session, &old_session_url, 
scratch_pool));
-
   SVN_ERR(svn_wc_textbase_sync(ctx->wc_ctx, local_abspath,
                                allow_hydrate, allow_dehydrate,
                                textbase_fetch_cb, &fetch_baton,
@@ -109,9 +102,6 @@ svn_client__textbase_sync(svn_ra_session
                                ctx->notify_func2, ctx->notify_baton2,
                                scratch_pool));
 
-  if (ra_session)
-    SVN_ERR(svn_ra_reparent(ra_session, old_session_url, scratch_pool));
-
   if (ra_session_p)
     *ra_session_p = fetch_baton.ra_session;
 

Reply via email to