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

Re: [PATCH] Handle loop-critical variable in parse_mergeinfo_from_db()

From: Daniel Berlin <dberlin_at_dberlin.org>
Date: 2006-07-17 17:33:46 CEST

Madan U Sreenivasan wrote:
> Hi,
>
> In the merge-tracking branch:
>
> Currently parse_mergeinfo_from_db() - I wonder why it is not
> parse_merge_info_from_db() - will fail for mergeinfo from more than one
> source.

> This is because, the variable lastmergedfrom (which is used in the
> if condition that creates new hash key-value pairs and reinitializes the
> value array) is never set. The attached patch fixes this.
>
> I feel the while loop could be simpler, but this patch only does whats
> best with the existing code.

It's not the easiest code in the world to understand, granted.
It could be written nicer, I just wanted something that worked.

 The while loop fixing is a different problem.
> :)
>
> I also see that the parse_mergeinfo_from_db() function contains empty
> lines with whitespaces. Maybe we should take this up and remove the
> whitespaces. Any committer volunteers?

Feel free to just whitespace-cleanup the region and commit the result.

>
> [[[
> Fix loop-critical variable handling in parse_mergeinfo_from_db().
> Currently, this variable is never set, but is tested against in an 'if'
> condition.
>
> (In branches/merge-tracking)
>
> * subversion/libsvn_fs_fs/tree.c:
> (parse_mergeinfo_from_db): Set lastmergedfrom before before looping
> again.
> ]]]
>
> Regards,
> Madan.
>
>
> ------------------------------------------------------------------------
>
> Index: subversion/libsvn_fs_fs/tree.c
> ===================================================================
> --- subversion/libsvn_fs_fs/tree.c (revision 20698)
> +++ subversion/libsvn_fs_fs/tree.c (working copy)
> @@ -1167,6 +1167,7 @@
> temprange->end = endrev;
> APR_ARRAY_PUSH(pathranges, svn_merge_range_t *) = temprange;
> sqlite_result = sqlite3_step(stmt);
> + lastmergedfrom = mergedfrom;
> }
> apr_hash_set(*result, mergedfrom, APR_HASH_KEY_STRING, pathranges);
>
>
>
> ------------------------------------------------------------------------
>
> Fix loop-critical variable handling in parse_mergeinfo_from_db().
> Currently, this variable is never set, but is tested against in an 'if'
> condition.
>
> (In branches/merge-tracking)
>
> * subversion/libsvn_fs_fs/tree.c:
> (parse_mergeinfo_from_db): Set lastmergedfrom before before looping
> again.

This patch is fine, please commit it.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jul 17 17:36:13 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.