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:28:38 UTC

svn commit: r1764269 - /subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c

Author: stsp
Date: Tue Oct 11 15:28:38 2016
New Revision: 1764269

URL: http://svn.apache.org/viewvc?rev=1764269&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_merge): 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.
  (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=1764269&r1=1764268&r2=1764269&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:28:38 2016
@@ -1086,9 +1086,6 @@ test_merge_incoming_added_dir_ignore(con
   return SVN_NO_ERROR;
 }
 
-/* This test currently fails to meet expectations. Our merge code doesn't
- * support a merge of files which were added in the same revision as their
- * parent directory and were not modified since. */
 static svn_error_t *
 test_merge_incoming_added_dir_merge(const svn_test_opts_t *opts,
                                     apr_pool_t *pool)
@@ -1155,8 +1152,8 @@ test_merge_incoming_added_dir_merge(cons
                   props_conflicted->nelts == 0 &&
                   !tree_conflicted);
 
-  /* XFAIL: Currently, no text conflict is raised since the file is not merged.
-   * 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),
@@ -1167,6 +1164,45 @@ test_merge_incoming_added_dir_merge(cons
                                              &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);
+
+  /* The file should now have a text conflict. */
+  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);
@@ -3568,7 +3604,7 @@ static struct svn_test_descriptor_t test
                        "switch incoming add file ignore"),
     SVN_TEST_OPTS_PASS(test_merge_incoming_added_dir_ignore,
                        "merge incoming add dir ignore"),
-    SVN_TEST_OPTS_XFAIL(test_merge_incoming_added_dir_merge,
+    SVN_TEST_OPTS_PASS(test_merge_incoming_added_dir_merge,
                        "merge incoming add dir merge"),
     SVN_TEST_OPTS_PASS(test_merge_incoming_added_dir_merge2,
                        "merge incoming add dir merge with file change"),