You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ko...@apache.org on 2022/12/01 09:57:44 UTC

svn commit: r1905659 - in /subversion/branches/pristines-on-demand-on-mwf/subversion: include/private/svn_wc_private.h libsvn_client/textbase.c libsvn_wc/textbase.c libsvn_wc/wc_db.h libsvn_wc/wc_db_textbase.c

Author: kotkov
Date: Thu Dec  1 09:57:44 2022
New Revision: 1905659

URL: http://svn.apache.org/viewvc?rev=1905659&view=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Rename "hydrate callback" to
a "fetch callback".

Our callbacks currently only fetch the contents, whereas hydrating is a
composite operation that involves fetching the contents *and* marking the
pristine as hydrated in the working copy.  So let's use a more appropriate
name for them.

* subversion/include/private/svn_wc_private.h
  (svn_wc__textbase_hydrate_cb_t): Rename …
  (svn_wc__textbase_fetch_cb_t): …to this.
  (svn_wc__textbase_sync): Rename `hydrate_callback` and `hydrate_baton`
   to `fetch_callback` and `fetch_baton` respectively.

* subversion/libsvn_client/textbase.c
  (textbase_hydrate_baton_t, textbase_hydrate_cb): Rename …
  (textbase_fetch_baton_t, textbase_fetch_cb): …to this.
  (svn_client__textbase_sync): Use new names.  Rename `baton` to `fetch_baton`.

* subversion/libsvn_wc/textbase.c
  (textbase_hydrate_cb): Rename …
  (textbase_fetch_cb): …to this.
  (textbase_sync_baton_t, svn_wc__textbase_sync): Use new names.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_textbase_hydrate_cb_t): Rename …
  (svn_wc__db_textbase_fetch_cb_t): …to this.
  (svn_wc__db_textbase_sync): Rename `hydrate_callback` and `hydrate_baton`
   to `fetch_callback` and `fetch_baton` respectively.

* subversion/libsvn_wc/wc_db_textbase.c
  (textbase_hydrate, svn_wc__db_textbase_sync): Use new names.

Modified:
    subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h
    subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h?rev=1905659&r1=1905658&r2=1905659&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h Thu Dec  1 09:57:44 2022
@@ -2323,7 +2323,7 @@ svn_wc__upgrade(svn_wc_context_t *wc_ctx
 
 /* The callback invoked by svn_wc__textbase_sync() to fetch the text-base
    contents identified by REPOS_ROOT_URL, REPOS_RELPATH and REVISION. */
-typedef svn_error_t *(*svn_wc__textbase_hydrate_cb_t)(
+typedef svn_error_t *(*svn_wc__textbase_fetch_cb_t)(
   void *baton,
   const char *repos_root_url,
   const char *repos_relpath,
@@ -2335,15 +2335,15 @@ typedef svn_error_t *(*svn_wc__textbase_
 
 /* Synchronize the state of the text-base contents for the LOCAL_ABSPATH tree.
    If ALLOW_HYDRATE is true, fetch the required but missing text-base contents
-   using the provided HYDRATE_CALLBACK and HYDRATE_BATON.  If ALLOW_DEHYDRATE
+   using the provided FETCH_CALLBACK and FETCH_BATON.  If ALLOW_DEHYDRATE
    is true, remove the on disk text-base contents that is not required. */
 svn_error_t *
 svn_wc__textbase_sync(svn_wc_context_t *wc_ctx,
                       const char *local_abspath,
                       svn_boolean_t allow_hydrate,
                       svn_boolean_t allow_dehydrate,
-                      svn_wc__textbase_hydrate_cb_t hydrate_callback,
-                      void *hydrate_baton,
+                      svn_wc__textbase_fetch_cb_t fetch_callback,
+                      void *fetch_baton,
                       svn_cancel_func_t cancel_func,
                       void *cancel_baton,
                       apr_pool_t *scratch_pool);

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c?rev=1905659&r1=1905658&r2=1905659&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c Thu Dec  1 09:57:44 2022
@@ -27,27 +27,27 @@
 
 #include "client.h"
 
-/* A baton for use with textbase_hydrate_cb(). */
-typedef struct textbase_hydrate_baton_t
+/* A baton for use with textbase_fetch_cb(). */
+typedef struct textbase_fetch_baton_t
 {
   apr_pool_t *result_pool;
   const char *base_abspath;
   svn_client_ctx_t *ctx;
   svn_ra_session_t *ra_session;
-} textbase_hydrate_baton_t;
+} textbase_fetch_baton_t;
 
-/* Implements svn_wc__textbase_hydrate_cb_t. */
+/* Implements svn_wc__textbase_fetch_cb_t. */
 static svn_error_t *
-textbase_hydrate_cb(void *baton,
-                    const char *repos_root_url,
-                    const char *repos_relpath,
-                    svn_revnum_t revision,
-                    svn_stream_t *contents,
-                    svn_cancel_func_t cancel_func,
-                    void *cancel_baton,
-                    apr_pool_t *scratch_pool)
+textbase_fetch_cb(void *baton,
+                  const char *repos_root_url,
+                  const char *repos_relpath,
+                  svn_revnum_t revision,
+                  svn_stream_t *contents,
+                  svn_cancel_func_t cancel_func,
+                  void *cancel_baton,
+                  apr_pool_t *scratch_pool)
 {
-  struct textbase_hydrate_baton_t *b = baton;
+  struct textbase_fetch_baton_t *b = baton;
   const char *url;
   const char *old_url;
 
@@ -93,7 +93,7 @@ svn_client__textbase_sync(svn_ra_session
                           apr_pool_t *result_pool,
                           apr_pool_t *scratch_pool)
 {
-  textbase_hydrate_baton_t baton = {0};
+  textbase_fetch_baton_t fetch_baton = {0};
   const char *old_session_url = NULL;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
@@ -102,13 +102,13 @@ svn_client__textbase_sync(svn_ra_session
      If that's the case, use the result pool.  Otherwise, the session
      is temporary, so use the scratch pool. */
   if (ra_session_p)
-    baton.result_pool = result_pool;
+    fetch_baton.result_pool = result_pool;
   else
-    baton.result_pool = scratch_pool;
+    fetch_baton.result_pool = scratch_pool;
 
-  baton.base_abspath = local_abspath;
-  baton.ctx = ctx;
-  baton.ra_session = ra_session;
+  fetch_baton.base_abspath = local_abspath;
+  fetch_baton.ctx = ctx;
+  fetch_baton.ra_session = ra_session;
 
   if (ctx->notify_func2 && allow_hydrate)
     {
@@ -123,7 +123,7 @@ svn_client__textbase_sync(svn_ra_session
 
   SVN_ERR(svn_wc__textbase_sync(ctx->wc_ctx, local_abspath,
                                 allow_hydrate, allow_dehydrate,
-                                textbase_hydrate_cb, &baton,
+                                textbase_fetch_cb, &fetch_baton,
                                 ctx->cancel_func, ctx->cancel_baton,
                                 scratch_pool));
 
@@ -139,7 +139,7 @@ svn_client__textbase_sync(svn_ra_session
     }
 
   if (ra_session_p)
-    *ra_session_p = baton.ra_session;
+    *ra_session_p = fetch_baton.ra_session;
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c?rev=1905659&r1=1905658&r2=1905659&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c Thu Dec  1 09:57:44 2022
@@ -460,8 +460,8 @@ svn_wc__textbase_prepare_install(svn_str
 typedef struct textbase_sync_baton_t
 {
   svn_wc__db_t *db;
-  svn_wc__textbase_hydrate_cb_t hydrate_callback;
-  void *hydrate_baton;
+  svn_wc__textbase_fetch_cb_t fetch_callback;
+  void *fetch_baton;
 } textbase_sync_baton_t;
 
 /* Decide whether the text base should be referenced (or "pinned")
@@ -508,22 +508,22 @@ textbase_walk_cb(svn_boolean_t *referenc
   return SVN_NO_ERROR;
 }
 
-/* Implements svn_wc__db_textbase_hydrate_cb_t. */
+/* Implements svn_wc__db_textbase_fetch_cb_t. */
 static svn_error_t *
-textbase_hydrate_cb(void *baton,
-                    const char *repos_root_url,
-                    const char *repos_relpath,
-                    svn_revnum_t revision,
-                    svn_stream_t *contents,
-                    svn_cancel_func_t cancel_func,
-                    void *cancel_baton,
-                    apr_pool_t *scratch_pool)
+textbase_fetch_cb(void *baton,
+                  const char *repos_root_url,
+                  const char *repos_relpath,
+                  svn_revnum_t revision,
+                  svn_stream_t *contents,
+                  svn_cancel_func_t cancel_func,
+                  void *cancel_baton,
+                  apr_pool_t *scratch_pool)
 {
   textbase_sync_baton_t *b = baton;
 
-  SVN_ERR(b->hydrate_callback(b->hydrate_baton, repos_root_url,
-                              repos_relpath, revision, contents,
-                              cancel_func, cancel_baton, scratch_pool));
+  SVN_ERR(b->fetch_callback(b->fetch_baton, repos_root_url,
+                            repos_relpath, revision, contents,
+                            cancel_func, cancel_baton, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -533,8 +533,8 @@ svn_wc__textbase_sync(svn_wc_context_t *
                       const char *local_abspath,
                       svn_boolean_t allow_hydrate,
                       svn_boolean_t allow_dehydrate,
-                      svn_wc__textbase_hydrate_cb_t hydrate_callback,
-                      void *hydrate_baton,
+                      svn_wc__textbase_fetch_cb_t fetch_callback,
+                      void *fetch_baton,
                       svn_cancel_func_t cancel_func,
                       void *cancel_baton,
                       apr_pool_t *scratch_pool)
@@ -550,8 +550,8 @@ svn_wc__textbase_sync(svn_wc_context_t *
     return SVN_NO_ERROR;
 
   baton.db = wc_ctx->db;
-  baton.hydrate_callback = hydrate_callback;
-  baton.hydrate_baton = hydrate_baton;
+  baton.fetch_callback = fetch_callback;
+  baton.fetch_baton = fetch_baton;
 
   SVN_ERR(svn_wc__db_textbase_walk(wc_ctx->db, local_abspath,
                                    textbase_walk_cb, &baton,
@@ -560,7 +560,7 @@ svn_wc__textbase_sync(svn_wc_context_t *
 
   SVN_ERR(svn_wc__db_textbase_sync(wc_ctx->db, local_abspath,
                                    allow_hydrate, allow_dehydrate,
-                                   textbase_hydrate_cb, &baton,
+                                   textbase_fetch_cb, &baton,
                                    cancel_func, cancel_baton,
                                    scratch_pool));
 

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h?rev=1905659&r1=1905658&r2=1905659&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h Thu Dec  1 09:57:44 2022
@@ -3148,7 +3148,7 @@ svn_wc__db_textbase_walk(svn_wc__db_t *d
                          apr_pool_t *scratch_pool);
 
 /* The callback invoked by svn_wc__db_textbase_sync(). */
-typedef svn_error_t * (*svn_wc__db_textbase_hydrate_cb_t)(
+typedef svn_error_t * (*svn_wc__db_textbase_fetch_cb_t)(
   void *baton,
   const char *repos_root_url,
   const char *repos_relpath,
@@ -3161,7 +3161,7 @@ typedef svn_error_t * (*svn_wc__db_textb
 /* Synchronize the state of the text-bases in DB.
 
    If ALLOW_HYDRATE is true, fetch the referenced but missing text-base
-   contents using the provided HYDRATE_CALLBACK and HYDRATE_BATON.
+   contents using the provided FETCH_CALLBACK and FETCH_BATON.
    If ALLOW_DEHYDRATE is true, remove the on disk text-base contents
    that is no longer referenced.
  */
@@ -3170,8 +3170,8 @@ svn_wc__db_textbase_sync(svn_wc__db_t *d
                          const char *local_abspath,
                          svn_boolean_t allow_hydrate,
                          svn_boolean_t allow_dehydrate,
-                         svn_wc__db_textbase_hydrate_cb_t hydrate_callback,
-                         void *hydrate_baton,
+                         svn_wc__db_textbase_fetch_cb_t fetch_callback,
+                         void *fetch_baton,
                          svn_cancel_func_t cancel_func,
                          void *cancel_baton,
                          apr_pool_t *scratch_pool);

Modified: subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c
URL: http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c?rev=1905659&r1=1905658&r2=1905659&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c (original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c Thu Dec  1 09:57:44 2022
@@ -161,8 +161,8 @@ svn_wc__db_textbase_walk(svn_wc__db_t *d
 
 static svn_error_t *
 textbase_hydrate(svn_wc__db_wcroot_t *wcroot,
-                 svn_wc__db_textbase_hydrate_cb_t hydrate_callback,
-                 void *hydrate_baton,
+                 svn_wc__db_textbase_fetch_cb_t fetch_callback,
+                 void *fetch_baton,
                  svn_cancel_func_t cancel_func,
                  void *cancel_baton,
                  const svn_checksum_t *checksum,
@@ -182,11 +182,11 @@ textbase_hydrate(svn_wc__db_wcroot_t *wc
             &install_sha1_checksum, &install_md5_checksum,
             wcroot, TRUE, scratch_pool, scratch_pool));
 
-  err = hydrate_callback(hydrate_baton, repos_root_url,
-                         repos_relpath, revision,
-                         install_stream,
-                         cancel_func, cancel_baton,
-                         scratch_pool);
+  err = fetch_callback(fetch_baton, repos_root_url,
+                       repos_relpath, revision,
+                       install_stream,
+                       cancel_func, cancel_baton,
+                       scratch_pool);
   if (err)
     return svn_error_compose_create(err,
              svn_wc__db_pristine_install_abort(install_data, scratch_pool));
@@ -217,8 +217,8 @@ svn_wc__db_textbase_sync(svn_wc__db_t *d
                          const char *local_abspath,
                          svn_boolean_t allow_hydrate,
                          svn_boolean_t allow_dehydrate,
-                         svn_wc__db_textbase_hydrate_cb_t hydrate_callback,
-                         void *hydrate_baton,
+                         svn_wc__db_textbase_fetch_cb_t fetch_callback,
+                         void *fetch_baton,
                          svn_cancel_func_t cancel_func,
                          void *cancel_baton,
                          apr_pool_t *scratch_pool)
@@ -320,7 +320,7 @@ svn_wc__db_textbase_sync(svn_wc__db_t *d
                            svn_checksum_to_cstring_display(checksum, iterpool));
                 }
 
-              err = textbase_hydrate(wcroot, hydrate_callback, hydrate_baton,
+              err = textbase_hydrate(wcroot, fetch_callback, fetch_baton,
                                      cancel_func, cancel_baton, checksum,
                                      repos_root_url, repos_relpath, revision,
                                      iterpool);