You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/04/20 23:18:40 UTC

svn commit: r1095515 - /subversion/trunk/subversion/libsvn_wc/upgrade.c

Author: rhuijben
Date: Wed Apr 20 21:18:40 2011
New Revision: 1095515

URL: http://svn.apache.org/viewvc?rev=1095515&view=rev
Log:
* subversion/libsvn_wc/upgrade.c
  (migrate_text_bases): Read the file once to calculate two checksums.

Modified:
    subversion/trunk/subversion/libsvn_wc/upgrade.c

Modified: subversion/trunk/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/upgrade.c?rev=1095515&r1=1095514&r2=1095515&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/trunk/subversion/libsvn_wc/upgrade.c Wed Apr 20 21:18:40 2011
@@ -1012,10 +1012,23 @@ migrate_text_bases(apr_hash_t **text_bas
                complexity. :)  */
 
         /* Gather the two checksums. */
-        SVN_ERR(svn_io_file_checksum2(&md5_checksum, text_base_path,
-                                      svn_checksum_md5, iterpool));
-        SVN_ERR(svn_io_file_checksum2(&sha1_checksum, text_base_path,
-                                      svn_checksum_sha1, iterpool));
+        {
+          svn_stream_t *read_stream;
+
+          SVN_ERR(svn_stream_open_readonly(&read_stream, text_base_path,
+                                           iterpool, iterpool));
+
+          read_stream = svn_stream_checksummed2(read_stream, &md5_checksum,
+                                                NULL, svn_checksum_md5, 
+                                                TRUE, iterpool);
+
+          read_stream = svn_stream_checksummed2(read_stream, &sha1_checksum,
+                                                NULL, svn_checksum_sha1,
+                                                TRUE, iterpool);
+
+           /* This calculates the hash */
+          SVN_ERR(svn_stream_close(read_stream));
+        }
 
         SVN_ERR(svn_io_stat(&finfo, text_base_path, APR_FINFO_SIZE, iterpool));