subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r933272 - in /subversion/trunk/subversion/libsvn_wc: update_editor.c wc_db.c
Date Mon, 12 Apr 2010 15:19:23 GMT
Author: julianfoad
Date: Mon Apr 12 15:19:23 2010
New Revision: 933272

URL: http://svn.apache.org/viewvc?rev=933272&view=rev
Log:
Follow-ups to the pristine-text functions added in r932361 and r932459.

* subversion/libsvn_wc/update_editor.c
  (merge_file): Catch a possible error which was being leaked.

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_get_pristine_md5): Return an error if the SHA-1 checksum is
    not found. Reset the statement after using it.

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

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=933272&r1=933271&r2=933272&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Mon Apr 12 15:19:23 2010
@@ -4588,9 +4588,11 @@ merge_file(svn_boolean_t *install_pristi
        * 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. */
-      svn_wc__db_temp_set_base_checksum(eb->db, fb->local_abspath,
-                                        new_text_base_sha1_checksum, pool);
+       * 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
     }
 

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=933272&r1=933271&r2=933272&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon Apr 12 15:19:23 2010
@@ -7254,13 +7254,17 @@ svn_wc__db_get_pristine_md5(const svn_ch
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   if (!have_row)
     {
-      *md5_checksum = NULL;  /* ### that's not what we want. Report an error
-                                instead. */
-      return svn_error_return(svn_sqlite__reset(stmt));
+      *md5_checksum = NULL;
+      SVN_ERR(svn_sqlite__reset(stmt));
+      return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+                               _("The pristine text with checksum '%s' was "
+                                 "not found"),
+                               svn_checksum_to_cstring_display(sha1_checksum,
+                                                               scratch_pool));
     }
 
   SVN_ERR(svn_sqlite__column_checksum(md5_checksum, stmt, 0, scratch_pool));
 
   SVN_ERR_ASSERT((*md5_checksum)->kind == svn_checksum_md5);
-  return SVN_NO_ERROR;
+  return svn_error_return(svn_sqlite__reset(stmt));
 }



Mime
View raw message