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

Re: svn commit: r1067195 - in /subversion/trunk/subversion: include/svn_checksum.h libsvn_client/export.c libsvn_subr/checksum.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Tue, 8 Feb 2011 03:44:35 +0200

Hyrum K Wright wrote on Fri, Feb 04, 2011 at 09:28:04 -0600:
> Reviewing my own commits...
>
> On Fri, Feb 4, 2011 at 9:20 AM, <hwright_at_apache.org> wrote:
> > +++ subversion/trunk/subversion/libsvn_client/export.c Fri Feb  4 15:20:50 2011
> > @@ -900,8 +900,9 @@ close_file(void *file_baton,
> >   actual_checksum = svn_checksum__from_digest(fb->text_digest,
> >                                               svn_checksum_md5, pool);
> >
> > -  SVN_ERR(svn_checksum_mismatch_err(svn_dirent_local_style(fb->path, pool),
> > -                                    text_checksum, actual_checksum, pool));
> > +  SVN_ERR(svn_checksum_mismatch_err(text_checksum, actual_checksum, pool,
> > +                                    _("Checksum mismatch for '%s'"),
> > +                                    svn_dirent_local_style(fb->path, pool)));
>
> Although the use of svn_checksum_mismatch_err() simplifies the code
> and consolidates various messages for translation, it does have one
> drawback: the call to svn_dirent_local_style() is now unconditional,
> rather than only being invoked in the (unlikely) event of a checksum
> mismatch. Is this enough of a drawback that I should revert the past
> couple of commits in this area?
>

Does it compute that string now for every path in an exported tree?
+1 to avoiding that if possible.

> -Hyrum
>
> >
> >   if ((! fb->eol_style_val) && (! fb->keywords_val) && (! fb->special))
> >     {
> >
> > Modified: subversion/trunk/subversion/libsvn_subr/checksum.c
> > URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/checksum.c?rev=1067195&r1=1067194&r2=1067195&view=diff
> > ==============================================================================
> > --- subversion/trunk/subversion/libsvn_subr/checksum.c (original)
> > +++ subversion/trunk/subversion/libsvn_subr/checksum.c Fri Feb  4 15:20:50 2011
> > @@ -402,21 +402,28 @@ svn_checksum_size(const svn_checksum_t *
> >  }
> >
> >  svn_error_t *
> > -svn_checksum_mismatch_err(const char *object_label,
> > -                          const svn_checksum_t *expected,
> > +svn_checksum_mismatch_err(const svn_checksum_t *expected,
> >                           const svn_checksum_t *actual,
> > -                          apr_pool_t *scratch_pool)
> > +                          apr_pool_t *scratch_pool,
> > +                          const char *fmt,
> > +                          ...)
> >  {
> >   if (!svn_checksum_match(expected, actual))
> >     {
> > +      va_list ap;
> > +      const char *desc;
> > +
> > +      va_start(ap, fmt);
> > +      desc = apr_pvsprintf(scratch_pool, fmt, ap);
> > +      va_end(ap);
> > +
> >       return svn_error_createf(SVN_ERR_CHECKSUM_MISMATCH, NULL,
> > -             apr_psprintf(scratch_pool, "%s:\n%s\n%s\n",
> > -                          _("Checksum mismatch for '%s'\n"),
> > -                          _("   expected:  %s"),
> > -                          _("     actual:  %s")),
> > -             object_label,
> > -             svn_checksum_to_cstring_display(expected, scratch_pool),
> > -             svn_checksum_to_cstring_display(actual, scratch_pool));
> > +                               _("%s:\n"
> > +                                 "   expected:  %s\n"
> > +                                 "     actual:  %s\n"),
> > +                    desc,
> > +                    svn_checksum_to_cstring_display(expected, scratch_pool),
> > +                    svn_checksum_to_cstring_display(actual, scratch_pool));
> >     }
> >   else
> >     return SVN_NO_ERROR;
> >
> >
> >
Received on 2011-02-08 02:49:27 CET

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.