[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-15 14:52:20 CEST

After this fix merge-tests.py 7, 8, 16 started failing which earlier
used to succeed.

With regards
Kamesh Jayachandran
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
> 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;
> +
> /* 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. */
> + if (notify_b->skipped_paths == NULL ||
> + notify_b->skipped_paths->nelts >= notify_b->nbr_notifications)
> + apr_hash_set(*merges, target_wcpath, APR_HASH_KEY_STRING, rangelist);
>
> /* Override the merge info for child paths which weren't actually
> merged. */
> @@ -1980,11 +1990,16 @@
> for (i = 0; i < notify_b->skipped_paths->nelts; i++)
> {
> /* Add an empty range list for this path. */
> - /* ### Sometimes a path exists more than once... */
> apr_hash_set(*merges,
> APR_ARRAY_IDX(notify_b->skipped_paths, i, const char *),
> APR_HASH_KEY_STRING,
> apr_array_make(pool, 0, sizeof(*range)));
> +
> + if (notify_b->skipped_paths->nelts < notify_b->nbr_notifications)
> + /* ### Use RANGELIST as the merge info for all children of
> + ### this path which were not also explicitly
> + ### skipped? */
> + ;
> }
> }
>
> @@ -2171,7 +2186,7 @@
> void *diff_edit_baton;
> svn_client_ctx_t *ctx = merge_b->ctx;
> notification_receiver_baton_t notify_b =
> - { ctx->notify_func2, ctx->notify_baton2, NULL, pool };
> + { ctx->notify_func2, ctx->notify_baton2, 0, NULL, pool };
> const char *URL1, *URL2, *path1, *path2, *rel_path;
> svn_opt_revision_t *revision1, *revision2;
> const svn_wc_entry_t *entry;
> @@ -2315,8 +2330,9 @@
> ctx, pool));
> }
>
> - /* Clear the list of skipped paths in preparation for the next
> - revision range merge. */
> + /* Clear the modification counter and list of skipped paths in
> + preparation for the next revision range merge. */
> + notify_b.nbr_notifications = 0;
> if (notify_b.skipped_paths != NULL)
> notify_b.skipped_paths->nelts = 0;
> }
> @@ -2380,7 +2396,7 @@
> svn_wc_notify_state_t text_state = svn_wc_notify_state_unknown;
> svn_client_ctx_t *ctx = merge_b->ctx;
> notification_receiver_baton_t notify_b =
> - { ctx->notify_func2, ctx->notify_baton2, NULL, pool };
> + { ctx->notify_func2, ctx->notify_baton2, 0, NULL, pool };
> const char *URL1, *path1, *URL2, *path2, *rel_path;
> svn_opt_revision_t *revision1, *revision2;
> svn_error_t *err;
> @@ -2530,8 +2546,9 @@
> ctx, pool));
> }
>
> - /* Clear the list of skipped paths in preparation for the next
> - revision range merge. */
> + /* Clear the notification counter and list of skipped paths in
> + preparation for the next revision range merge. */
> + notify_b.nbr_notifications = 0;
> if (notify_b.skipped_paths != NULL)
> notify_b.skipped_paths->nelts = 0;
> }
>
> Modified: branches/merge-tracking/subversion/tests/cmdline/merge_tests.py
> URL: http://svn.collab.net/viewvc/svn/branches/merge-tracking/subversion/tests/cmdline/merge_tests.py?pathrev=21504&r1=21503&r2=21504
> ==============================================================================
> --- branches/merge-tracking/subversion/tests/cmdline/merge_tests.py (original)
> +++ branches/merge-tracking/subversion/tests/cmdline/merge_tests.py Thu Sep 14 16:56:47 2006
> @@ -601,7 +601,8 @@
>
> # Merge rev 3 into B2
>
> - # Local mods cause everything to be skipped without --force
> + # The local mods to the paths modified in r3 cause the paths to be
> + # skipped (without --force), resulting in no changes to the WC.
> expected_output = wc.State(B2_path, { })
> expected_disk = wc.State('', {
> 'E' : Item(),
> @@ -611,7 +612,7 @@
> 'lambda' : Item("This is the file 'lambda'.\n"),
> })
> expected_status = wc.State(B2_path, {
> - '' : Item(status=' M'),
> + '' : Item(status=' '),
> 'E' : Item(status=' M'),
> 'E/alpha' : Item(status=' '),
> 'E/beta' : Item(status=' '),
> @@ -637,6 +638,7 @@
> })
> expected_disk.remove('E/alpha', 'E/beta', 'lambda')
> expected_status.tweak('E', 'E/alpha', 'E/beta', 'lambda', status='D ')
> + expected_status.tweak('', status=' M')
> expected_skip.remove('lambda', 'E')
>
> ### Full-to-dry-run automatic comparison disabled because a) dry-run
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Sep 15 14:52:07 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.