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

Re: svn commit: r943460 - /subversion/trunk/subversion/libsvn_wc/update_editor.c

From: Greg Stein <gstein_at_gmail.com>
Date: Wed, 12 May 2010 09:14:21 -0400

On Wed, May 12, 2010 at 07:58, <julianfoad_at_apache.org> wrote:
>...
> +++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed May 12 11:58:16 2010
> @@ -4717,27 +4717,38 @@ close_file(void *file_baton,
>     SVN_ERR(svn_checksum_parse_hex(&expected_md5_checksum, svn_checksum_md5,
>                                    expected_md5_digest, pool));
>
> -  /* Was this an add-with-history, with no apply_textdelta? */
> -  if (fb->added_with_history && ! fb->received_textdelta)
> +  /* Retrieve the new text-base file's path and checksums.  If it was an
> +   * add-with-history, with no apply_textdelta, then that means the text-base
> +   * of the copied file, else the new text-base created by apply_textdelta(),
> +   * if any. */

Style nit: all but one the comments in close_file() do not use the
leading-asterisk format for comments (the other is one you added :-P
).

> +  if (fb->received_textdelta)
>     {
> -      SVN_ERR_ASSERT(! fb->new_text_base_tmp_abspath
> -                     && fb->copied_text_base_abspath);
> -
> +      new_text_base_md5_checksum = fb->new_text_base_md5_checksum;
> +      new_text_base_sha1_checksum = fb->new_text_base_sha1_checksum;
> +      new_text_base_abspath = fb->new_text_base_tmp_abspath;
> +      SVN_ERR_ASSERT(new_text_base_md5_checksum &&
> +                     new_text_base_sha1_checksum &&
> +                     new_text_base_abspath);

Style nit: pls move the && operators down to the beginning of the next
line. It is easier to read how the terms are joined when the operator
leads, rather than follows (see the ASSERT that you removed a few
lines above).

> +    }
> +  else if (fb->added_with_history)
> +    {
> +      SVN_ERR_ASSERT(! fb->new_text_base_tmp_abspath);
>       new_text_base_md5_checksum = fb->copied_text_base_md5_checksum;
>       new_text_base_sha1_checksum = fb->copied_text_base_sha1_checksum;
>       new_text_base_abspath = fb->copied_text_base_abspath;
> -      SVN_ERR_ASSERT(svn_dirent_is_absolute(new_text_base_abspath));
> +      SVN_ERR_ASSERT(new_text_base_md5_checksum &&
> +                     new_text_base_sha1_checksum &&
> +                     new_text_base_abspath);

Same.

>     }
>   else
>     {
> -      /* Pull the actual checksum from the file_baton, computed during
> -         the application of a text delta. */
> -      new_text_base_md5_checksum = fb->new_text_base_md5_checksum;
> -      new_text_base_sha1_checksum = fb->new_text_base_sha1_checksum;
> -      new_text_base_abspath = fb->new_text_base_tmp_abspath;
> +      SVN_ERR_ASSERT(! fb->new_text_base_tmp_abspath
> +                     && ! fb->copied_text_base_abspath);

Good :-)

>...

Cheers,
-g
Received on 2010-05-12 15:14:53 CEST

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.