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

Re: r38000 group

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 23 Sep 2009 23:59:07 +0100

On Wed, 2009-09-23 at 20:25 +0100, Stefan Sperling wrote:
> On Wed, Sep 23, 2009 at 07:23:52PM +0100, Stefan Sperling wrote:
> > However, the local schedule *does* matter if the item is locally deleted.
> > After all, a user could want the merge to add another file on
> > top of a locally deleted file, causing it to be scheduled replace.

That's true, but the code path we are looking at is inside "case
svn_node_file" in a switch(node kind on disk). Therefore we know that
the file is NOT properly locally deleted. In "case svn_node_file", if it
is schedule-delete then there is an obstruction on disk so the WC state
is inconsistent and the call to obstructed_or_missing() earlier in the
function should have caused it to be skipped.

Therefore there is no need to look for schedule-delete in this case.

> > We could thus consider a locally deleted node to satisfy the expected
> > state of "node not present".

"case svn_node_none" deals with this (if it is schedule-delete and gone
from disk).

> ... except if the file is already tree-conflicted, in which case we might
> have an incoming replace we need to check for and flag accordingly.

"case svn_node_none" needs to deal with this case too. (Again, it
doesn't matter whether it is locally scheduled for delete or has been
deleted earlier and is now a non-existent node.)

Thanks for working on this again.
- Julian

> New diff below.
>
> Does this idea sound good to you guys? (I have probably missed
> something, as usual...)
>
> Stefan
>
>
> Index: subversion/libsvn_client/merge.c
> ===================================================================
> --- subversion/libsvn_client/merge.c (revision 39543)
> +++ subversion/libsvn_client/merge.c (working copy)
> @@ -1667,8 +1667,8 @@ merge_file_added(svn_wc_adm_access_t *adm_access,
> else
> {
> const svn_wc_entry_t *entry;
> - svn_wc_conflict_reason_t reason;
> const char *abs_mine;
> + svn_wc_conflict_description2_t *existing_conflict;
>
> /* Figure out what state the file which is already present
> * is in, and set the conflict reason accordingly. */
> @@ -1677,33 +1677,27 @@ merge_file_added(svn_wc_adm_access_t *adm_access,
> merge_b->ctx->wc_ctx,
> abs_mine, kind, FALSE,
> FALSE, subpool, subpool));
> - switch (entry->schedule)
> +
> + SVN_ERR(svn_wc__get_tree_conflict(&existing_conflict,
> + merge_b->ctx->wc_ctx,
> + mine_abspath, merge_b->pool,
> + merge_b->pool));
> +
> + /* In the special case of a schedule-delete file which
> + * is not already tree-conflicted, the file is about to
> + * be replaced by the merge, and there is no tree conflict. */
> + if (entry->schedule != svn_wc_schedule_delete ||
> + existing_conflict)
> {
> - case svn_wc_schedule_normal:
> - reason = svn_wc_conflict_reason_obstructed;
> - break;
> - case svn_wc_schedule_add:
> - reason = svn_wc_conflict_reason_added;
> - break;
> - case svn_wc_schedule_delete:
> - reason = svn_wc_conflict_reason_deleted;
> - break;
> - case svn_wc_schedule_replace:
> - reason = svn_wc_conflict_reason_replaced;
> - break;
> + /* Something was added locally in the merge target,
> + * or in the merge target's history. */
> + SVN_ERR(tree_conflict_on_add(merge_b, mine_abspath,
> + svn_node_file,
> + svn_wc_conflict_action_add,
> + svn_wc_conflict_reason_added));
> + if (tree_conflicted)
> + *tree_conflicted = TRUE;
> }
> -
> - /* The file add the merge wants to carry out is obstructed by
> - * a versioned file, so the file the merge wants to add is a
> - * tree conflict victim. See notes about obstructions in
> - * notes/tree-conflicts/detection.txt.
> - */
> - SVN_ERR(tree_conflict_on_add(merge_b, mine_abspath,
> - svn_node_file,
> - svn_wc_conflict_action_add,
> - reason));
> - if (tree_conflicted)
> - *tree_conflicted = TRUE;
> }
> break;
> }

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2399098
Received on 2009-09-24 00:58:41 CEST

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.