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

Re: svn commit: r21504 - in branches/merge-tracking: . subversion/libsvn_client subversion/tests/cmdline

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-09-19 15:23:15 CEST

dlr@tigris.org wrote:
> Author: dlr
> Date: Thu Sep 14 16:56:47 2006
> New Revision: 21504
>
> Log:
> On the merge-tracking branch: Handle skip notifications encountered
> while performing a merge. If all changes in a merge are skipped, no
> merge info is recorded for the target. If only some changes are
> skipped, merge info is recorded for the target, and recorded as empty
> (or with no modifications, if there is pre-existing merge info) for
> the skipped items.
>
> Open question: When directories are skipped, should we record merge
> info for its children (to avoid them being overridden to having no
> merge info from the merge), or are they too considered skipped?
>
> * TODO
> Update for fix to merge test #3.
>
> * subversion/libsvn_client/diff.c
> (notification_receiver_baton_t): Add new nbr_notifications field, a
> counter for the number of notifications occurring over the coure of
>
Typo here 'coure' -> 'course'
> a merge.
>
> (notification_receiver): Increment BATON->nbr_notifications.
>
> (determine_merges_performed): Avoid recording any merge info when
> all paths touched by a merge are skipped. Add question about
> children of a skipped directory.
>
> (do_merge, do_single_file_merge): Initialize nbr_notifications to 0,
> and clear the counter after merging a revision range.
>
> * subversion/tests/cmdline/merge_tests.py
> (delete_file_and_dir): Fix test, accounting for the fact that we no
> longer record merge info when all paths touched by a merge are
> skipped.
>
>
> Modified:
> branches/merge-tracking/TODO
> branches/merge-tracking/subversion/libsvn_client/diff.c
> branches/merge-tracking/subversion/tests/cmdline/merge_tests.py
>
> Modified: branches/merge-tracking/TODO
> URL: http://svn.collab.net/viewvc/svn/branches/merge-tracking/TODO?pathrev=21504&r1=21503&r2=21504
> ==============================================================================
> --- branches/merge-tracking/TODO (original)
> +++ branches/merge-tracking/TODO Thu Sep 14 16:56:47 2006
> @@ -39,10 +39,7 @@
> collisions (multiple notifications to the same WC item), giving
> preference to later notifications (?).
>
> - * Handle skips. Merge test 3 fails because a merge of a revision
> - range which contains a delete will not delete locally modified
> - files (at least, not without --force), but is still recording
> - merge info.
> + * Handle skips.
>
> * If all changes in a merge are skipped, no merge info should be
> recorded for the target.
>
> Modified: branches/merge-tracking/subversion/libsvn_client/diff.c
> URL: http://svn.collab.net/viewvc/svn/branches/merge-tracking/subversion/libsvn_client/diff.c?pathrev=21504&r1=21503&r2=21504
> ==============================================================================
> --- branches/merge-tracking/subversion/libsvn_client/diff.c (original)
> +++ branches/merge-tracking/subversion/libsvn_client/diff.c Thu Sep 14 16:56:47 2006
> @@ -1921,6 +1921,9 @@
> svn_wc_notify_func2_t wrapped_func;
> void *wrapped_baton;
>
> + /* The number of notifications received. */
> + apr_int32_t nbr_notifications;
> +
>
Why not this be apr_uint32_t? My 1 cent :)
> /* The list of any skipped paths, which should be examined and
> cleared after each invocation of the callback. */
> apr_array_header_t *skipped_paths;
> @@ -1937,6 +1940,8 @@
> {
> notification_receiver_baton_t *notify_b = baton;
>
> + notify_b->nbr_notifications++;
> +
> if (notify->action == svn_wc_notify_skip)
> {
> if (notify_b->skipped_paths == NULL)
> @@ -1968,9 +1973,14 @@
> apr_array_header_t *rangelist = apr_array_make(pool, 1, sizeof(*range));
> *merges = apr_hash_make(pool);
> APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) = range;
> - /* ### FIXME: What if the root of the target path wasn't merged
> - ### either (e.g. only its children were)? */
> - apr_hash_set(*merges, target_wcpath, APR_HASH_KEY_STRING, rangelist);
> +
> + /* If we skipped all the paths which would've been modified, avoid
> + setting merge info for the target of the tree.

> If we happen to
> + skip the root of the target path too (e.g. only its children were
> + merged), it will be unflagged as merged further below. */
>
This line seems bit tricky for me atleast :). Especially the line "it
will be unflagged as merged further below.", I presume 'it' as 'root of
the target path'.
If I understand it it should something like this. "it(root of the target
path)'s mergeinfo property will be undisturbed", affected children
optimally(todo???) set the corresponding mergeinfo properly".
> + if (notify_b->skipped_paths == NULL ||
> + notify_b->skipped_paths->nelts >= notify_b->nbr_notifications)
>
I hope the logic here is wrong or incomplete. If I understand it
correctly 'notify_b->skipped_paths->nelts' should never be greater than
'notify_b->nbr_notifications'

With regards
Kamesh Jayachandran

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Sep 19 15:23:11 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.