You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2018/09/24 14:43:12 UTC

svn commit: r1841864 - in /subversion/branches/1.11.x: ./ STATUS subversion/libsvn_client/conflicts.c subversion/tests/libsvn_client/conflicts-test.c

Author: julianfoad
Date: Mon Sep 24 14:43:12 2018
New Revision: 1841864

URL: http://svn.apache.org/viewvc?rev=1841864&view=rev
Log:
Merge the r1841753 group from trunk:

 * r1841753, r1841754
   Fix an assertion failure in the conflict resolver.
   Justification:
     Assertions should not get triggered by particular tree conflicts.
   Votes:
     +1: stsp, jcorvel, julianfoad

Modified:
    subversion/branches/1.11.x/   (props changed)
    subversion/branches/1.11.x/STATUS
    subversion/branches/1.11.x/subversion/libsvn_client/conflicts.c
    subversion/branches/1.11.x/subversion/tests/libsvn_client/conflicts-test.c

Propchange: subversion/branches/1.11.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 24 14:43:12 2018
@@ -100,4 +100,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1840990-1840991,1840995,1840997,1841059,1841079,1841091,1841098,1841136,1841180,1841272,1841481,1841524-1841525,1841567,1841600-1841602,1841606,1841731,1841736,1841743,1841822
+/subversion/trunk:1840990-1840991,1840995,1840997,1841059,1841079,1841091,1841098,1841136,1841180,1841272,1841481,1841524-1841525,1841567,1841600-1841602,1841606,1841731,1841736,1841743,1841753-1841754,1841822

Modified: subversion/branches/1.11.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.11.x/STATUS?rev=1841864&r1=1841863&r2=1841864&view=diff
==============================================================================
--- subversion/branches/1.11.x/STATUS (original)
+++ subversion/branches/1.11.x/STATUS Mon Sep 24 14:43:12 2018
@@ -36,10 +36,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r1841753, r1841754
-   Fix an assertion failure in the conflict resolver.
-   Justification:
-     Assertions should not get triggered by particular tree conflicts.
-   Votes:
-     +1: stsp, jcorvel, julianfoad

Modified: subversion/branches/1.11.x/subversion/libsvn_client/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.11.x/subversion/libsvn_client/conflicts.c?rev=1841864&r1=1841863&r2=1841864&view=diff
==============================================================================
--- subversion/branches/1.11.x/subversion/libsvn_client/conflicts.c (original)
+++ subversion/branches/1.11.x/subversion/libsvn_client/conflicts.c Mon Sep 24 14:43:12 2018
@@ -2836,6 +2836,11 @@ conflict_tree_get_details_local_missing(
                                       scratch_pool,
                                       scratch_pool));
 
+  /* If the parent is not part of the repository-side tree checked out
+   * into this working copy, then bail. We do not support this case yet. */
+  if (parent_peg_rev == SVN_INVALID_REVNUM)
+    return SVN_NO_ERROR;
+
   /* Pick the younger incoming node as our 'related node' which helps
    * pin-pointing the deleted conflict victim in history. */
   related_repos_relpath = 

Modified: subversion/branches/1.11.x/subversion/tests/libsvn_client/conflicts-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.11.x/subversion/tests/libsvn_client/conflicts-test.c?rev=1841864&r1=1841863&r2=1841864&view=diff
==============================================================================
--- subversion/branches/1.11.x/subversion/tests/libsvn_client/conflicts-test.c (original)
+++ subversion/branches/1.11.x/subversion/tests/libsvn_client/conflicts-test.c Mon Sep 24 14:43:12 2018
@@ -5879,6 +5879,137 @@ test_local_missing_abiguous_moves(const
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_file_vs_dir_move_merge_assertion_failure(const svn_test_opts_t *opts,
+                                              apr_pool_t *pool)
+{
+  svn_test__sandbox_t *b = apr_palloc(pool, sizeof(*b));
+  svn_opt_revision_t opt_rev, peg_rev;
+  svn_client_ctx_t *ctx;
+  svn_client_conflict_t *conflict;
+  apr_array_header_t *options;
+  svn_client_conflict_option_t *option;
+  const char *wc_path;
+
+  SVN_ERR(svn_test__sandbox_create(b,
+                                   "file_vs_dir_move_merge_assertion_failure",
+                                   opts, pool));
+
+  SVN_ERR(sbox_add_and_commit_greek_tree(b)); /* r1 */
+
+  /* Create a copy of node "A" (the "trunk") to "A1" (the "branch"). */
+  SVN_ERR(sbox_wc_copy(b, "A", "A1"));
+  SVN_ERR(sbox_wc_commit(b, "")); /* r2 */
+
+  SVN_ERR(sbox_wc_update(b, "", SVN_INVALID_REVNUM));
+  /* Move and modify file on the "branch" */
+  SVN_ERR(sbox_wc_move(b, "A1/B/lambda", "A1/B/lambda-moved"));
+  SVN_ERR(sbox_file_write(b, "A1/B/lambda-moved",
+                          "Modified content." APR_EOL_STR));
+  SVN_ERR(sbox_wc_commit(b, "")); /* r3 */
+
+  /* Move a directory and modify a file inside of it on the "trunk". */
+  SVN_ERR(sbox_wc_move(b, "A/B", "A/B-moved"));
+  SVN_ERR(sbox_file_write(b, "A/B-moved/lambda",
+                          "Modified content." APR_EOL_STR));
+  SVN_ERR(sbox_wc_commit(b, "")); /* r4 */
+  SVN_ERR(sbox_wc_update(b, "", SVN_INVALID_REVNUM));
+
+  /* Create a fresh working copy for "A1" ("branch"). */
+  wc_path = svn_test_data_path("file_vs_dir_move_merge_assertion_failure2",
+                               pool);
+  SVN_ERR(svn_io_remove_dir2(wc_path, TRUE, NULL, NULL, pool));
+  SVN_ERR(svn_io_make_dir_recursively(wc_path, pool));
+  svn_test_add_dir_cleanup(wc_path);
+
+  /* Merge "A" ("trunk") into a fresh working copy of "A1" ("branch"). */
+  opt_rev.kind = svn_opt_revision_head;
+  opt_rev.value.number = SVN_INVALID_REVNUM;
+  peg_rev.kind = svn_opt_revision_unspecified;
+  SVN_ERR(svn_test__create_client_ctx(&ctx, b, pool));
+  SVN_ERR(svn_client_checkout3(NULL, svn_path_url_add_component2(b->repos_url,
+                                                                 "A1", pool),
+                               wc_path, &peg_rev, &opt_rev, svn_depth_infinity,
+                               TRUE, FALSE, ctx, pool));
+
+  SVN_ERR(svn_client_merge_peg5(svn_path_url_add_component2(b->repos_url, "A",
+                                                            pool),
+                                NULL, &opt_rev, wc_path, svn_depth_infinity,
+                                FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
+                                NULL, ctx, pool));
+
+  SVN_ERR(svn_client_conflict_get(&conflict,
+                                  svn_dirent_join(wc_path, "B", b->pool),
+                                  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_move_dir_merge,
+      -1 /* end of list */
+    };
+    SVN_ERR(assert_tree_conflict_options(conflict, ctx, expected_opts,
+                                         b->pool));
+  }
+
+  SVN_ERR(svn_client_conflict_tree_get_resolution_options(&options, conflict,
+                                                          ctx, b->pool,
+                                                          b->pool));
+  option = svn_client_conflict_option_find_by_id(
+             options, svn_client_conflict_option_incoming_move_dir_merge);
+  SVN_TEST_ASSERT(option != NULL);
+
+  /* Resolve this conflict. Another one will be raised. */
+  SVN_ERR(svn_client_conflict_tree_resolve_by_id(
+            conflict,
+            svn_client_conflict_option_incoming_move_dir_merge, ctx,
+            b->pool));
+
+  SVN_ERR(svn_client_conflict_get(&conflict,
+                                  svn_dirent_join_many(b->pool,
+                                   wc_path, "B-moved", "lambda", NULL),
+                                  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,
+      -1 /* end of list */
+    };
+    SVN_ERR(assert_tree_conflict_options(conflict, ctx, expected_opts,
+                                         b->pool));
+  }
+
+  /* This used to trigger an assertion failure:
+   * svn_tests: E235000: In file 'subversion/libsvn_client/conflicts.c' \
+   *    line 2242: assertion failed (start_rev > end_rev) */
+  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,
+      -1 /* end of list */
+    };
+    SVN_ERR(assert_tree_conflict_options(conflict, ctx, expected_opts,
+                                         b->pool));
+  }
+
+  /* Subversion is not yet smart enough to resolve this tree conflict. */
+
+  return SVN_NO_ERROR;
+}
+
 /* ========================================================================== */
 
 
@@ -5979,6 +6110,8 @@ static struct svn_test_descriptor_t test
                        "cherry-pick edit from moved directory"),
     SVN_TEST_OPTS_PASS(test_local_missing_abiguous_moves,
                        "local missing conflict with ambiguous moves"),
+    SVN_TEST_OPTS_PASS(test_file_vs_dir_move_merge_assertion_failure,
+                       "file v dir move merge assertion failure"),
     SVN_TEST_NULL
   };