subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1095515 - /subversion/trunk/subversion/libsvn_wc/upgrade.c
Date Wed, 20 Apr 2011 21:18:40 GMT
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));
 



Mime
View raw message