You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2016/10/11 15:51:27 UTC
svn commit: r1764275 -
/subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
Author: stsp
Date: Tue Oct 11 15:51:26 2016
New Revision: 1764275
URL: http://svn.apache.org/viewvc?rev=1764275&view=rev
Log:
On the 'resolve-incoming-add' branch: Make an XFAIL test PASS.
* subversion/tests/libsvn_client/conflicts-test.c
(test_merge_incoming_added_dir_merge3): Fix this test to account for the
nested 'add vs add' conflict on the file which was added on both the
trunk and the branch. And stop testing for subtree-mergeinfo, since
it's not clear yet whether and how this should be handled by the resolver.
(test_func): Mark the above test as PASS.
Modified:
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
Modified: subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c?rev=1764275&r1=1764274&r2=1764275&view=diff
==============================================================================
--- subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c (original)
+++ subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c Tue Oct 11 15:51:26 2016
@@ -1375,7 +1375,50 @@ test_merge_incoming_added_dir_merge3(con
props_conflicted->nelts == 0 &&
!tree_conflicted);
- /* We should have a text conflict in the file. */
+ /* There should now be an 'add vs add' conflict on the new file. */
+ new_file_path = svn_relpath_join(branch_path,
+ svn_relpath_join(new_dir_name,
+ new_file_name, b->pool),
+ b->pool);
+ SVN_ERR(svn_client_conflict_get(&conflict, sbox_wc_path(b, new_file_path),
+ ctx, b->pool, b->pool));
+ SVN_ERR(svn_client_conflict_get_conflicted(&text_conflicted,
+ &props_conflicted,
+ &tree_conflicted,
+ conflict, b->pool, b->pool));
+ SVN_TEST_ASSERT(!text_conflicted &&
+ props_conflicted->nelts == 0 &&
+ tree_conflicted);
+
+ /* Resolve the tree conflict. */
+ SVN_ERR(svn_test__create_client_ctx(&ctx, b, b->pool));
+ SVN_ERR(svn_client_conflict_get(&conflict, sbox_wc_path(b, new_file_path),
+ ctx, b->pool, b->pool));
+ SVN_ERR(svn_client_conflict_tree_get_details(conflict, ctx, b->pool));
+ SVN_ERR(svn_client_conflict_tree_resolve_by_id(
+ conflict,
+ svn_client_conflict_option_incoming_added_file_text_merge, ctx,
+ b->pool));
+
+ /* Ensure that the file has the expected status. */
+ SVN_ERR(svn_client_status6(NULL, ctx, sbox_wc_path(b, new_file_path),
+ &opt_rev, svn_depth_unknown, TRUE, TRUE,
+ TRUE, TRUE, FALSE, TRUE, NULL,
+ status_func, &sb, b->pool));
+ status = sb.status;
+ SVN_TEST_ASSERT(status->kind == svn_node_file);
+ SVN_TEST_ASSERT(status->versioned);
+ SVN_TEST_ASSERT(status->conflicted);
+ SVN_TEST_ASSERT(status->node_status == svn_wc_status_conflicted);
+ SVN_TEST_ASSERT(status->text_status == svn_wc_status_conflicted);
+ SVN_TEST_ASSERT(status->prop_status == svn_wc_status_modified);
+ SVN_TEST_ASSERT(!status->copied);
+ SVN_TEST_ASSERT(!status->switched);
+ SVN_TEST_ASSERT(!status->file_external);
+ SVN_TEST_ASSERT(status->moved_from_abspath == NULL);
+ SVN_TEST_ASSERT(status->moved_to_abspath == NULL);
+
+ /* We should now have a text conflict in the file. */
new_file_path = svn_relpath_join(branch_path,
svn_relpath_join(new_dir_name,
new_file_name, b->pool),
@@ -1391,34 +1434,12 @@ test_merge_incoming_added_dir_merge3(con
!tree_conflicted);
/* Verify the file's merged property value. */
- /* ### Shouldn't there be a property conflict? The branch wins. */
+ /* ### Shouldn't there be a property conflict? The trunk wins. */
SVN_ERR(svn_wc_prop_get2(&propval, ctx->wc_ctx,
sbox_wc_path(b, new_file_path),
"prop", b->pool, b->pool));
- SVN_TEST_STRING_ASSERT(propval->data, propval_branch);
+ SVN_TEST_STRING_ASSERT(propval->data, propval_trunk);
- /* XFAIL: Currently, no subtree mergeinfo is created.
- *
- * Verify the directory's subtree mergeinfo. It should mention both
- * location segments of ^/A/newdir's history, shouldn't it? Like this:
- *
- * /A/newdir:2-6
- * /newdir.orig:4
- *
- * ### /newdir.orig was created in r3 and moved to /A/newdir in r5.
- * ### Should the second line say "/newdir.orig:3-4" instead? */
- SVN_ERR(svn_wc_prop_get2(&propval, ctx->wc_ctx,
- sbox_wc_path(b, new_dir_path),
- "svn:mergeinfo", b->pool, b->pool));
- SVN_TEST_ASSERT(propval != NULL);
- SVN_TEST_STRING_ASSERT(propval->data,
- apr_psprintf(b->pool, "/%s:2-6\n/%s:4",
- svn_relpath_join(trunk_path,
- new_dir_name,
- b->pool),
- apr_pstrcat(b->pool,
- new_dir_name, ".orig",
- SVN_VA_NULL)));
return SVN_NO_ERROR;
}
@@ -3607,7 +3628,7 @@ static struct svn_test_descriptor_t test
"merge incoming add dir merge"),
SVN_TEST_OPTS_PASS(test_merge_incoming_added_dir_merge2,
"merge incoming add dir merge with file change"),
- SVN_TEST_OPTS_XFAIL(test_merge_incoming_added_dir_merge3,
+ SVN_TEST_OPTS_PASS(test_merge_incoming_added_dir_merge3,
"merge incoming add dir merge with move history"),
SVN_TEST_OPTS_PASS(test_merge_incoming_added_dir_replace,
"merge incoming add dir replace"),