Author: stsp
Date: Tue Oct 11 16:01:59 2016
New Revision: 1764279

URL: http://svn.apache.org/viewvc?rev=1764279&view=rev
Log:
On the 'resolve-incoming-add' branch: Make a FAILing test PASS again.

* subversion/tests/libsvn_client/conflicts-test.c
  (test_merge_incoming_added_dir_merge2): Account for the nested
   'add vs add' tree conflict on the new file, and for the change
   in property conflict behaviour (to be investigated later).

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=1764279&r1=1764278&r2=1764279&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 16:01:59 2016
@@ -1283,7 +1283,50 @@ test_merge_incoming_added_dir_merge2(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);
+
+  /* The file should now have a text conflict. */
   new_file_path = svn_relpath_join(branch_path,
                                    svn_relpath_join(new_dir_name,
                                                     new_file_name, b->pool),
@@ -1299,11 +1342,11 @@ test_merge_incoming_added_dir_merge2(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);
 
   return SVN_NO_ERROR;
 }


Reply via email to