[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit r18944: Avoid reading the textbase file twice...

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-03-18 16:45:39 CET

> r18944 | lundblad | 2006-03-18 11:14:05 +0000 (Sat, 18 Mar 2006) | 24 lines
>
> Avoid reading the textbase file twice when transmitting file changes
> during commit by calculating the MD5 checksum while reading the file for
> delta computation.

Excellent work.

Just a couple of minor comments about comments.

> Index: subversion/include/svn_io.h
> ===================================================================
> --- subversion/include/svn_io.h (revision 18943)
> +++ subversion/include/svn_io.h (revision 18944)
> @@ -619,6 +619,9 @@
> * Both @a read_digest and @a write_digest
> * can be @c NULL, in which case the respective checksum isn't calculated.
> *
> + * If @a read_all is true, make sure that all data available on @a
> + * stream is read when the stream is closed.

It's obvious in a way, but not completely clear at first sight whether the
remaining data contributes to the checksum or is just read and discarded.
Could you change "read" to "read and checksummed"?

> +svn_stream_t *svn_stream_checksummed(svn_stream_t *stream,
> + const unsigned char **read_digest,
> + const unsigned char **write_digest,
> + svn_boolean_t read_all,
> + apr_pool_t *pool);

> @@ -759,66 +764,24 @@
> svn_path_local_style(path, pool));
>
> /* For backwards compatibility, no checksum means assume a match. */

This reference to "no checksum" really referred to the following "if" which you
have deleted or moved. It may still be correct in itself, but it doesn't make
so much sense in its new context because this is no longer where the code
notices a missing checksum.

> - if (ent->checksum)
> - {
[...]
> - }
> -
> + entry_digest_hex = ent->checksum;
> SVN_ERR(svn_wc__open_text_base(&basefile, path, APR_READ, pool));

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Mar 18 16:46:47 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.