subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1775580 - /subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c
Date Thu, 22 Dec 2016 07:26:45 GMT
Author: stsp
Date: Thu Dec 22 07:26:45 2016
New Revision: 1775580

URL: http://svn.apache.org/viewvc?rev=1775580&view=rev
Log:
Add a new conflict resolver test.

This test verifies behaviour when resolving an 'incoming delete' conflict
upon update by accepting the incoming deletion.

* subversion/tests/libsvn_client/conflicts-test.c
  (test_update_incoming_delete_accept, test_funcs): New test.

Modified:
    subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c

Modified: subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c?rev=1775580&r1=1775579&r2=1775580&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c Thu Dec 22 07:26:45 2016
@@ -1798,6 +1798,65 @@ test_update_incoming_delete_ignore(const
   return SVN_NO_ERROR;
 }
 
+/* Test 'incoming delete accept' option. */
+static svn_error_t *
+test_update_incoming_delete_accept(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+  svn_test__sandbox_t *b = apr_palloc(pool, sizeof(*b));
+  svn_client_ctx_t *ctx;
+  const char *deleted_path;
+  svn_client_conflict_t *conflict;
+  svn_node_kind_t node_kind;
+
+  SVN_ERR(svn_test__sandbox_create(b, "update_incoming_delete_accept",
+                                   opts, pool));
+
+  SVN_ERR(create_wc_with_incoming_delete_update_conflict(b, FALSE));
+
+  /* Resolve the tree conflict. */
+  SVN_ERR(svn_test__create_client_ctx(&ctx, b, b->pool));
+  deleted_path = svn_relpath_join(trunk_path, deleted_file_name, b->pool);
+  SVN_ERR(svn_client_conflict_get(&conflict, sbox_wc_path(b, deleted_path),
+                                  ctx, b->pool, b->pool));
+
+  {
+    svn_client_conflict_option_id_t expected_opts[] = {
+      svn_client_conflict_option_postpone,
+      svn_client_conflict_option_accept_current_wc_state,
+      svn_client_conflict_option_incoming_delete_ignore,
+      svn_client_conflict_option_incoming_delete_accept,
+      -1 /* end of list */
+    };
+    SVN_ERR(assert_tree_conflict_options(conflict, ctx, expected_opts,
+                                         b->pool));
+  }
+
+  SVN_ERR(svn_client_conflict_tree_get_details(conflict, ctx, b->pool));
+
+  {
+    svn_client_conflict_option_id_t expected_opts[] = {
+      svn_client_conflict_option_postpone,
+      svn_client_conflict_option_accept_current_wc_state,
+      svn_client_conflict_option_incoming_delete_ignore,
+      svn_client_conflict_option_incoming_delete_accept,
+      -1 /* end of list */
+    };
+    SVN_ERR(assert_tree_conflict_options(conflict, ctx, expected_opts,
+                                         b->pool));
+  }
+
+  SVN_ERR(svn_client_conflict_tree_resolve_by_id(
+            conflict, svn_client_conflict_option_incoming_delete_accept,
+            ctx, b->pool));
+
+  /* Ensure that the deleted file is gone. */
+  SVN_ERR(svn_io_check_path(sbox_wc_path(b, deleted_path), &node_kind,
+                            b->pool));
+  SVN_TEST_ASSERT(node_kind == svn_node_none);
+
+  return SVN_NO_ERROR;
+}
+
 /* Test 'incoming move file text merge' option for update. */
 static svn_error_t *
 test_update_incoming_move_file_text_merge(const svn_test_opts_t *opts,
@@ -4179,6 +4238,8 @@ static struct svn_test_descriptor_t test
                        "merge incoming move file text merge"),
     SVN_TEST_OPTS_PASS(test_update_incoming_delete_ignore,
                        "update incoming delete ignore"),
+    SVN_TEST_OPTS_PASS(test_update_incoming_delete_accept,
+                       "update incoming delete accept"),
     SVN_TEST_OPTS_PASS(test_update_incoming_move_file_text_merge,
                        "update incoming move file text merge"),
     SVN_TEST_OPTS_PASS(test_switch_incoming_move_file_text_merge,



Mime
View raw message