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

Re: svn commit: r1238932 - /subversion/trunk/subversion/libsvn_delta/compat.c

From: Greg Stein <gstein_at_gmail.com>
Date: Wed, 1 Feb 2012 00:07:03 -0500

On Tue, Jan 31, 2012 at 23:35, <hwright_at_apache.org> wrote:
>...
> +++ subversion/trunk/subversion/libsvn_delta/compat.c Wed Feb  1 04:35:54 2012
> @@ -937,6 +937,7 @@ struct operation {
>   svn_kind_t kind;  /* to copy, mkdir, put or set revprops */
>   svn_revnum_t base_revision;       /* When committing, the base revision */
>   svn_revnum_t copyfrom_revision;      /* to copy, valid for add and replace */
> +  svn_checksum_t *new_checksum;   /* An MD5 hash of the new contents, if any */
>   const char *copyfrom_url;       /* to copy, valid for add and replace */
>   const char *src_file;  /* for put, the source file for contents */
>   apr_hash_t *children;  /* const char *path -> struct operation * */
> @@ -1024,6 +1025,7 @@ build(struct editor_baton *eb,
>       svn_revnum_t rev,
>       apr_hash_t *props,
>       const char *src_file,
> +      svn_checksum_t *checksum,

Why are these not const? It will save you casts later on, and is Better anyways.

>...
> @@ -1205,6 +1208,14 @@ add_file_cb(void *baton,
>   struct editor_baton *eb = baton;
>   const char *tmp_filename;
>   svn_stream_t *tmp_stream;
> +  svn_checksum_t *md5_checksum;
> +
> +  /* We may need to re-checksum these contents */
> +  if (!(checksum && checksum->kind == svn_checksum_md5))
> +    contents = svn_stream_checksummed2(contents, &md5_checksum, NULL,
> +                                       svn_checksum_md5, TRUE, scratch_pool);
> +  else
> +    md5_checksum = (svn_checksum_t *)checksum;

^^ ugly.

>...
> @@ -1304,17 +1315,24 @@ set_text_cb(void *baton,
>   struct editor_baton *eb = baton;
>   const char *tmp_filename;
>   svn_stream_t *tmp_stream;
> +  svn_checksum_t *md5_checksum;
> +
> +  /* We may need to re-checksum these contents */
> +  if (!(checksum && checksum->kind == svn_checksum_md5))
> +    contents = svn_stream_checksummed2(contents, &md5_checksum, NULL,
> +                                       svn_checksum_md5, TRUE, scratch_pool);
> +  else
> +    md5_checksum = (svn_checksum_t *)checksum;

Just as ugly.

>...

Cheers,
-g
Received on 2012-02-01 07:09:57 CET

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