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

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

From: Madan U Sreenivasan <madan_at_collab.net>
Date: 2006-07-17 14:30:50 CEST

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. 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?

[[[
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.

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