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

Re: [PATCH] svn_client_diff_summarize() reports 'normal' if properties were changed

From: Martin Hauner <Martin.Hauner_at_gmx.net>
Date: 2006-04-25 08:51:48 CEST

Hi,

Stefan Küng wrote:
> Martin Hauner wrote:
> > Stefan Küng wrote:
[..]

> > > Index: subversion/libsvn_client/repos_diff_summarize.c
> > > ===================================================================
> > > --- subversion/libsvn_client/repos_diff_summarize.c (revision
> 19446)
> > > +++ subversion/libsvn_client/repos_diff_summarize.c (working copy)
> > > @@ -89,8 +89,12 @@
> > > {
> > > svn_client_diff_summarize_t *sum;
> > > if (ib->summarize)
> > > + {
> > > + if (ib->summarize == svn_client_diff_summarize_kind_normal)
> > > + ib->summarize = sum_kind;
> >
> > This looks strange here, shouldn't it be something like
> >
> > if (sum->summarize_kind != svn_client_diff_summarize_kind_normal)
> > sum->summarize_kind = sum_kind;
> >
> > and after the alloc?
>
> Not really. You now overwrite the summarize_kind if it's *not* normal.
> [..]

ah, of course, not or not not :)

> It's not necessary to do that after the alloc. Because we overwrite the
> kind if it already is set..
> [..]

Yes, i see. It is a lot easier to read after applying the patch :)

> svn_client_diff_summarize_t *sum;
> if (ib->summarize)
> + {
> + if (ib->summarize == svn_client_diff_summarize_kind_normal)
> + ib->summarize = sum_kind;

Still, ib->summarize is an svn_client_diff_summarize_t pointer and
not the kind value in the svn_client_diff_summarize_t struct you
want to check and set.

Using the sum pointer in my code is wrong too because it is not
initialized at that point, so i think the if should be

if (ib->summarize->summarize_kind == svn_client_diff_summarize_kind_normal)
     ib->summarize->summarize_kind = sum_kind;

-- 
Martin
Subcommander, http://subcommander.tigris.org
a cross platform Win32/Unix/MacOSX subversion gui
client & diff/merge tool.
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Apr 25 08:52:17 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.