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/26 18:08:57 UTC
svn commit: r938107 - in /subversion/trunk/subversion: include/svn_wc.h
libsvn_wc/adm_crawler.c
Author: julianfoad
Date: Mon Apr 26 16:08:57 2010
New Revision: 938107
URL: http://svn.apache.org/viewvc?rev=938107&view=rev
Log:
Change svn_wc_transmit_text_deltas3() so that it can store the new pristine
text in the pristine text store. In this version, it can store it the old
way or the new way, as requested by the caller.
* subversion/include/svn_wc.h
(svn_wc_transmit_text_deltas3): Document the new behaviour.
* subversion/libsvn_wc/adm_crawler.c
(svn_wc__internal_transmit_text_deltas): If the SHA-1 checksum is
requested, store a copy of the new pristine text in the pristine text
store.
Modified:
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_wc/adm_crawler.c
Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=938107&r1=938106&r2=938107&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Mon Apr 26 16:08:57 2010
@@ -7151,7 +7151,10 @@ svn_wc_translated_stream(svn_stream_t **
* If @a new_text_base_md5_checksum is non-NULL, set
* @a *new_text_base_md5_checksum to the MD5 checksum of (@a local_abspath
* translated to repository-normal form), allocated in @a result_pool.
- * Similarly for @a new_text_base_sha1_checksum.
+ *
+ * If @a new_text_base_sha1_checksum in non-NULL, store a copy of (@a
+ * local_abspath translated to repository-normal form) in the pristine text
+ * store, and set @a *new_text_base_sha1_checksum to its SHA-1 checksum.
*
* If @a fulltext, send the untranslated copy of @a local_abspath through
* @a editor as full-text; else send it as svndiff against the current text
Modified: subversion/trunk/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_crawler.c?rev=938107&r1=938106&r2=938107&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_crawler.c Mon Apr 26 16:08:57 2010
@@ -1060,6 +1060,7 @@ svn_wc__internal_transmit_text_deltas(co
svn_checksum_t *verify_checksum = NULL; /* 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 */
+ const char *new_pristine_tmp_abspath;
svn_error_t *err;
svn_stream_t *base_stream; /* delta source */
svn_stream_t *local_stream; /* delta target: LOCAL_ABSPATH transl. to NF */
@@ -1093,6 +1094,18 @@ svn_wc__internal_transmit_text_deltas(co
is closed. */
local_stream = copying_stream(local_stream, tempstream, scratch_pool);
}
+ if (new_text_base_sha1_checksum)
+ {
+ svn_stream_t *new_pristine_stream;
+
+ SVN_ERR(svn_wc__open_writable_base(&new_pristine_stream,
+ &new_pristine_tmp_abspath,
+ NULL, &local_sha1_checksum,
+ db, local_abspath,
+ scratch_pool, scratch_pool));
+ local_stream = copying_stream(local_stream, new_pristine_stream,
+ scratch_pool);
+ }
/* Set BASE_STREAM to a stream providing the base (source) content for the
* delta, which may be an empty stream;
@@ -1192,12 +1205,6 @@ svn_wc__internal_transmit_text_deltas(co
&handler, &wh_baton));
}
- if (new_text_base_sha1_checksum)
- local_stream = svn_stream_checksummed2(local_stream,
- &local_sha1_checksum,
- NULL, svn_checksum_sha1, TRUE,
- scratch_pool);
-
/* Run diff processing, throwing windows at the handler. */
err = svn_txdelta_run(base_stream, local_stream,
handler, wh_baton,
@@ -1264,8 +1271,14 @@ svn_wc__internal_transmit_text_deltas(co
*new_text_base_md5_checksum = svn_checksum_dup(local_md5_checksum,
result_pool);
if (new_text_base_sha1_checksum)
- *new_text_base_sha1_checksum = svn_checksum_dup(local_sha1_checksum,
- result_pool);
+ {
+ SVN_ERR(svn_wc__db_pristine_install(db, new_pristine_tmp_abspath,
+ local_sha1_checksum,
+ local_md5_checksum,
+ scratch_pool));
+ *new_text_base_sha1_checksum = svn_checksum_dup(local_sha1_checksum,
+ result_pool);
+ }
/* Close the file baton, and get outta here. */
return editor->close_file(file_baton,