Author: kotkov
Date: Thu Jan 19 18:49:23 2023
New Revision: 1906819

URL: http://svn.apache.org/viewvc?rev=1906819&view=rev
Log:
On the 'pristine-checksum-kind' branch: Lay some groundwork for making the
working copy pristine checksum kind configurable by renaming variables that
include the checksum type in their names, such as `sha1_checksum`.
Rename a couple of internal functions and related names as well.

No functional changes are intended.

* subversion/include/private/svn_wc_private.h
  (svn_wc__node_get_md5_from_sha1): Rename …
  (svn_wc__node_get_md5): …to this.  Adjust the argument name.

* subversion/libsvn_wc/node.c
  (svn_wc__node_get_md5_from_sha1): Rename …
  (svn_wc__node_get_md5): …to this.  Adjust the argument name.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_pristine_get_sha1): Rename …
  (svn_wc__db_pristine_lookup_by_md5): …to this.  Adjust the argument name.

* subversion/libsvn_wc/wc_db_pristine.c:
  (svn_wc__db_pristine_get_sha1): Rename …
  (svn_wc__db_pristine_lookup_by_md5): …to this.  Adjust the argument name.

* subversion/libsvn_wc/adm_crawler.c
  (svn_wc__internal_transmit_text_deltas): Rename `verify_checksum` to
   `verify_md5_checksum`.

* subversion/libsvn_client/client.h,
* subversion/libsvn_client/commit.c,
* subversion/libsvn_client/commit_util.c,
* subversion/libsvn_client/deprecated.c,
* subversion/libsvn_wc/adm_crawler.c,
* subversion/libsvn_wc/adm_ops.c,
* subversion/libsvn_wc/deprecated.c,
* subversion/libsvn_wc/externals.c,
* subversion/libsvn_wc/textbase.h,
* subversion/libsvn_wc/textbase.c,
* subversion/libsvn_wc/update_editor.c,
* subversion/libsvn_wc/wc.h,
* subversion/libsvn_wc/wc_db.h,
* subversion/libsvn_wc/wc_db_private.h,
* subversion/libsvn_wc/wc_db.c,
* subversion/libsvn_wc/wc_db_pristine.c,
* subversion/libsvn_wc/wc_db_textbase.c,
* subversion/tests/libsvn_wc/pristine-store-test.c:
  (): Rename variables such as `sha1_checksum` to `checksum`.
  Update the related names and comments.

Modified:
    
subversion/branches/pristine-checksum-kind/subversion/include/private/svn_wc_private.h
    subversion/branches/pristine-checksum-kind/subversion/libsvn_client/client.h
    subversion/branches/pristine-checksum-kind/subversion/libsvn_client/commit.c
    
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/commit_util.c
    
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/deprecated.c
    
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/adm_crawler.c
    subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/adm_ops.c
    subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/deprecated.c
    subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/externals.c
    subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/node.c
    subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/textbase.c
    subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/textbase.h
    
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/update_editor.c
    subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc.h
    subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db.c
    subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db.h
    
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_pristine.c
    
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_private.h
    
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_textbase.c
    
subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_wc/pristine-store-test.c

Modified: 
subversion/branches/pristine-checksum-kind/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/include/private/svn_wc_private.h?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/include/private/svn_wc_private.h
 (original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/include/private/svn_wc_private.h
 Thu Jan 19 18:49:23 2023
@@ -1027,18 +1027,18 @@ svn_wc__node_get_commit_status(svn_boole
                                apr_pool_t *result_pool,
                                apr_pool_t *scratch_pool);
 
-/* Gets the md5 checksum for the pristine file identified by a sha1_checksum 
in the
+/* Gets the md5 checksum for the pristine file identified by checksum in the
    working copy identified by wri_abspath.
 
    Wraps svn_wc__db_pristine_get_md5().
  */
 svn_error_t *
-svn_wc__node_get_md5_from_sha1(const svn_checksum_t **md5_checksum,
-                               svn_wc_context_t *wc_ctx,
-                               const char *wri_abspath,
-                               const svn_checksum_t *sha1_checksum,
-                               apr_pool_t *result_pool,
-                               apr_pool_t *scratch_pool);
+svn_wc__node_get_md5(const svn_checksum_t **md5_checksum,
+                     svn_wc_context_t *wc_ctx,
+                     const char *wri_abspath,
+                     const svn_checksum_t *checksum,
+                     apr_pool_t *result_pool,
+                     apr_pool_t *scratch_pool);
 
 /* Like svn_wc_get_pristine_contents3(), but keyed on the CHECKSUM
    rather than on the local absolute path of the working file.

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/client.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_client/client.h?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/client.h 
(original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/client.h 
Thu Jan 19 18:49:23 2023
@@ -910,9 +910,9 @@ svn_client__condense_commit_items2(const
    NOTIFY_PATH_PREFIX will be passed to CTX->notify_func2() as the
    common absolute path prefix of the committed paths.  It can be NULL.
 
-   If SHA1_CHECKSUMS is not NULL, set *SHA1_CHECKSUMS to a hash containing,
+   If CHECKSUMS is not NULL, set *CHECKSUMS to a hash containing,
    for each file transmitted, a mapping from the commit-item's (const
-   char *) path to the (const svn_checksum_t *) SHA1 checksum of its new text
+   char *) path to the (const svn_checksum_t *) checksum of its new text
    base.
 
    Use RESULT_POOL for all allocating the resulting hashes and SCRATCH_POOL
@@ -924,7 +924,7 @@ svn_client__do_commit(const char *base_u
                       const svn_delta_editor_t *editor,
                       void *edit_baton,
                       const char *notify_path_prefix,
-                      apr_hash_t **sha1_checksums,
+                      apr_hash_t **checksums,
                       svn_client_ctx_t *ctx,
                       apr_pool_t *result_pool,
                       apr_pool_t *scratch_pool);

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/commit.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_client/commit.c?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/commit.c 
(original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/commit.c 
Thu Jan 19 18:49:23 2023
@@ -227,7 +227,7 @@ post_process_commit_item(svn_wc_committe
                          svn_boolean_t keep_changelists,
                          svn_boolean_t keep_locks,
                          svn_boolean_t commit_as_operations,
-                         const svn_checksum_t *sha1_checksum,
+                         const svn_checksum_t *checksum,
                          apr_pool_t *scratch_pool)
 {
   svn_boolean_t loop_recurse = FALSE;
@@ -261,7 +261,7 @@ post_process_commit_item(svn_wc_committe
                                         | SVN_CLIENT_COMMIT_ITEM_PROP_MODS)),
                                  item->incoming_prop_changes,
                                  remove_lock, !keep_changelists,
-                                 sha1_checksum, scratch_pool));
+                                 checksum, scratch_pool));
 }
 
 /* Given a list of committables described by their common base abspath
@@ -616,7 +616,7 @@ svn_client__wc_replay(const char *src_wc
   /* BASE_URL is only used here in notifications & errors */
   SVN_ERR(svn_client__do_commit(base_url, commit_items,
                                 editor, edit_baton,
-                                NULL /*notify_prefix*/, NULL 
/*sha1_checksums*/,
+                                NULL /*notify_prefix*/, NULL /*checksums*/,
                                 ctx, pool, pool));
   ctx->notify_func2 = saved_notify_func;
   ctx->notify_baton2 = saved_notify_baton;
@@ -650,7 +650,7 @@ svn_client_commit6(const apr_array_heade
   apr_array_header_t *locks_obtained;
   apr_hash_t *committables_by_path;
   apr_hash_t *lock_tokens;
-  apr_hash_t *sha1_checksums;
+  apr_hash_t *checksums;
   apr_array_header_t *commit_items;
   svn_error_t *cmt_err = SVN_NO_ERROR;
   svn_error_t *bump_err = SVN_NO_ERROR;
@@ -999,7 +999,7 @@ svn_client_commit6(const apr_array_heade
   /* Perform the commit. */
   cmt_err = svn_error_trace(
               svn_client__do_commit(base_url, commit_items, editor, edit_baton,
-                                    notify_prefix, &sha1_checksums, ctx, pool,
+                                    notify_prefix, &checksums, ctx, pool,
                                     iterpool));
 
   /* Handle a successful commit. */
@@ -1020,7 +1020,7 @@ svn_client_commit6(const apr_array_heade
           bump_err = post_process_commit_item(
                        queue, item, ctx->wc_ctx,
                        keep_changelists, keep_locks, commit_as_operations,
-                       svn_hash_gets(sha1_checksums, item->path),
+                       svn_hash_gets(checksums, item->path),
                        iterpool);
           if (bump_err)
             goto cleanup;

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/commit_util.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_client/commit_util.c?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/commit_util.c
 (original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/commit_util.c
 Thu Jan 19 18:49:23 2023
@@ -1862,7 +1862,7 @@ svn_client__do_commit(const char *base_u
                       const svn_delta_editor_t *editor,
                       void *edit_baton,
                       const char *notify_path_prefix,
-                      apr_hash_t **sha1_checksums,
+                      apr_hash_t **checksums,
                       svn_client_ctx_t *ctx,
                       apr_pool_t *result_pool,
                       apr_pool_t *scratch_pool)
@@ -1877,8 +1877,8 @@ svn_client__do_commit(const char *base_u
     apr_array_make(scratch_pool, commit_items->nelts, sizeof(const char *));
 
   /* Ditto for the checksums. */
-  if (sha1_checksums)
-    *sha1_checksums = apr_hash_make(result_pool);
+  if (checksums)
+    *checksums = apr_hash_make(result_pool);
 
   /* Build a hash from our COMMIT_ITEMS array, keyed on the
      relative paths (which come from the item URLs).  And
@@ -1911,7 +1911,7 @@ svn_client__do_commit(const char *base_u
       struct file_mod_t *mod = apr_hash_this_val(hi);
       const svn_client_commit_item3_t *item = mod->item;
       const svn_checksum_t *new_text_base_md5_checksum;
-      const svn_checksum_t *new_text_base_sha1_checksum;
+      const svn_checksum_t *new_text_base_checksum;
       svn_boolean_t fulltext = FALSE;
       svn_error_t *err;
 
@@ -1938,7 +1938,7 @@ svn_client__do_commit(const char *base_u
         fulltext = TRUE;
 
       err = svn_wc_transmit_text_deltas4(&new_text_base_md5_checksum,
-                                         &new_text_base_sha1_checksum,
+                                         &new_text_base_checksum,
                                          ctx->wc_ctx, item->path,
                                          fulltext, editor, mod->file_baton,
                                          result_pool, iterpool);
@@ -1953,8 +1953,8 @@ svn_client__do_commit(const char *base_u
                                                     err, ctx, scratch_pool));
         }
 
-      if (sha1_checksums)
-        svn_hash_sets(*sha1_checksums, item->path, 
new_text_base_sha1_checksum);
+      if (checksums)
+        svn_hash_sets(*checksums, item->path, new_text_base_checksum);
 
       svn_pool_destroy(mod->file_pool);
     }

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/deprecated.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_client/deprecated.c?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/deprecated.c
 (original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/deprecated.c
 Thu Jan 19 18:49:23 2023
@@ -2890,11 +2890,11 @@ info_from_info2(svn_info_t **new_info,
     {
       const svn_checksum_t *md5_checksum;
 
-      SVN_ERR(svn_wc__node_get_md5_from_sha1(&md5_checksum,
-                                             wc_ctx,
-                                             info2->wc_info->wcroot_abspath,
-                                             info2->wc_info->checksum,
-                                             pool, pool));
+      SVN_ERR(svn_wc__node_get_md5(&md5_checksum,
+                                   wc_ctx,
+                                   info2->wc_info->wcroot_abspath,
+                                   info2->wc_info->checksum,
+                                   pool, pool));
 
       info->checksum = svn_checksum_to_cstring(md5_checksum, pool);
     }

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/adm_crawler.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/adm_crawler.c?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/adm_crawler.c 
(original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/adm_crawler.c 
Thu Jan 19 18:49:23 2023
@@ -1063,7 +1063,7 @@ open_txdelta_stream(svn_txdelta_stream_t
 svn_error_t *
 svn_wc__internal_transmit_text_deltas(svn_stream_t *tempstream,
                                       const svn_checksum_t 
**new_text_base_md5_checksum,
-                                      const svn_checksum_t 
**new_text_base_sha1_checksum,
+                                      const svn_checksum_t 
**new_text_base_checksum,
                                       svn_wc__db_t *db,
                                       const char *local_abspath,
                                       svn_boolean_t fulltext,
@@ -1073,9 +1073,9 @@ svn_wc__internal_transmit_text_deltas(sv
                                       apr_pool_t *scratch_pool)
 {
   const svn_checksum_t *expected_md5_checksum;  /* recorded MD5 of BASE_S. */
-  svn_checksum_t *verify_checksum;  /* calc'd MD5 of BASE_STREAM */
+  svn_checksum_t *verify_md5_checksum;  /* calc'd MD5 of BASE_STREAM */
   svn_checksum_t *local_md5_checksum;  /* calc'd MD5 of LOCAL_STREAM */
-  svn_checksum_t *local_sha1_checksum;  /* calc'd SHA1 of LOCAL_STREAM */
+  svn_checksum_t *local_checksum;  /* calc'd SHA1 of LOCAL_STREAM */
   svn_wc__db_install_data_t *install_data = NULL;
   svn_error_t *err;
   svn_error_t *err2;
@@ -1102,13 +1102,13 @@ svn_wc__internal_transmit_text_deltas(sv
          is closed. */
       local_stream = copying_stream(local_stream, tempstream, scratch_pool);
     }
-  if (new_text_base_sha1_checksum)
+  if (new_text_base_checksum)
     {
       svn_stream_t *new_pristine_stream;
 
       SVN_ERR(svn_wc__textbase_prepare_install(&new_pristine_stream,
                                                &install_data,
-                                               &local_sha1_checksum, NULL,
+                                               &local_checksum, NULL,
                                                db, local_abspath, FALSE,
                                                scratch_pool, scratch_pool));
       local_stream = copying_stream(local_stream, new_pristine_stream,
@@ -1117,19 +1117,19 @@ svn_wc__internal_transmit_text_deltas(sv
 
   /* If sending a full text is requested, or if there is no pristine text
    * (e.g. the node is locally added), then set BASE_STREAM to an empty
-   * stream and leave EXPECTED_MD5_CHECKSUM and VERIFY_CHECKSUM as NULL.
+   * stream and leave EXPECTED_MD5_CHECKSUM and VERIFY_MD5_CHECKSUM as NULL.
    *
    * Otherwise, set BASE_STREAM to a stream providing the base (source) text
    * for the delta, set EXPECTED_MD5_CHECKSUM to its stored MD5 checksum,
-   * and arrange for its VERIFY_CHECKSUM to be calculated later. */
+   * and arrange for its VERIFY_MD5_CHECKSUM to be calculated later. */
   if (! fulltext)
     {
       /* We will be computing a delta against the pristine contents */
-      /* We need the expected checksum to be an MD-5 checksum rather than a
-       * SHA-1 because we want to pass it to apply_textdelta(). */
+      /* We need the expected checksum to be an MD-5 checksum because we
+       * want to pass it to apply_textdelta(). */
       err = read_and_checksum_pristine_text(&base_stream,
                                             &expected_md5_checksum,
-                                            &verify_checksum,
+                                            &verify_md5_checksum,
                                             db, local_abspath,
                                             scratch_pool, scratch_pool);
       if (err && err->apr_err == SVN_ERR_WC_PRISTINE_DEHYDRATED)
@@ -1138,7 +1138,7 @@ svn_wc__internal_transmit_text_deltas(sv
           svn_error_clear(err);
           base_stream = svn_stream_empty(scratch_pool);
           expected_md5_checksum = NULL;
-          verify_checksum = NULL;
+          verify_md5_checksum = NULL;
         }
       else if (err)
         {
@@ -1150,7 +1150,7 @@ svn_wc__internal_transmit_text_deltas(sv
       /* Send a fulltext. */
       base_stream = svn_stream_empty(scratch_pool);
       expected_md5_checksum = NULL;
-      verify_checksum = NULL;
+      verify_md5_checksum = NULL;
     }
 
   /* Arrange the stream to calculate the resulting MD5. */
@@ -1184,9 +1184,9 @@ svn_wc__internal_transmit_text_deltas(sv
   err2 = svn_stream_close(base_stream);
   if (err2)
     {
-      /* Set verify_checksum to NULL if svn_stream_close() returns error
+      /* Set verify_md5_checksum to NULL if svn_stream_close() returns error
          because checksum will be uninitialized in this case. */
-      verify_checksum = NULL;
+      verify_md5_checksum = NULL;
       err = svn_error_compose_create(err, err2);
     }
 
@@ -1194,8 +1194,8 @@ svn_wc__internal_transmit_text_deltas(sv
 
   /* If we have an error, it may be caused by a corrupt text base,
      so check the checksum. */
-  if (expected_md5_checksum && verify_checksum
-      && !svn_checksum_match(expected_md5_checksum, verify_checksum))
+  if (expected_md5_checksum && verify_md5_checksum
+      && !svn_checksum_match(expected_md5_checksum, verify_md5_checksum))
     {
       /* The entry checksum does not match the actual text
          base checksum.  Extreme badness. Of course,
@@ -1210,7 +1210,7 @@ svn_wc__internal_transmit_text_deltas(sv
          too, such as `svn diff'.  */
 
       err = svn_error_compose_create(
-              svn_checksum_mismatch_err(expected_md5_checksum, verify_checksum,
+              svn_checksum_mismatch_err(expected_md5_checksum, 
verify_md5_checksum,
                             scratch_pool,
                             _("Checksum mismatch for text base of '%s'"),
                             svn_dirent_local_style(local_abspath,
@@ -1230,13 +1230,13 @@ svn_wc__internal_transmit_text_deltas(sv
   if (new_text_base_md5_checksum)
     *new_text_base_md5_checksum = svn_checksum_dup(local_md5_checksum,
                                                    result_pool);
-  if (new_text_base_sha1_checksum)
+  if (new_text_base_checksum)
     {
       SVN_ERR(svn_wc__db_pristine_install(install_data,
-                                          local_sha1_checksum,
+                                          local_checksum,
                                           local_md5_checksum,
                                           scratch_pool));
-      *new_text_base_sha1_checksum = svn_checksum_dup(local_sha1_checksum,
+      *new_text_base_checksum = svn_checksum_dup(local_checksum,
                                                       result_pool);
     }
 

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/adm_ops.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/adm_ops.c?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/adm_ops.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/adm_ops.c 
Thu Jan 19 18:49:23 2023
@@ -78,7 +78,7 @@ typedef struct committed_queue_item_t
 
   /* The pristine text checksum. NULL if the old value should be kept
      and for directories */
-  const svn_checksum_t *new_sha1_checksum;
+  const svn_checksum_t *new_checksum;
 
   apr_hash_t *new_dav_cache; /* New DAV cache for the node */
 } committed_queue_item_t;
@@ -135,7 +135,7 @@ svn_wc_queue_committed4(svn_wc_committed
                         const apr_array_header_t *wcprop_changes,
                         svn_boolean_t remove_lock,
                         svn_boolean_t remove_changelist,
-                        const svn_checksum_t *sha1_checksum,
+                        const svn_checksum_t *checksum,
                         apr_pool_t *scratch_pool)
 {
   const char *wcroot_abspath;
@@ -166,7 +166,7 @@ svn_wc_queue_committed4(svn_wc_committed
   return svn_error_trace(
           svn_wc__db_commit_queue_add(db_queue, local_abspath, recurse,
                                       is_committed, remove_lock,
-                                      remove_changelist, sha1_checksum,
+                                      remove_changelist, checksum,
                                       
svn_wc__prop_array_to_hash(wcprop_changes,
                                                                  queue->pool),
                                       queue->pool, scratch_pool));
@@ -891,20 +891,20 @@ get_pristine_lazyopen_func(svn_stream_t
                            apr_pool_t *scratch_pool)
 {
   get_pristine_lazyopen_baton_t *b = baton;
-  const svn_checksum_t *sha1_checksum;
+  const svn_checksum_t *checksum;
   svn_stream_t *stream;
 
   /* svn_wc__db_pristine_read() wants a SHA1, so if we have an MD5,
      we'll use it to lookup the SHA1. */
   if (b->checksum->kind == svn_checksum_sha1)
-    sha1_checksum = b->checksum;
+    checksum = b->checksum;
   else
-    SVN_ERR(svn_wc__db_pristine_get_sha1(&sha1_checksum, b->wc_ctx->db,
-                                         b->wri_abspath, b->checksum,
-                                         scratch_pool, scratch_pool));
+    SVN_ERR(svn_wc__db_pristine_lookup_by_md5(&checksum, b->wc_ctx->db,
+                                              b->wri_abspath, b->checksum,
+                                              scratch_pool, scratch_pool));
 
   SVN_ERR(svn_wc__db_pristine_read(&stream, NULL, b->wc_ctx->db,
-                                   b->wri_abspath, sha1_checksum,
+                                   b->wri_abspath, checksum,
                                    result_pool, scratch_pool));
   if (!stream)
     return svn_error_create(SVN_ERR_WC_PRISTINE_DEHYDRATED, NULL, NULL);

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/deprecated.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/deprecated.c?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/deprecated.c 
(original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/deprecated.c 
Thu Jan 19 18:49:23 2023
@@ -860,10 +860,10 @@ svn_wc_queue_committed2(svn_wc_committed
   if (md5_checksum != NULL)
     {
       svn_error_t *err;
-      err = svn_wc__db_pristine_get_sha1(&sha1_checksum, wc_ctx->db,
-                                         local_abspath, md5_checksum,
-                                         
svn_wc__get_committed_queue_pool(queue),
-                                         scratch_pool);
+      err = svn_wc__db_pristine_lookup_by_md5(&sha1_checksum, wc_ctx->db,
+                                              local_abspath, md5_checksum,
+                                              
svn_wc__get_committed_queue_pool(queue),
+                                              scratch_pool);
 
       /* Don't fail on SHA1 not found */
       if (err && err->apr_err == SVN_ERR_WC_DB_ERROR)
@@ -959,9 +959,9 @@ svn_wc_process_committed4(const char *pa
   if (md5_checksum != NULL)
     {
       svn_error_t *err;
-      err = svn_wc__db_pristine_get_sha1(&sha1_checksum, db,
-                                         local_abspath, md5_checksum,
-                                         pool, pool);
+      err = svn_wc__db_pristine_lookup_by_md5(&sha1_checksum, db,
+                                              local_abspath, md5_checksum,
+                                              pool, pool);
 
       if (err && err->apr_err == SVN_ERR_WC_DB_ERROR)
         {

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/externals.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/externals.c?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/externals.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/externals.c 
Thu Jan 19 18:49:23 2023
@@ -491,7 +491,7 @@ struct edit_baton
 
   /* What we are installing now */
   svn_wc__db_install_data_t *install_data;
-  svn_checksum_t *new_sha1_checksum;
+  svn_checksum_t *new_checksum;
   svn_checksum_t *new_md5_checksum;
 
   /* List of incoming propchanges */
@@ -642,7 +642,7 @@ apply_textdelta(void *file_baton,
 
   SVN_ERR(svn_wc__textbase_prepare_install(&dest_stream,
                                            &eb->install_data,
-                                           &eb->new_sha1_checksum,
+                                           &eb->new_checksum,
                                            &eb->new_md5_checksum,
                                            eb->db, eb->local_abspath,
                                            TRUE,
@@ -717,10 +717,10 @@ close_file(void *file_baton,
 
   /* First move the file in the pristine store; this hands over the cleanup
      behavior to the pristine store. */
-  if (eb->new_sha1_checksum)
+  if (eb->new_checksum)
     {
       SVN_ERR(svn_wc__db_pristine_install(eb->install_data,
-                                          eb->new_sha1_checksum,
+                                          eb->new_checksum,
                                           eb->new_md5_checksum, pool));
 
       eb->install_data = NULL;
@@ -759,8 +759,8 @@ close_file(void *file_baton,
     if (!actual_props)
       actual_props = apr_hash_make(pool);
 
-    if (eb->new_sha1_checksum)
-      new_checksum = eb->new_sha1_checksum;
+    if (eb->new_checksum)
+      new_checksum = eb->new_checksum;
 
     /* Merge the properties */
     {
@@ -824,7 +824,7 @@ close_file(void *file_baton,
     }
 
     /* Merge the text */
-    if (eb->new_sha1_checksum)
+    if (eb->new_checksum)
       {
         svn_node_kind_t disk_kind;
         svn_boolean_t install_pristine = FALSE;
@@ -897,7 +897,7 @@ close_file(void *file_baton,
 
             SVN_ERR(svn_wc__db_pristine_read(&contents, NULL, eb->db,
                                              eb->wri_abspath,
-                                             eb->new_sha1_checksum,
+                                             eb->new_checksum,
                                              pool, pool));
             if (!contents)
               return svn_error_create(SVN_ERR_WC_PRISTINE_DEHYDRATED,

Modified: subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/node.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/node.c?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/node.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/node.c Thu 
Jan 19 18:49:23 2023
@@ -862,17 +862,17 @@ svn_wc__node_get_commit_status(svn_boole
 }
 
 svn_error_t *
-svn_wc__node_get_md5_from_sha1(const svn_checksum_t **md5_checksum,
-                               svn_wc_context_t *wc_ctx,
-                               const char *wri_abspath,
-                               const svn_checksum_t *sha1_checksum,
-                               apr_pool_t *result_pool,
-                               apr_pool_t *scratch_pool)
+svn_wc__node_get_md5(const svn_checksum_t **md5_checksum,
+                     svn_wc_context_t *wc_ctx,
+                     const char *wri_abspath,
+                     const svn_checksum_t *checksum,
+                     apr_pool_t *result_pool,
+                     apr_pool_t *scratch_pool)
 {
   return svn_error_trace(svn_wc__db_pristine_get_md5(md5_checksum,
                                                      wc_ctx->db,
                                                      wri_abspath,
-                                                     sha1_checksum,
+                                                     checksum,
                                                      result_pool,
                                                      scratch_pool));
 }

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/textbase.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/textbase.c?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/textbase.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/textbase.c 
Thu Jan 19 18:49:23 2023
@@ -446,7 +446,7 @@ svn_wc__textbase_setaside_wq(const char
 svn_error_t *
 svn_wc__textbase_prepare_install(svn_stream_t **stream_p,
                                  svn_wc__db_install_data_t **install_data_p,
-                                 svn_checksum_t **sha1_checksum_p,
+                                 svn_checksum_t **checksum_p,
                                  svn_checksum_t **md5_checksum_p,
                                  svn_wc__db_t *db,
                                  const char *local_abspath,
@@ -455,7 +455,7 @@ svn_wc__textbase_prepare_install(svn_str
                                  apr_pool_t *scratch_pool)
 {
   SVN_ERR(svn_wc__db_pristine_prepare_install(stream_p, install_data_p,
-                                              sha1_checksum_p,
+                                              checksum_p,
                                               md5_checksum_p,
                                               db, local_abspath, hydrated,
                                               result_pool, scratch_pool));

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/textbase.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/textbase.h?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/textbase.h 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/textbase.h 
Thu Jan 19 18:49:23 2023
@@ -106,7 +106,7 @@ svn_wc__textbase_setaside_wq(const char
 svn_error_t *
 svn_wc__textbase_prepare_install(svn_stream_t **stream_p,
                                  svn_wc__db_install_data_t **install_data_p,
-                                 svn_checksum_t **sha1_checksum_p,
+                                 svn_checksum_t **checksum_p,
                                  svn_checksum_t **md5_checksum_p,
                                  svn_wc__db_t *db,
                                  const char *local_abspath,

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/update_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/update_editor.c?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/update_editor.c 
(original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/update_editor.c 
Thu Jan 19 18:49:23 2023
@@ -434,7 +434,7 @@ struct handler_baton
 
   /* A calculated SHA-1 of NEW_TEXT_BASE_TMP_ABSPATH, which we'll use for
      eventually writing the pristine. */
-  svn_checksum_t * new_text_base_sha1_checksum;
+  svn_checksum_t * new_text_base_checksum;
 };
 
 
@@ -759,7 +759,7 @@ struct file_baton
   /* If there are file content changes, these are the checksums of the
      resulting new text base, which is in the pristine store, else NULL. */
   const svn_checksum_t *new_text_base_md5_checksum;
-  const svn_checksum_t *new_text_base_sha1_checksum;
+  const svn_checksum_t *new_text_base_checksum;
 
   /* The checksum of the file before the update */
   const svn_checksum_t *original_checksum;
@@ -1050,14 +1050,14 @@ window_handler(svn_txdelta_window_t *win
       /* Tell the file baton about the new text base's checksums. */
       fb->new_text_base_md5_checksum =
         svn_checksum__from_digest_md5(hb->new_text_base_md5_digest, fb->pool);
-      fb->new_text_base_sha1_checksum =
-        svn_checksum_dup(hb->new_text_base_sha1_checksum, fb->pool);
+      fb->new_text_base_checksum =
+        svn_checksum_dup(hb->new_text_base_checksum, fb->pool);
 
       /* Store the new pristine text in the pristine store now.  Later, in a
          single transaction we will update the BASE_NODE to include a
          reference to this pristine text's checksum. */
       SVN_ERR(svn_wc__db_pristine_install(hb->install_data,
-                                          fb->new_text_base_sha1_checksum,
+                                          fb->new_text_base_checksum,
                                           fb->new_text_base_md5_checksum,
                                           hb->pool));
     }
@@ -3789,7 +3789,7 @@ lazy_open_target(svn_stream_t **stream_p
      HB->INSTALL_DATA unchanged on error. */
   SVN_ERR(svn_wc__textbase_prepare_install(&pristine_install_stream,
                                            &pristine_install_data,
-                                           &hb->new_text_base_sha1_checksum,
+                                           &hb->new_text_base_checksum,
                                            NULL,
                                            fb->edit_baton->db,
                                            fb->local_abspath,
@@ -4232,7 +4232,7 @@ merge_file(svn_skel_t **work_items,
      things are true:
 
          - The new pristine text of F is present in the pristine store
-           iff FB->NEW_TEXT_BASE_SHA1_CHECKSUM is not NULL.
+           iff FB->NEW_TEXT_BASE_CHECKSUM is not NULL.
 
          - The WC metadata still reflects the old version of F.
            (We can still access the old pristine base text of F.)
@@ -4291,7 +4291,7 @@ merge_file(svn_skel_t **work_items,
        * Retranslate from the working file.
    */
   if (! is_locally_modified
-      && fb->new_text_base_sha1_checksum)
+      && fb->new_text_base_checksum)
     {
           /* If there are no local mods, who cares whether it's a text
              or binary file!  Just write a log command to overwrite
@@ -4304,7 +4304,7 @@ merge_file(svn_skel_t **work_items,
 
       *install_pristine = TRUE;
     }
-  else if (fb->new_text_base_sha1_checksum)
+  else if (fb->new_text_base_checksum)
     {
       /* Actual file exists and has local mods:
          Now we need to let loose svn_wc__merge_internal() to merge
@@ -4315,7 +4315,7 @@ merge_file(svn_skel_t **work_items,
                                          eb->db,
                                          fb->local_abspath,
                                          pb->local_abspath,
-                                         fb->new_text_base_sha1_checksum,
+                                         fb->new_text_base_checksum,
                                          fb->add_existed
                                                   ? NULL
                                                   : fb->original_checksum,
@@ -4396,7 +4396,7 @@ merge_file(svn_skel_t **work_items,
 
   if (found_text_conflict)
     *content_state = svn_wc_notify_state_conflicted;
-  else if (fb->new_text_base_sha1_checksum)
+  else if (fb->new_text_base_checksum)
     {
       if (is_locally_modified)
         *content_state = svn_wc_notify_state_merged;
@@ -4623,7 +4623,7 @@ close_file(void *file_baton,
       else
         {
           install_pristine = FALSE;
-          if (fb->new_text_base_sha1_checksum)
+          if (fb->new_text_base_checksum)
             content_state = svn_wc_notify_state_changed;
           else
             content_state = svn_wc_notify_state_unchanged;
@@ -4676,7 +4676,7 @@ close_file(void *file_baton,
                                   scratch_pool,
                                   scratch_pool));
 
-      if (fb->new_text_base_sha1_checksum)
+      if (fb->new_text_base_checksum)
         content_state = svn_wc_notify_state_changed;
       else
         content_state = svn_wc_notify_state_unchanged;
@@ -4687,9 +4687,9 @@ close_file(void *file_baton,
   /* Insert/replace the BASE node with all of the new metadata.  */
 
   /* Set the 'checksum' column of the file's BASE_NODE row to
-   * NEW_TEXT_BASE_SHA1_CHECKSUM.  The pristine text identified by that
+   * NEW_TEXT_BASE_CHECKSUM.  The pristine text identified by that
    * checksum is already in the pristine store. */
-  new_checksum = fb->new_text_base_sha1_checksum;
+  new_checksum = fb->new_text_base_checksum;
 
   /* If we don't have a NEW checksum, then the base must not have changed.
      Just carry over the old checksum.  */
@@ -5510,7 +5510,7 @@ svn_wc_add_repos_file4(svn_wc_context_t
   svn_node_kind_t kind;
   const char *tmp_text_base_abspath;
   svn_checksum_t *new_text_base_md5_checksum;
-  svn_checksum_t *new_text_base_sha1_checksum;
+  svn_checksum_t *new_text_base_checksum;
   const char *source_abspath = NULL;
   svn_skel_t *all_work_items = NULL;
   svn_skel_t *work_item;
@@ -5654,14 +5654,14 @@ svn_wc_add_repos_file4(svn_wc_context_t
 
   /* Copy NEW_BASE_CONTENTS into a temporary file so our log can refer to
      it, and set TMP_TEXT_BASE_ABSPATH to its path.  Compute its
-     NEW_TEXT_BASE_MD5_CHECKSUM and NEW_TEXT_BASE_SHA1_CHECKSUM as we copy. */
+     NEW_TEXT_BASE_MD5_CHECKSUM and NEW_TEXT_BASE_CHECKSUM as we copy. */
   if (copyfrom_url)
     {
       svn_stream_t *install_stream;
 
       SVN_ERR(svn_wc__textbase_prepare_install(&install_stream,
                                                &install_data,
-                                               &new_text_base_sha1_checksum,
+                                               &new_text_base_checksum,
                                                &new_text_base_md5_checksum,
                                                wc_ctx->db, local_abspath,
                                                copyfrom_url != NULL,
@@ -5673,7 +5673,7 @@ svn_wc_add_repos_file4(svn_wc_context_t
     }
   else
     {
-      new_text_base_sha1_checksum = NULL;
+      new_text_base_checksum = NULL;
       new_text_base_md5_checksum = NULL;
     }
   SVN_ERR(svn_stream_copy3(new_base_contents, tmp_base_contents,
@@ -5705,7 +5705,7 @@ svn_wc_add_repos_file4(svn_wc_context_t
   if (copyfrom_url != NULL)
     {
       SVN_ERR(svn_wc__db_pristine_install(install_data,
-                                          new_text_base_sha1_checksum,
+                                          new_text_base_checksum,
                                           new_text_base_md5_checksum, pool));
     }
   else
@@ -5730,7 +5730,7 @@ svn_wc_add_repos_file4(svn_wc_context_t
          NULL for the missing information, and this function should learn to
          handle that. */
 
-      new_text_base_sha1_checksum = NULL;
+      new_text_base_checksum = NULL;
       new_text_base_md5_checksum = NULL;
     }
 
@@ -5759,7 +5759,7 @@ svn_wc_add_repos_file4(svn_wc_context_t
                                                          : NULL,
                                   original_repos_relpath ? repos_uuid : NULL,
                                   copyfrom_rev,
-                                  new_text_base_sha1_checksum,
+                                  new_text_base_checksum,
                                   TRUE,
                                   new_props,
                                   FALSE /* is_move */,

Modified: subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc.h?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc.h 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc.h Thu 
Jan 19 18:49:23 2023
@@ -514,7 +514,7 @@ svn_wc__conflicted_for_update_p(svn_bool
 svn_error_t *
 svn_wc__internal_transmit_text_deltas(svn_stream_t *tempstream,
                                       const svn_checksum_t 
**new_text_base_md5_checksum,
-                                      const svn_checksum_t 
**new_text_base_sha1_checksum,
+                                      const svn_checksum_t 
**new_text_base_checksum,
                                       svn_wc__db_t *db,
                                       const char *local_abspath,
                                       svn_boolean_t fulltext,

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db.c?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db.c Thu 
Jan 19 18:49:23 2023
@@ -10119,7 +10119,7 @@ svn_wc__db_read_children_walker_info(con
 
 svn_error_t *
 svn_wc__db_read_node_install_info(const char **wcroot_abspath,
-                                  const svn_checksum_t **sha1_checksum,
+                                  const svn_checksum_t **checksum,
                                   apr_hash_t **pristine_props,
                                   apr_time_t *changed_date,
                                   svn_wc__db_t *db,
@@ -10168,8 +10168,8 @@ svn_wc__db_read_node_install_info(const
 
   if (have_row)
     {
-      if (sha1_checksum)
-        err = svn_sqlite__column_checksum(sha1_checksum, stmt, 6, result_pool);
+      if (checksum)
+        err = svn_sqlite__column_checksum(checksum, stmt, 6, result_pool);
 
       if (!err && pristine_props)
         {
@@ -16227,7 +16227,7 @@ typedef struct commit_queue_item_t
 
   /* The pristine text checksum. NULL if the old value should be kept
      and for directories */
-  const svn_checksum_t *new_sha1_checksum;
+  const svn_checksum_t *new_checksum;
 
   apr_hash_t *new_dav_cache; /* New DAV cache for the node */
 } commit_queue_item_t;
@@ -16280,7 +16280,7 @@ svn_wc__db_commit_queue_add(svn_wc__db_c
                             svn_boolean_t is_commited,
                             svn_boolean_t remove_lock,
                             svn_boolean_t remove_changelist,
-                            const svn_checksum_t *new_sha1_checksum,
+                            const svn_checksum_t *new_checksum,
                             apr_hash_t *new_dav_cache,
                             apr_pool_t *result_pool,
                             apr_pool_t *scratch_pool)
@@ -16304,7 +16304,7 @@ svn_wc__db_commit_queue_add(svn_wc__db_c
   cqi->committed = is_commited;
   cqi->remove_lock = remove_lock;
   cqi->remove_changelist = remove_changelist;
-  cqi->new_sha1_checksum = new_sha1_checksum;
+  cqi->new_checksum = new_checksum;
   cqi->new_dav_cache = new_dav_cache;
 
   queue->have_recurse |= recurse;
@@ -16456,7 +16456,7 @@ process_committed_leaf(svn_wc__db_t *db,
  * If @a remove_changelist is set, clear any changeset assignments
  * from @a local_abspath; otherwise, keep such assignments.
  *
- * If @a new_sha1_checksum is non-NULL, use it to identify the node's pristine
+ * If @a new_checksum is non-NULL, use it to identify the node's pristine
  * text.
  *
  * Set TOP_OF_RECURSE to TRUE to show that this the top of a possibly
@@ -16474,7 +16474,7 @@ process_committed_internal(svn_wc__db_t
                            apr_hash_t *new_dav_cache,
                            svn_boolean_t remove_lock,
                            svn_boolean_t remove_changelist,
-                           const svn_checksum_t *new_sha1_checksum,
+                           const svn_checksum_t *new_checksum,
                            apr_hash_t *items_by_relpath,
                            apr_pool_t *scratch_pool)
 {
@@ -16498,7 +16498,7 @@ process_committed_internal(svn_wc__db_t
                                  new_revnum, new_date, rev_author,
                                  new_dav_cache,
                                  remove_lock, remove_changelist,
-                                 new_sha1_checksum,
+                                 new_checksum,
                                  scratch_pool));
 
   /* Only check for recursion on nodes that have children */
@@ -16534,11 +16534,11 @@ process_committed_internal(svn_wc__db_t
 
           this_relpath = svn_dirent_join(local_relpath, name, iterpool);
 
-          new_sha1_checksum = NULL;
+          new_checksum = NULL;
           cqi = svn_hash_gets(items_by_relpath, this_relpath);
 
           if (cqi != NULL)
-            new_sha1_checksum = cqi->new_sha1_checksum;
+            new_checksum = cqi->new_checksum;
 
           /* Recurse.  Pass NULL for NEW_DAV_CACHE, because the
              ones present in the current call are only applicable to
@@ -16552,7 +16552,7 @@ process_committed_internal(svn_wc__db_t
                     NULL /* new_dav_cache */,
                     FALSE /* remove_lock */,
                     remove_changelist,
-                    new_sha1_checksum,
+                    new_checksum,
                     items_by_relpath,
                     iterpool));
         }
@@ -16690,7 +16690,7 @@ db_process_commit_queue(svn_wc__db_t *db
                                   cqi->new_dav_cache,
                                   cqi->remove_lock,
                                   cqi->remove_changelist,
-                                  cqi->new_sha1_checksum,
+                                  cqi->new_checksum,
                                   items_by_relpath,
                                   iterpool));
         }

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db.h?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db.h 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db.h Thu 
Jan 19 18:49:23 2023
@@ -931,19 +931,19 @@ svn_wc__db_base_get_lock_tokens_recursiv
 */
 
 /* Set *PRISTINE_ABSPATH to the path under WCROOT_ABSPATH that will be
-   used by the pristine text identified by SHA1_CHECKSUM.  The file
+   used by the pristine text identified by CHECKSUM.  The file
    need not exist.
  */
 svn_error_t *
 svn_wc__db_pristine_get_future_path(const char **pristine_abspath,
                                     const char *wcroot_abspath,
-                                    const svn_checksum_t *sha1_checksum,
+                                    const svn_checksum_t *checksum,
                                     apr_pool_t *result_pool,
                                     apr_pool_t *scratch_pool);
 
 
 /* If requested set *CONTENTS to a readable stream that will yield the pristine
-   text identified by SHA1_CHECKSUM (must be a SHA-1 checksum) within the WC
+   text identified by CHECKSUM (must be a SHA-1 checksum) within the WC
    identified by WRI_ABSPATH in DB.  If the pristine is present in the store,
    but dehydrated, set *CONTENTS to NULL.
 
@@ -958,7 +958,7 @@ svn_wc__db_pristine_read(svn_stream_t **
                          svn_filesize_t *size,
                          svn_wc__db_t *db,
                          const char *wri_abspath,
-                         const svn_checksum_t *sha1_checksum,
+                         const svn_checksum_t *checksum,
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool);
 
@@ -971,9 +971,9 @@ typedef struct svn_wc__db_install_data_t
    file will have an arbitrary unique name. Return as *INSTALL_DATA a baton
    for either installing or removing the file
 
-   Arrange that, on stream closure, *MD5_CHECKSUM and *SHA1_CHECKSUM will be
+   Arrange that, on stream closure, *MD5_CHECKSUM and *CHECKSUM will be
    set to the MD-5 and SHA-1 checksums respectively of that file.
-   MD5_CHECKSUM and/or SHA1_CHECKSUM may be NULL if not wanted.
+   MD5_CHECKSUM and/or CHECKSUM may be NULL if not wanted.
 
    The contents of the pristine will be saved to disk if HYDRATED is true or
    if the WC version or configuration doesn't allow dehydrated pristines.
@@ -983,7 +983,7 @@ typedef struct svn_wc__db_install_data_t
 svn_error_t *
 svn_wc__db_pristine_prepare_install(svn_stream_t **stream,
                                     svn_wc__db_install_data_t **install_data,
-                                    svn_checksum_t **sha1_checksum,
+                                    svn_checksum_t **checksum,
                                     svn_checksum_t **md5_checksum,
                                     svn_wc__db_t *db,
                                     const char *wri_abspath,
@@ -993,10 +993,10 @@ svn_wc__db_pristine_prepare_install(svn_
 
 /* Install the file created via svn_wc__db_pristine_prepare_install() into
    the pristine data store, to be identified by the SHA-1 checksum of its
-   contents, SHA1_CHECKSUM, and whose MD-5 checksum is MD5_CHECKSUM. */
+   contents, CHECKSUM, and whose MD-5 checksum is MD5_CHECKSUM. */
 svn_error_t *
 svn_wc__db_pristine_install(svn_wc__db_install_data_t *install_data,
-                            const svn_checksum_t *sha1_checksum,
+                            const svn_checksum_t *checksum,
                             const svn_checksum_t *md5_checksum,
                             apr_pool_t *scratch_pool);
 
@@ -1008,7 +1008,7 @@ svn_wc__db_pristine_install_abort(svn_wc
 
 
 /* Set *MD5_CHECKSUM to the MD-5 checksum of a pristine text
-   identified by its SHA-1 checksum SHA1_CHECKSUM. Return an error
+   identified by its SHA-1 checksum CHECKSUM. Return an error
    if the pristine text does not exist or its MD5 checksum is not found.
 
    Allocate *MD5_CHECKSUM in RESULT_POOL. */
@@ -1016,12 +1016,12 @@ svn_error_t *
 svn_wc__db_pristine_get_md5(const svn_checksum_t **md5_checksum,
                             svn_wc__db_t *db,
                             const char *wri_abspath,
-                            const svn_checksum_t *sha1_checksum,
+                            const svn_checksum_t *checksum,
                             apr_pool_t *result_pool,
                             apr_pool_t *scratch_pool);
 
 
-/* Set *SHA1_CHECKSUM to the SHA-1 checksum of a pristine text
+/* Set *CHECKSUM to the SHA-1 checksum of a pristine text
    identified by its MD-5 checksum MD5_CHECKSUM. Return an error
    if the pristine text does not exist or its SHA-1 checksum is not found.
 
@@ -1031,14 +1031,14 @@ svn_wc__db_pristine_get_md5(const svn_ch
    not unique. Need to see whether this function is going to stay in use,
    and, if so, address this somehow.
 
-   Allocate *SHA1_CHECKSUM in RESULT_POOL. */
+   Allocate *CHECKSUM in RESULT_POOL. */
 svn_error_t *
-svn_wc__db_pristine_get_sha1(const svn_checksum_t **sha1_checksum,
-                             svn_wc__db_t *db,
-                             const char *wri_abspath,
-                             const svn_checksum_t *md5_checksum,
-                             apr_pool_t *result_pool,
-                             apr_pool_t *scratch_pool);
+svn_wc__db_pristine_lookup_by_md5(const svn_checksum_t **checksum,
+                                  svn_wc__db_t *db,
+                                  const char *wri_abspath,
+                                  const svn_checksum_t *md5_checksum,
+                                  apr_pool_t *result_pool,
+                                  apr_pool_t *scratch_pool);
 
 
 /* If necessary transfers the PRISTINE files of the tree rooted at
@@ -1051,13 +1051,13 @@ svn_wc__db_pristine_transfer(svn_wc__db_
                              void *cancel_baton,
                              apr_pool_t *scratch_pool);
 
-/* Remove the pristine text with SHA-1 checksum SHA1_CHECKSUM from the
+/* Remove the pristine text with SHA-1 checksum CHECKSUM from the
  * pristine store, iff it is not referenced by any of the (other) WC DB
  * tables. */
 svn_error_t *
 svn_wc__db_pristine_remove(svn_wc__db_t *db,
                            const char *wri_abspath,
-                           const svn_checksum_t *sha1_checksum,
+                           const svn_checksum_t *checksum,
                            apr_pool_t *scratch_pool);
 
 
@@ -1069,7 +1069,7 @@ svn_wc__db_pristine_cleanup(svn_wc__db_t
 
 
 /* Set *PRESENT to true if the pristine store for WRI_ABSPATH in DB contains
-   a pristine text with SHA-1 checksum SHA1_CHECKSUM, and to false otherwise.
+   a pristine text with SHA-1 checksum CHECKSUM, and to false otherwise.
    If the pristine is present, set *HYDRATED to true if its contents are
    currently available on disk, and to false otherwise.  If the pristine
    is not present, set *HYDRATED to false. */
@@ -1078,16 +1078,16 @@ svn_wc__db_pristine_check(svn_boolean_t
                           svn_boolean_t *hydrated,
                           svn_wc__db_t *db,
                           const char *wri_abspath,
-                          const svn_checksum_t *sha1_checksum,
+                          const svn_checksum_t *checksum,
                           apr_pool_t *scratch_pool);
 
 /* If the pristine store for WRI_ABSPATH in DB contains a pristine text with
-   SHA-1 checksum SHA1_CHECKSUM with its content available on disk, remove
+   SHA-1 checksum CHECKSUM with its content available on disk, remove
    that content and mark the pristine entry as "dehydrated". */
 svn_error_t *
 svn_wc__db_pristine_dehydrate(svn_wc__db_t *db,
                               const char *wri_abspath,
-                              const svn_checksum_t *sha1_checksum,
+                              const svn_checksum_t *checksum,
                               apr_pool_t *scratch_pool);
 
 /* @defgroup svn_wc__db_external  External management
@@ -1314,7 +1314,7 @@ svn_wc__db_commit_queue_add(svn_wc__db_c
                             svn_boolean_t is_commited,
                             svn_boolean_t remove_lock,
                             svn_boolean_t remove_changelist,
-                            const svn_checksum_t *new_sha1_checksum,
+                            const svn_checksum_t *new_checksum,
                             apr_hash_t *new_dav_cache,
                             apr_pool_t *result_pool,
                             apr_pool_t *scratch_pool);
@@ -2138,7 +2138,7 @@ svn_wc__db_read_pristine_info(svn_wc__db
 
 /* Gets the information required to install a pristine file to the working copy
 
-   Set WCROOT_ABSPATH to the working copy root, SHA1_CHECKSUM to the
+   Set WCROOT_ABSPATH to the working copy root, CHECKSUM to the
    checksum of the node (a valid reference into the pristine store)
    and PRISTINE_PROPS to the node's pristine properties (to use for
    installing the file).
@@ -2148,7 +2148,7 @@ svn_wc__db_read_pristine_info(svn_wc__db
    */
 svn_error_t *
 svn_wc__db_read_node_install_info(const char **wcroot_abspath,
-                                  const svn_checksum_t **sha1_checksum,
+                                  const svn_checksum_t **checksum,
                                   apr_hash_t **pristine_props,
                                   apr_time_t *changed_date,
                                   svn_wc__db_t *db,

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_pristine.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_pristine.c?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_pristine.c
 (original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_pristine.c
 Thu Jan 19 18:49:23 2023
@@ -52,19 +52,19 @@
 static svn_error_t *
 get_pristine_fname(const char **pristine_abspath,
                    const char *wcroot_abspath,
-                   const svn_checksum_t *sha1_checksum,
+                   const svn_checksum_t *checksum,
                    apr_pool_t *result_pool,
                    apr_pool_t *scratch_pool)
 {
   const char *base_dir_abspath;
-  const char *hexdigest = svn_checksum_to_cstring(sha1_checksum, scratch_pool);
+  const char *hexdigest = svn_checksum_to_cstring(checksum, scratch_pool);
   char subdir[3];
 
   /* ### code is in transition. make sure we have the proper data.  */
   SVN_ERR_ASSERT(pristine_abspath != NULL);
   SVN_ERR_ASSERT(svn_dirent_is_absolute(wcroot_abspath));
-  SVN_ERR_ASSERT(sha1_checksum != NULL);
-  SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
+  SVN_ERR_ASSERT(checksum != NULL);
+  SVN_ERR_ASSERT(checksum->kind == svn_checksum_sha1);
 
   base_dir_abspath = svn_dirent_join_many(scratch_pool,
                                           wcroot_abspath,
@@ -96,17 +96,17 @@ get_pristine_fname(const char **pristine
 svn_error_t *
 svn_wc__db_pristine_get_future_path(const char **pristine_abspath,
                                     const char *wcroot_abspath,
-                                    const svn_checksum_t *sha1_checksum,
+                                    const svn_checksum_t *checksum,
                                     apr_pool_t *result_pool,
                                     apr_pool_t *scratch_pool)
 {
   SVN_ERR(get_pristine_fname(pristine_abspath, wcroot_abspath,
-                             sha1_checksum,
+                             checksum,
                              result_pool, scratch_pool));
   return SVN_NO_ERROR;
 }
 
-/* Read *HAVE_ROW, *MD5_CHECKSUM, *SIZE, *HYDRATED for WCROOT:SHA1_CHECKSUM.
+/* Read *HAVE_ROW, *MD5_CHECKSUM, *SIZE, *HYDRATED for WCROOT:CHECKSUM.
  * If it returns with *HAVE_ROW=FALSE, other outputs are null/zero/false.
  */
 static svn_error_t *
@@ -115,7 +115,7 @@ stmt_select_pristine(svn_boolean_t *have
                      svn_filesize_t *size,
                      svn_boolean_t *hydrated,
                      svn_wc__db_wcroot_t *wcroot,
-                     const svn_checksum_t *sha1_checksum,
+                     const svn_checksum_t *checksum,
                      apr_pool_t *result_pool,
                      apr_pool_t *scratch_pool)
 {
@@ -128,7 +128,7 @@ stmt_select_pristine(svn_boolean_t *have
               ? STMT_SELECT_PRISTINE_F32
               : STMT_SELECT_PRISTINE_F31);
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, stmt_num));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, checksum, scratch_pool));
   SVN_ERR(svn_sqlite__step(have_row, stmt));
   if (!*have_row)
     {
@@ -153,7 +153,7 @@ stmt_select_pristine(svn_boolean_t *have
 }
 
 /* Set *CONTENTS to a readable stream from which the pristine text
- * identified by SHA1_CHECKSUM and PRISTINE_ABSPATH can be read from the
+ * identified by CHECKSUM and PRISTINE_ABSPATH can be read from the
  * pristine store of WCROOT.  If the pristine contents are currently not
  * available on disk, set *CONTENTS to NULL.  If SIZE is not null, set
  * *SIZE to the size in bytes of that text.  If that text is not in
@@ -172,7 +172,7 @@ static svn_error_t *
 pristine_read_txn(svn_stream_t **contents,
                   svn_filesize_t *size,
                   svn_wc__db_wcroot_t *wcroot,
-                  const svn_checksum_t *sha1_checksum,
+                  const svn_checksum_t *checksum,
                   const char *pristine_abspath,
                   apr_pool_t *result_pool,
                   apr_pool_t *scratch_pool)
@@ -183,14 +183,14 @@ pristine_read_txn(svn_stream_t **content
   /* Check that this pristine text is present in the store.  (The presence
    * of the file is not sufficient.) */
   SVN_ERR(stmt_select_pristine(&have_row, NULL, size, &hydrated,
-                               wcroot, sha1_checksum,
+                               wcroot, checksum,
                                result_pool, scratch_pool));
   if (! have_row)
     {
       return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
                                _("Pristine text '%s' not present"),
                                svn_checksum_to_cstring_display(
-                                 sha1_checksum, scratch_pool));
+                                 checksum, scratch_pool));
     }
 
   if (contents)
@@ -224,7 +224,7 @@ svn_wc__db_pristine_read(svn_stream_t **
                          svn_filesize_t *size,
                          svn_wc__db_t *db,
                          const char *wri_abspath,
-                         const svn_checksum_t *sha1_checksum,
+                         const svn_checksum_t *checksum,
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool)
 {
@@ -236,24 +236,24 @@ svn_wc__db_pristine_read(svn_stream_t **
 
   /* Some 1.6-to-1.7 wc upgrades created rows without checksums and
      updating such a row passes NULL here. */
-  if (!sha1_checksum)
+  if (!checksum)
     return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,
                              _("Can't read '%s' from pristine store "
                                "because no checksum supplied"),
                              svn_dirent_local_style(wri_abspath, 
scratch_pool));
 
-  SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
+  SVN_ERR_ASSERT(checksum->kind == svn_checksum_sha1);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
                               wri_abspath, scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(get_pristine_fname(&pristine_abspath, wcroot->abspath,
-                             sha1_checksum,
+                             checksum,
                              scratch_pool, scratch_pool));
   SVN_WC__DB_WITH_TXN(
     pristine_read_txn(contents, size,
-                      wcroot, sha1_checksum, pristine_abspath,
+                      wcroot, checksum, pristine_abspath,
                       result_pool, scratch_pool),
     wcroot);
 
@@ -334,7 +334,7 @@ pristine_install_txn(svn_wc__db_wcroot_t
                      /* The target path for the file (within the pristine 
store). */
                      const char *pristine_abspath,
                      /* The pristine text's SHA-1 checksum. */
-                     const svn_checksum_t *sha1_checksum,
+                     const svn_checksum_t *checksum,
                      /* The pristine text's MD-5 checksum. */
                      const svn_checksum_t *md5_checksum,
                      apr_pool_t *scratch_pool)
@@ -346,7 +346,7 @@ pristine_install_txn(svn_wc__db_wcroot_t
   svn_boolean_t hydrated;
 
   SVN_ERR(stmt_select_pristine(&have_row, NULL, NULL, &hydrated,
-                               wcroot, sha1_checksum,
+                               wcroot, checksum,
                                scratch_pool, scratch_pool));
 
   if (have_row && hydrated)
@@ -380,7 +380,7 @@ pristine_install_txn(svn_wc__db_wcroot_t
   stmt_num = (wcroot->format >= SVN_WC__HAS_OPTIONAL_PRISTINE
               ? STMT_UPSERT_PRISTINE_F32 : STMT_UPSERT_PRISTINE_F31);
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, stmt_num));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, checksum, scratch_pool));
   SVN_ERR(svn_sqlite__bind_checksum(stmt, 2, md5_checksum, scratch_pool));
   SVN_ERR(svn_sqlite__bind_int64(stmt, 3, install_data->size));
   if (wcroot->format >= SVN_WC__HAS_OPTIONAL_PRISTINE)
@@ -393,7 +393,7 @@ pristine_install_txn(svn_wc__db_wcroot_t
 svn_error_t *
 svn_wc__db_pristine_prepare_install(svn_stream_t **stream_p,
                                     svn_wc__db_install_data_t **install_data_p,
-                                    svn_checksum_t **sha1_checksum_p,
+                                    svn_checksum_t **checksum_p,
                                     svn_checksum_t **md5_checksum_p,
                                     svn_wc__db_t *db,
                                     const char *wri_abspath,
@@ -411,7 +411,7 @@ svn_wc__db_pristine_prepare_install(svn_
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_wc__db_pristine_prepare_install_internal(
-            stream_p, install_data_p, sha1_checksum_p, md5_checksum_p,
+            stream_p, install_data_p, checksum_p, md5_checksum_p,
             wcroot, hydrated, result_pool, scratch_pool));
 
   return SVN_NO_ERROR;
@@ -420,7 +420,7 @@ svn_wc__db_pristine_prepare_install(svn_
 svn_error_t *
 svn_wc__db_pristine_prepare_install_internal(svn_stream_t **stream_p,
                                              svn_wc__db_install_data_t 
**install_data_p,
-                                             svn_checksum_t **sha1_checksum_p,
+                                             svn_checksum_t **checksum_p,
                                              svn_checksum_t **md5_checksum_p,
                                              svn_wc__db_wcroot_t *wcroot,
                                              svn_boolean_t hydrated,
@@ -458,8 +458,8 @@ svn_wc__db_pristine_prepare_install_inte
   if (md5_checksum_p)
     stream = svn_stream_checksummed2(stream, NULL, md5_checksum_p,
                                      svn_checksum_md5, FALSE, result_pool);
-  if (sha1_checksum_p)
-    stream = svn_stream_checksummed2(stream, NULL, sha1_checksum_p,
+  if (checksum_p)
+    stream = svn_stream_checksummed2(stream, NULL, checksum_p,
                                      svn_checksum_sha1, FALSE, result_pool);
 
   *stream_p = stream;
@@ -470,20 +470,20 @@ svn_wc__db_pristine_prepare_install_inte
 
 svn_error_t *
 svn_wc__db_pristine_install(svn_wc__db_install_data_t *install_data,
-                            const svn_checksum_t *sha1_checksum,
+                            const svn_checksum_t *checksum,
                             const svn_checksum_t *md5_checksum,
                             apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot = install_data->wcroot;
   const char *pristine_abspath;
 
-  SVN_ERR_ASSERT(sha1_checksum != NULL);
-  SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
+  SVN_ERR_ASSERT(checksum != NULL);
+  SVN_ERR_ASSERT(checksum->kind == svn_checksum_sha1);
   SVN_ERR_ASSERT(md5_checksum != NULL);
   SVN_ERR_ASSERT(md5_checksum->kind == svn_checksum_md5);
 
   SVN_ERR(get_pristine_fname(&pristine_abspath, wcroot->abspath,
-                             sha1_checksum,
+                             checksum,
                              scratch_pool, scratch_pool));
 
   /* Ensure the SQL txn has at least a 'RESERVED' lock before we start looking
@@ -491,7 +491,7 @@ svn_wc__db_pristine_install(svn_wc__db_i
   SVN_SQLITE__WITH_IMMEDIATE_TXN(
     pristine_install_txn(wcroot,
                          install_data, pristine_abspath,
-                         sha1_checksum, md5_checksum,
+                         checksum, md5_checksum,
                          scratch_pool),
     wcroot->sdb);
 
@@ -515,7 +515,7 @@ svn_error_t *
 svn_wc__db_pristine_get_md5(const svn_checksum_t **md5_checksum,
                             svn_wc__db_t *db,
                             const char *wri_abspath,
-                            const svn_checksum_t *sha1_checksum,
+                            const svn_checksum_t *checksum,
                             apr_pool_t *result_pool,
                             apr_pool_t *scratch_pool)
 {
@@ -524,21 +524,21 @@ svn_wc__db_pristine_get_md5(const svn_ch
   svn_boolean_t have_row;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
-  SVN_ERR_ASSERT(sha1_checksum != NULL);
-  SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
+  SVN_ERR_ASSERT(checksum != NULL);
+  SVN_ERR_ASSERT(checksum->kind == svn_checksum_sha1);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
                               wri_abspath, scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(stmt_select_pristine(&have_row, md5_checksum, NULL, NULL,
-                               wcroot, sha1_checksum,
+                               wcroot, checksum,
                                result_pool, scratch_pool));
   if (!have_row)
     return svn_error_createf(SVN_ERR_WC_DB_ERROR, NULL,
                              _("The pristine text with checksum '%s' was "
                                "not found"),
-                             svn_checksum_to_cstring_display(sha1_checksum,
+                             svn_checksum_to_cstring_display(checksum,
                                                              scratch_pool));
 
   SVN_ERR_ASSERT((*md5_checksum)->kind == svn_checksum_md5);
@@ -548,12 +548,12 @@ svn_wc__db_pristine_get_md5(const svn_ch
 
 
 svn_error_t *
-svn_wc__db_pristine_get_sha1(const svn_checksum_t **sha1_checksum,
-                             svn_wc__db_t *db,
-                             const char *wri_abspath,
-                             const svn_checksum_t *md5_checksum,
-                             apr_pool_t *result_pool,
-                             apr_pool_t *scratch_pool)
+svn_wc__db_pristine_lookup_by_md5(const svn_checksum_t **checksum,
+                                  svn_wc__db_t *db,
+                                  const char *wri_abspath,
+                                  const svn_checksum_t *md5_checksum,
+                                  apr_pool_t *result_pool,
+                                  apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
@@ -561,7 +561,7 @@ svn_wc__db_pristine_get_sha1(const svn_c
   svn_boolean_t have_row;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
-  SVN_ERR_ASSERT(sha1_checksum != NULL);
+  SVN_ERR_ASSERT(checksum != NULL);
   SVN_ERR_ASSERT(md5_checksum->kind == svn_checksum_md5);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
@@ -579,8 +579,8 @@ svn_wc__db_pristine_get_sha1(const svn_c
                              svn_checksum_to_cstring_display(md5_checksum,
                                                              scratch_pool));
 
-  SVN_ERR(svn_sqlite__column_checksum(sha1_checksum, stmt, 0, result_pool));
-  SVN_ERR_ASSERT((*sha1_checksum)->kind == svn_checksum_sha1);
+  SVN_ERR(svn_sqlite__column_checksum(checksum, stmt, 0, result_pool));
+  SVN_ERR_ASSERT((*checksum)->kind == svn_checksum_sha1);
 
   return svn_error_trace(svn_sqlite__reset(stmt));
 }
@@ -776,7 +776,7 @@ svn_wc__db_pristine_transfer(svn_wc__db_
 
 
 
-/* If the pristine text referenced by SHA1_CHECKSUM in WCROOT/SDB, whose path
+/* If the pristine text referenced by CHECKSUM in WCROOT/SDB, whose path
  * within the pristine store is PRISTINE_ABSPATH, has a reference count of
  * zero, delete it (both the database row and the disk file).
  *
@@ -786,7 +786,7 @@ svn_wc__db_pristine_transfer(svn_wc__db_
 static svn_error_t *
 pristine_remove_if_unreferenced_txn(svn_sqlite__db_t *sdb,
                                     svn_wc__db_wcroot_t *wcroot,
-                                    const svn_checksum_t *sha1_checksum,
+                                    const svn_checksum_t *checksum,
                                     const char *pristine_abspath,
                                     apr_pool_t *scratch_pool)
 {
@@ -796,7 +796,7 @@ pristine_remove_if_unreferenced_txn(svn_
   /* Remove the DB row, if refcount is 0. */
   SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
                                     STMT_DELETE_PRISTINE_IF_UNREFERENCED));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, checksum, scratch_pool));
   SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
 
   /* If we removed the DB row, then remove the file. */
@@ -806,26 +806,26 @@ pristine_remove_if_unreferenced_txn(svn_
   return SVN_NO_ERROR;
 }
 
-/* If the pristine text referenced by SHA1_CHECKSUM in WCROOT has a
+/* If the pristine text referenced by CHECKSUM in WCROOT has a
  * reference count of zero, delete it (both the database row and the disk
  * file).
  *
  * Implements 'notes/wc-ng/pristine-store' section A-3(b). */
 static svn_error_t *
 pristine_remove_if_unreferenced(svn_wc__db_wcroot_t *wcroot,
-                                const svn_checksum_t *sha1_checksum,
+                                const svn_checksum_t *checksum,
                                 apr_pool_t *scratch_pool)
 {
   const char *pristine_abspath;
 
   SVN_ERR(get_pristine_fname(&pristine_abspath, wcroot->abspath,
-                             sha1_checksum, scratch_pool, scratch_pool));
+                             checksum, scratch_pool, scratch_pool));
 
   /* Ensure the SQL txn has at least a 'RESERVED' lock before we start looking
    * at the disk, to ensure no concurrent pristine install/delete txn. */
   SVN_SQLITE__WITH_IMMEDIATE_TXN(
     pristine_remove_if_unreferenced_txn(
-      wcroot->sdb, wcroot, sha1_checksum, pristine_abspath, scratch_pool),
+      wcroot->sdb, wcroot, checksum, pristine_abspath, scratch_pool),
     wcroot->sdb);
 
   return SVN_NO_ERROR;
@@ -834,21 +834,21 @@ pristine_remove_if_unreferenced(svn_wc__
 svn_error_t *
 svn_wc__db_pristine_remove(svn_wc__db_t *db,
                            const char *wri_abspath,
-                           const svn_checksum_t *sha1_checksum,
+                           const svn_checksum_t *checksum,
                            apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
-  SVN_ERR_ASSERT(sha1_checksum != NULL);
+  SVN_ERR_ASSERT(checksum != NULL);
   /* ### Transitional: accept MD-5 and look up the SHA-1.  Return an error
    * if the pristine text is not in the store. */
-  if (sha1_checksum->kind != svn_checksum_sha1)
-    SVN_ERR(svn_wc__db_pristine_get_sha1(&sha1_checksum, db, wri_abspath,
-                                         sha1_checksum,
-                                         scratch_pool, scratch_pool));
-  SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
+  if (checksum->kind != svn_checksum_sha1)
+    SVN_ERR(svn_wc__db_pristine_lookup_by_md5(&checksum, db, wri_abspath,
+                                              checksum,
+                                              scratch_pool, scratch_pool));
+  SVN_ERR_ASSERT(checksum->kind == svn_checksum_sha1);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
                               wri_abspath, scratch_pool, scratch_pool));
@@ -869,7 +869,7 @@ svn_wc__db_pristine_remove(svn_wc__db_t
   }
 
   /* If not referenced, remove the PRISTINE table row and the file. */
-  SVN_ERR(pristine_remove_if_unreferenced(wcroot, sha1_checksum, 
scratch_pool));
+  SVN_ERR(pristine_remove_if_unreferenced(wcroot, checksum, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -920,7 +920,7 @@ pristine_cleanup_wcroot(svn_wc__db_wcroo
   while (! err)
     {
       svn_boolean_t have_row;
-      const svn_checksum_t *sha1_checksum;
+      const svn_checksum_t *checksum;
 
       svn_pool_clear(iterpool);
 
@@ -928,9 +928,9 @@ pristine_cleanup_wcroot(svn_wc__db_wcroo
       if (! have_row)
         break;
 
-      SVN_ERR(svn_sqlite__column_checksum(&sha1_checksum, stmt, 0,
+      SVN_ERR(svn_sqlite__column_checksum(&checksum, stmt, 0,
                                           iterpool));
-      err = pristine_remove_if_unreferenced(wcroot, sha1_checksum,
+      err = pristine_remove_if_unreferenced(wcroot, checksum,
                                             iterpool);
     }
 
@@ -965,7 +965,7 @@ svn_wc__db_pristine_check(svn_boolean_t
                           svn_boolean_t *hydrated,
                           svn_wc__db_t *db,
                           const char *wri_abspath,
-                          const svn_checksum_t *sha1_checksum,
+                          const svn_checksum_t *checksum,
                           apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot;
@@ -973,9 +973,9 @@ svn_wc__db_pristine_check(svn_boolean_t
   svn_boolean_t have_row;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
-  SVN_ERR_ASSERT(sha1_checksum != NULL);
+  SVN_ERR_ASSERT(checksum != NULL);
 
-  if (sha1_checksum->kind != svn_checksum_sha1)
+  if (checksum->kind != svn_checksum_sha1)
     {
       *present = FALSE;
       if (hydrated)
@@ -990,7 +990,7 @@ svn_wc__db_pristine_check(svn_boolean_t
 
   /* Check that there is an entry in the PRISTINE table. */
   SVN_ERR(stmt_select_pristine(&have_row, NULL, NULL, hydrated,
-                               wcroot, sha1_checksum,
+                               wcroot, checksum,
                                scratch_pool, scratch_pool));
   *present = have_row;
   return SVN_NO_ERROR;
@@ -1000,7 +1000,7 @@ svn_wc__db_pristine_check(svn_boolean_t
 svn_error_t *
 svn_wc__db_pristine_dehydrate(svn_wc__db_t *db,
                               const char *wri_abspath,
-                              const svn_checksum_t *sha1_checksum,
+                              const svn_checksum_t *checksum,
                               apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot;
@@ -1012,7 +1012,7 @@ svn_wc__db_pristine_dehydrate(svn_wc__db
                               wri_abspath, scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
-  SVN_ERR(svn_wc__db_pristine_dehydrate_internal(wcroot, sha1_checksum,
+  SVN_ERR(svn_wc__db_pristine_dehydrate_internal(wcroot, checksum,
                                                  scratch_pool));
 
   return SVN_NO_ERROR;
@@ -1021,21 +1021,21 @@ svn_wc__db_pristine_dehydrate(svn_wc__db
 
 svn_error_t *
 svn_wc__db_pristine_dehydrate_internal(svn_wc__db_wcroot_t *wcroot,
-                                       const svn_checksum_t *sha1_checksum,
+                                       const svn_checksum_t *checksum,
                                        apr_pool_t *scratch_pool)
 {
   const char *pristine_abspath;
   svn_sqlite__stmt_t *stmt;
 
-  SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
+  SVN_ERR_ASSERT(checksum->kind == svn_checksum_sha1);
 
   SVN_ERR(get_pristine_fname(&pristine_abspath, wcroot->abspath,
-                             sha1_checksum,
+                             checksum,
                              scratch_pool, scratch_pool));
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_UPDATE_PRISTINE_HYDRATED));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, checksum, scratch_pool));
   SVN_ERR(svn_sqlite__bind_int(stmt, 2, FALSE));
   SVN_ERR(svn_sqlite__update(NULL, stmt));
 

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_private.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_private.h?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_private.h 
(original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_private.h 
Thu Jan 19 18:49:23 2023
@@ -571,7 +571,7 @@ svn_wc__db_verify_db_full_internal(svn_w
 svn_error_t *
 svn_wc__db_pristine_prepare_install_internal(svn_stream_t **stream_p,
                                              svn_wc__db_install_data_t 
**install_data_p,
-                                             svn_checksum_t **sha1_checksum_p,
+                                             svn_checksum_t **checksum_p,
                                              svn_checksum_t **md5_checksum_p,
                                              svn_wc__db_wcroot_t *wcroot,
                                              svn_boolean_t hydrated,
@@ -582,7 +582,7 @@ svn_wc__db_pristine_prepare_install_inte
    of DB+WRI_ABSPATH. */
 svn_error_t *
 svn_wc__db_pristine_dehydrate_internal(svn_wc__db_wcroot_t *wcroot,
-                                       const svn_checksum_t *sha1_checksum,
+                                       const svn_checksum_t *checksum,
                                        apr_pool_t *scratch_pool);
 
 #endif /* WC_DB_PRIVATE_H */

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_textbase.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_textbase.c?rev=1906819&r1=1906818&r2=1906819&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_textbase.c
 (original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_textbase.c
 Thu Jan 19 18:49:23 2023
@@ -173,13 +173,13 @@ textbase_hydrate(svn_wc__db_wcroot_t *wc
 {
   svn_stream_t *install_stream;
   svn_wc__db_install_data_t *install_data;
-  svn_checksum_t *install_sha1_checksum;
+  svn_checksum_t *install_checksum;
   svn_checksum_t *install_md5_checksum;
   svn_error_t *err;
 
   SVN_ERR(svn_wc__db_pristine_prepare_install_internal(
             &install_stream, &install_data,
-            &install_sha1_checksum, &install_md5_checksum,
+            &install_checksum, &install_md5_checksum,
             wcroot, TRUE, scratch_pool, scratch_pool));
 
   err = fetch_callback(fetch_baton, repos_root_url,
@@ -191,10 +191,10 @@ textbase_hydrate(svn_wc__db_wcroot_t *wc
     return svn_error_compose_create(err,
              svn_wc__db_pristine_install_abort(install_data, scratch_pool));
 
-  if (!svn_checksum_match(checksum, install_sha1_checksum))
+  if (!svn_checksum_match(checksum, install_checksum))
     {
       err = svn_checksum_mismatch_err(
-              checksum, install_sha1_checksum, scratch_pool,
+              checksum, install_checksum, scratch_pool,
               _("Checksum mismatch while fetching text base"));
 
       return svn_error_compose_create(err,
@@ -202,7 +202,7 @@ textbase_hydrate(svn_wc__db_wcroot_t *wc
     }
 
   err = svn_wc__db_pristine_install(install_data,
-                                    install_sha1_checksum,
+                                    install_checksum,
                                     install_md5_checksum,
                                     scratch_pool);
   if (err)


Reply via email to