You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/04/13 17:53:49 UTC

svn commit: r933688 - in /subversion/trunk/subversion/libsvn_wc: update_editor.c wc_db.c wc_db.h

Author: julianfoad
Date: Tue Apr 13 15:53:49 2010
New Revision: 933688

URL: http://svn.apache.org/viewvc?rev=933688&view=rev
Log:
Replace a bit of experimental pristine-store-SHA1 code with something better.

* subversion/libsvn_wc/update_editor.c
  (merge_file): Remove the svn_wc__db_temp_set_base_checksum() call.
  (close_file): With SVN_EXPERIMENTAL, store the SHA-1 instead of the MD-5.

* subversion/libsvn_wc/wc_db.h,
  subversion/libsvn_wc/wc_db.c
  (svn_wc__db_temp_set_base_checksum): Delete.

Modified:
    subversion/trunk/subversion/libsvn_wc/update_editor.c
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/libsvn_wc/wc_db.h

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=933688&r1=933687&r2=933688&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Tue Apr 13 15:53:49 2010
@@ -4610,20 +4610,6 @@ merge_file(svn_boolean_t *install_pristi
                                 new_text_base_tmp_abspath,
                                 fb->text_base_abspath,
                                 pool));
-
-#ifdef SVN_EXPERIMENTAL
-      /* ### this should probably move into close_file.  */
-
-      /* Set the 'checksum' column of the file's BASE_NODE row to
-       * NEW_TEXT_BASE_SHA1_CHECKSUM.  The pristine text identified by that
-       * checksum is already in the pristine store. */
-      /* ### This should be done as part of a single "global_update"
-       * operation. It's no good doing it here, as the BASE_NODE for
-       * LOCAL_ABSPATH doesn't (always?) even exist at this point. */
-      SVN_ERR(svn_wc__db_temp_set_base_checksum(eb->db, fb->local_abspath,
-                                                new_text_base_sha1_checksum,
-                                                pool));
-#endif
     }
 
   /* Log commands to handle text-timestamp and working-size,
@@ -4846,7 +4832,14 @@ close_file(void *file_baton,
 
   /* Insert/replace the BASE node with all of the new metadata.  */
   {
+#ifdef SVN_EXPERIMENTAL
+      /* Set the 'checksum' column of the file's BASE_NODE row to
+       * NEW_TEXT_BASE_SHA1_CHECKSUM.  The pristine text identified by that
+       * checksum is already in the pristine store. */
+    const svn_checksum_t *new_checksum = new_text_base_sha1_checksum;
+#else
     const svn_checksum_t *new_checksum = new_text_base_md5_checksum;
+#endif
 
     /* If we don't have a NEW checksum, then the base must not have changed.
        Just carry over the old checksum.  */

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=933688&r1=933687&r2=933688&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Apr 13 15:53:49 2010
@@ -7193,40 +7193,6 @@ svn_wc__db_temp_get_file_external(const 
 
 
 svn_error_t *
-svn_wc__db_temp_set_base_checksum(svn_wc__db_t *db,
-                                  const char *local_abspath,
-                                  const svn_checksum_t *new_sha1_checksum,
-                                  apr_pool_t *scratch_pool)
-{
-  svn_sqlite__stmt_t *stmt;
-  const char *new_sha1_digest;
-  int affected;
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
-  SVN_ERR_ASSERT(new_sha1_checksum->kind == svn_checksum_sha1);
-
-  new_sha1_digest = svn_checksum_serialize(new_sha1_checksum,
-                                           scratch_pool, scratch_pool);
-
-  SVN_ERR(get_statement_for_path(&stmt, db, local_abspath,
-                                 STMT_UPDATE_BASE_PRISTINE_CHECKSUM,
-                                 scratch_pool));
-  SVN_ERR(svn_sqlite__bind_text(stmt, 3, new_sha1_digest));
-  SVN_ERR(svn_sqlite__update(&affected, stmt));
-
-  if (affected != 1)
-    {
-      SVN_ERR_ASSERT(affected == 0);
-      return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
-                               _("'%s' has no BASE_NODE"),
-                               svn_dirent_local_style(local_abspath,
-                                                      scratch_pool));
-    }
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
 svn_wc__db_get_pristine_md5(const svn_checksum_t **md5_checksum,
                             svn_wc__db_t *db,
                             const char *wri_abspath,

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=933688&r1=933687&r2=933688&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Tue Apr 13 15:53:49 2010
@@ -2160,16 +2160,6 @@ svn_wc__db_temp_get_file_external(const 
                                   apr_pool_t *scratch_pool);
 
 
-/* Set the pristine text SHA-1 checksum for the BASE_NODE of LOCAL_ABSPATH
-   to NEW_SHA1_CHECKSUM.  The pristine text identified by NEW_SHA1_CHECKSUM
-   must already be in the pristine store. */
-svn_error_t *
-svn_wc__db_temp_set_base_checksum(svn_wc__db_t *db,
-                                  const char *local_abspath,
-                                  const svn_checksum_t *new_sha1_checksum,
-                                  apr_pool_t *scratch_pool);
-
-
 /* Remove a stray "subdir" record in the BASE_NODE table.  */
 svn_error_t *
 svn_wc__db_temp_remove_subdir_record(svn_wc__db_t *db,