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.
> We could thus consider a locally deleted node to satisfy the expected
> state of "node not present".
... 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.
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=2399040
Received on 2009-09-23 21:26:08 CEST