subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1658362 [33/34] - in /subversion/branches/remove-log-addressing: ./ build/ build/generator/ build/generator/templates/ notes/ subversion/bindings/cxxhl/include/svncxxhl/ subversion/bindings/javahl/native/ subversion/bindings/javahl/native/...
Date Mon, 09 Feb 2015 11:23:43 GMT
Modified: subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/op-depth-test.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/op-depth-test.c Mon Feb  9 11:23:39 2015
@@ -144,23 +144,27 @@ props_hash_to_text(apr_hash_t *props, ap
   return str->len ? str->data : NULL;
 }
 
-/* Return a human-readable string representing ROW. */
+/* Return a human-readable string representing ROW. With a tiny bit of editting
+   this can be used to create expected results */
 static const char *
 print_row(const nodes_row_t *row,
           apr_pool_t *result_pool)
 {
+  const char *relpath_str, *presence_str;
   const char *file_external_str, *moved_here_str, *moved_to_str, *props;
 
   if (row == NULL)
     return "(null)";
 
+  relpath_str = apr_psprintf(result_pool, "\"%s\",", row->local_relpath);
+  presence_str = apr_psprintf(result_pool, "\"%s\",", row->presence);
   if (row->moved_to)
-    moved_to_str = apr_psprintf(result_pool, ", moved-to %s", row->moved_to);
+    moved_to_str = apr_psprintf(result_pool, ", \"%s\"", row->moved_to);
   else
     moved_to_str = "";
 
   if (row->moved_here)
-    moved_here_str = ", moved-here";
+    moved_here_str = ", MOVED_HERE";
   else
     moved_here_str = "";
 
@@ -175,19 +179,17 @@ print_row(const nodes_row_t *row,
     props = "";
 
   if (row->repo_revnum == SVN_INVALID_REVNUM)
-    return apr_psprintf(result_pool, "%d, \"%s\", \"%s\"%s%s%s%s",
-                        row->op_depth, row->local_relpath, row->presence,
+    return apr_psprintf(result_pool, "%d, %-20s%-15s NO_COPY_FROM%s%s%s%s",
+                        row->op_depth, relpath_str, presence_str,
                         moved_here_str, moved_to_str,
                         file_external_str, props);
   else
-    return apr_psprintf(result_pool, "%d, \"%s\", \"%s\", %s ^/%s@%d%s%s%s%s",
-                        row->op_depth, row->local_relpath, row->presence,
-                        row->op_depth == 0 ? "base" : "copyfrom",
-                        row->repo_relpath, (int)row->repo_revnum,
+    return apr_psprintf(result_pool, "%d, %-20s%-15s %d, \"%s\"%s%s%s%s",
+                        row->op_depth, relpath_str, presence_str,
+                        (int)row->repo_revnum, row->repo_relpath,
                         moved_here_str, moved_to_str,
                         file_external_str, props);
 }
-
 /* A baton to pass through svn_hash_diff() to compare_nodes_rows(). */
 typedef struct comparison_baton_t {
     apr_hash_t *expected_hash;  /* Maps "OP_DEPTH PATH" to nodes_row_t. */
@@ -514,7 +516,7 @@ wc_wc_copies(svn_test__sandbox_t *b)
 
   /* Create the various kinds of source node which will be copied */
 
-  sbox_file_write(b, source_added_file, "New file");
+  SVN_ERR(sbox_file_write(b, source_added_file, "New file"));
   SVN_ERR(sbox_wc_add(b, source_added_file));
   SVN_ERR(sbox_wc_mkdir(b, source_added_dir));
   SVN_ERR(sbox_wc_mkdir(b, source_added_dir2));
@@ -718,7 +720,7 @@ repo_wc_copies(svn_test__sandbox_t *b)
       }
 
     /* Perform each copy. */
-    SVN_ERR(svn_client_create_context(&ctx, b->pool));
+    SVN_ERR(svn_test__create_client_ctx(&ctx, b, b->pool));
     for (subtest = subtests; subtest->from_path; subtest++)
       {
         svn_opt_revision_t rev = { svn_opt_revision_number, { 1 } };
@@ -787,7 +789,7 @@ test_deletes(const svn_test_opts_t *opts
   SVN_ERR(svn_test__sandbox_create(&b, "deletes", opts, pool));
   SVN_ERR(sbox_add_and_commit_greek_tree(&b));
 
-  sbox_file_write(&b,     "A/B/E/new-file", "New file");
+  SVN_ERR(sbox_file_write(&b,     "A/B/E/new-file", "New file"));
   SVN_ERR(sbox_wc_add(&b, "A/B/E/new-file"));
   {
     nodes_row_t rows[] = {
@@ -849,7 +851,7 @@ test_adds(const svn_test_opts_t *opts, a
   SVN_ERR(sbox_add_and_commit_greek_tree(&b));
 
   /* add file */
-  sbox_file_write(&b, "new-file", "New file");
+  SVN_ERR(sbox_file_write(&b, "new-file", "New file"));
   SVN_ERR(sbox_wc_add(&b, "new-file"));
   {
     nodes_row_t rows[] = {
@@ -871,7 +873,7 @@ test_adds(const svn_test_opts_t *opts, a
 
   /* replace file */
   SVN_ERR(sbox_wc_delete(&b, "iota"));
-  sbox_file_write(&b, "iota", "New iota file");
+  SVN_ERR(sbox_file_write(&b, "iota", "New iota file"));
   SVN_ERR(sbox_wc_add(&b, "iota"));
   {
     nodes_row_t rows[] = {
@@ -911,7 +913,7 @@ test_adds_change_kind(const svn_test_opt
 
   /* replace dir with file */
   SVN_ERR(sbox_wc_delete(&b, "A/B/E"));
-  sbox_file_write(&b, "A/B/E", "New E file");
+  SVN_ERR(sbox_file_write(&b, "A/B/E", "New E file"));
   SVN_ERR(sbox_wc_add(&b, "A/B/E"));
   {
     nodes_row_t rows[] = {
@@ -3112,7 +3114,7 @@ test_shadowed_update(const svn_test_opts
   SVN_ERR(svn_test__sandbox_create(&b, "shadowed_update", opts, pool));
 
   /* Set up the base state as revision 1. */
-  sbox_file_write(&b, "iota", "This is iota");
+  SVN_ERR(sbox_file_write(&b, "iota", "This is iota"));
   SVN_ERR(sbox_wc_add(&b, "iota"));
   SVN_ERR(sbox_wc_commit(&b, ""));
 
@@ -3127,7 +3129,7 @@ test_shadowed_update(const svn_test_opts
   SVN_ERR(sbox_wc_commit(&b, ""));
 
   /* And change something in r3 */
-  sbox_file_write(&b, "iota", "This is a new iota");
+  SVN_ERR(sbox_file_write(&b, "iota", "This is a new iota"));
   SVN_ERR(sbox_wc_commit(&b, ""));
 
   /* And delete C & M */
@@ -3448,12 +3450,12 @@ commit_file_external(const svn_test_opts
   svn_test__sandbox_t b;
 
   SVN_ERR(svn_test__sandbox_create(&b, "commit_file_external", opts, pool));
-  sbox_file_write(&b, "f", "this is f\n");
+  SVN_ERR(sbox_file_write(&b, "f", "this is f\n"));
   SVN_ERR(sbox_wc_add(&b, "f"));
   SVN_ERR(sbox_wc_propset(&b, "svn:externals", "^/f g", ""));
   SVN_ERR(sbox_wc_commit(&b, ""));
   SVN_ERR(sbox_wc_update(&b, "", 1));
-  sbox_file_write(&b, "g", "this is f\nmodified via g\n");
+  SVN_ERR(sbox_file_write(&b, "g", "this is f\nmodified via g\n"));
   SVN_ERR(sbox_wc_commit(&b, ""));
   SVN_ERR(sbox_wc_update(&b, "", 2));
 
@@ -3476,7 +3478,7 @@ revert_file_externals(const svn_test_opt
   svn_test__sandbox_t b;
 
   SVN_ERR(svn_test__sandbox_create(&b, "revert_file_externals", opts, pool));
-  sbox_file_write(&b, "f", "this is f\n");
+  SVN_ERR(sbox_file_write(&b, "f", "this is f\n"));
   SVN_ERR(sbox_wc_add(&b, "f"));
   SVN_ERR(sbox_wc_propset(&b, "svn:externals", "^/f g", ""));
   SVN_ERR(sbox_wc_commit(&b, ""));
@@ -3540,7 +3542,7 @@ copy_file_externals(const svn_test_opts_
   svn_test__sandbox_t b;
 
   SVN_ERR(svn_test__sandbox_create(&b, "copy_file_externals", opts, pool));
-  sbox_file_write(&b, "f", "this is f\n");
+  SVN_ERR(sbox_file_write(&b, "f", "this is f\n"));
   SVN_ERR(sbox_wc_add(&b, "f"));
   SVN_ERR(sbox_wc_mkdir(&b, "A"));
   SVN_ERR(sbox_wc_propset(&b, "svn:externals", "^/f g", "A"));
@@ -4572,27 +4574,27 @@ move_update(const svn_test_opts_t *opts,
   /* r1: Create files 'f', 'h' */
   SVN_ERR(sbox_wc_mkdir(&b, "A"));
   SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
-  sbox_file_write(&b, "A/B/f", "r1 content\n");
-  sbox_file_write(&b, "A/B/h", "r1 content\n");
+  SVN_ERR(sbox_file_write(&b, "A/B/f", "r1 content\n"));
+  SVN_ERR(sbox_file_write(&b, "A/B/h", "r1 content\n"));
   SVN_ERR(sbox_wc_add(&b, "A/B/f"));
   SVN_ERR(sbox_wc_add(&b, "A/B/h"));
   SVN_ERR(sbox_wc_commit(&b, ""));
 
   /* r2: Modify 'f' */
-  sbox_file_write(&b, "A/B/f", "r1 content\nr2 content\n");
+  SVN_ERR(sbox_file_write(&b, "A/B/f", "r1 content\nr2 content\n"));
   SVN_ERR(sbox_wc_commit(&b, ""));
 
   /* r3: Delete 'h', add 'g' */
-  sbox_file_write(&b, "A/B/g", "r3 content\n");
+  SVN_ERR(sbox_file_write(&b, "A/B/g", "r3 content\n"));
   SVN_ERR(sbox_wc_add(&b, "A/B/g"));
   SVN_ERR(sbox_wc_delete(&b, "A/B/h"));
   SVN_ERR(sbox_wc_commit(&b, ""));
 
   /* r4: Add a new subtree 'X' */
   SVN_ERR(sbox_wc_mkdir(&b, "X"));
-  sbox_file_write(&b, "X/f", "r4 content\n");
-  sbox_file_write(&b, "X/g", "r4 content\n");
-  sbox_file_write(&b, "X/h", "r4 content\n");
+  SVN_ERR(sbox_file_write(&b, "X/f", "r4 content\n"));
+  SVN_ERR(sbox_file_write(&b, "X/g", "r4 content\n"));
+  SVN_ERR(sbox_file_write(&b, "X/h", "r4 content\n"));
   SVN_ERR(sbox_wc_add(&b, "X/f"));
   SVN_ERR(sbox_wc_add(&b, "X/g"));
   SVN_ERR(sbox_wc_add(&b, "X/h"));
@@ -5173,8 +5175,10 @@ mixed_rev_move(const svn_test_opts_t *op
   SVN_ERR(sbox_wc_mkdir(&b, "A"));
   SVN_ERR(sbox_wc_commit(&b, ""));
   SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/D"));
   SVN_ERR(sbox_wc_commit(&b, ""));
   SVN_ERR(sbox_wc_mkdir(&b, "A/B/C"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/D/E"));
   SVN_ERR(sbox_wc_commit(&b, ""));
 
   {
@@ -5183,6 +5187,8 @@ mixed_rev_move(const svn_test_opts_t *op
       {0, "A",     "normal", 1, "A"},
       {0, "A/B",   "normal", 2, "A/B"},
       {0, "A/B/C", "normal", 3, "A/B/C"},
+      {0, "A/D",   "normal", 2, "A/D"},
+      {0, "A/D/E", "normal", 3, "A/D/E"},
       {0}
     };
     SVN_ERR(check_db_rows(&b, "", nodes));
@@ -5202,20 +5208,30 @@ mixed_rev_move(const svn_test_opts_t *op
       {0, "A",     "normal",       1, "A"},
       {0, "A/B",   "normal",       2, "A/B"},
       {0, "A/B/C", "normal",       3, "A/B/C"},
+      {0, "A/D",   "normal",       2, "A/D"},
+      {0, "A/D/E", "normal",       3, "A/D/E"},
       {1, "A",     "base-deleted", NO_COPY_FROM, "X"},
       {1, "A/B",   "base-deleted", NO_COPY_FROM},
       {1, "A/B/C", "base-deleted", NO_COPY_FROM},
+      {1, "A/D",   "base-deleted", NO_COPY_FROM},
+      {1, "A/D/E", "base-deleted", NO_COPY_FROM},
       {1, "X",     "normal",       1, "A", MOVED_HERE},
       {1, "X/B",   "not-present",  2, "A/B"},
+      {1, "X/D",   "not-present",  2, "A/D"},
       {2, "X/B",   "normal",       2, "A/B"},
       {2, "X/B/C", "not-present",  3, "A/B/C"},
+      {2, "X/D",   "normal",       2, "A/D"},
+      {2, "X/D/E", "not-present",  3, "A/D/E"},
       {3, "X/B/C", "normal",       3, "A/B/C"},
+      {3, "X/D/E", "normal",       3, "A/D/E"},
+
       {0}
     };
     SVN_ERR(check_db_rows(&b, "", nodes));
   }
 
   /* ### These values PASS but I'm not sure they are correct. */
+  /* A/B/C doesn't exist as X/B/C at op depth 1, but is reported */
   SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
                                      sbox_wc_path(&b, "A/B/C"), pool, pool));
   SVN_ERR(check_moved_to(moved_tos, 0, 1, "X/B/C"));
@@ -5241,32 +5257,109 @@ mixed_rev_move(const svn_test_opts_t *op
       {0, "A",     "normal",       1, "A"},
       {0, "A/B",   "normal",       2, "A/B"},
       {0, "A/B/C", "normal",       3, "A/B/C"},
+      {0, "A/D",   "normal",       2, "A/D"},
+      {0, "A/D/E", "normal",       3, "A/D/E"},
       {1, "A",     "base-deleted", NO_COPY_FROM, "X"},
       {1, "A/B",   "base-deleted", NO_COPY_FROM},
       {1, "A/B/C", "base-deleted", NO_COPY_FROM},
+      {1, "A/D",   "base-deleted", NO_COPY_FROM},
+      {1, "A/D/E", "base-deleted", NO_COPY_FROM},
       {1, "X",     "normal",       1, "A", MOVED_HERE},
       {1, "X/B",   "not-present",  2, "A/B"},
+      {1, "X/D",   "not-present",  2, "A/D"},
+      {2, "X/D",   "normal",       2, "A/D"},
+      {2, "X/D/E", "not-present",  3, "A/D/E"},
+      {2, "X/Y",   "normal",       2, "A/B"},
+      {2, "X/Y/C", "not-present",  NO_COPY_FROM},
+      {3, "X/Y/C", "normal",       3, "A/B/C"},
+      {3, "X/D/E", "normal",       3, "A/D/E"},
+
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  /* A/B/C still doesn't exist as X/B/C at op depth 1 */
+  SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+                                     sbox_wc_path(&b, "A/B/C"), pool, pool));
+  SVN_ERR(check_moved_to(moved_tos, 0, 1, "X/B/C"));
+  SVN_TEST_ASSERT(moved_tos->nelts == 1);
+
+  /* A/B doesn't exist exist as X/B and the move to Y can't be tracked in
+     the current scheme */
+  SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+                                     sbox_wc_path(&b, "A/B"), pool, pool));
+  SVN_ERR(check_moved_to(moved_tos, 0, 1, "X/B"));
+  SVN_TEST_ASSERT(moved_tos->nelts == 1);
+
+  SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+                                     sbox_wc_path(&b, "A"), pool, pool));
+  SVN_ERR(check_moved_to(moved_tos, 0, 1, "X"));
+  SVN_TEST_ASSERT(moved_tos->nelts == 1);
+
+
+  SVN_ERR(sbox_wc_mkdir(&b, "Z"));
+  SVN_ERR(sbox_wc_commit(&b, "Z")); /* r4 */
+
+  SVN_ERR(sbox_wc_update(&b, "", 4));
+
+  {
+    nodes_row_t nodes[] = {
+      {0, "",      "normal",       4, ""},
+      {0, "A",     "normal",       4, "A"},
+      {0, "A/B",   "normal",       4, "A/B"},
+      {0, "A/B/C", "normal",       4, "A/B/C"},
+      {0, "A/D",   "normal",       4, "A/D"},
+      {0, "A/D/E", "normal",       4, "A/D/E"},
+      {1, "A",     "base-deleted", NO_COPY_FROM, "X"},
+      {1, "A/B",   "base-deleted", NO_COPY_FROM},
+      {1, "A/B/C", "base-deleted", NO_COPY_FROM},
+      {1, "A/D",   "base-deleted", NO_COPY_FROM},
+      {1, "A/D/E", "base-deleted", NO_COPY_FROM},
+      /* X is expanded on update. The not-present nodes are now here */
+      {1, "X",     "normal",       4, "A", MOVED_HERE},
+      {1, "X/B",   "normal",       4, "A/B", MOVED_HERE},
+      {1, "X/B/C", "normal",       4, "A/B/C", MOVED_HERE},
+      {1, "X/D",   "normal",       4, "A/D", MOVED_HERE},
+      {1, "X/D/E", "normal",       4, "A/D/E", MOVED_HERE},
+      {2, "X/D",   "normal",       2, "A/D"},
+      {2, "X/D/E", "not-present",  3, "A/D/E"},
       {2, "X/Y",   "normal",       2, "A/B"},
       {2, "X/Y/C", "not-present",  NO_COPY_FROM},
+      {3, "X/D/E", "normal",       3, "A/D/E"},
       {3, "X/Y/C", "normal",       3, "A/B/C"},
+
+      {0, "Z",     "normal",       4, "Z"},
       {0}
     };
+
     SVN_ERR(check_db_rows(&b, "", nodes));
   }
 
   SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
                                      sbox_wc_path(&b, "A/B/C"), pool, pool));
-  SVN_TEST_ASSERT(moved_tos->nelts == 0);
+  SVN_ERR(check_moved_to(moved_tos, 0, 1, "X/B/C"));
+  SVN_TEST_ASSERT(moved_tos->nelts == 1);
 
   SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
                                      sbox_wc_path(&b, "A/B"), pool, pool));
-  SVN_TEST_ASSERT(moved_tos->nelts == 0);
+  SVN_ERR(check_moved_to(moved_tos, 0, 1, "X/B"));
+  SVN_TEST_ASSERT(moved_tos->nelts == 1);
 
   SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
                                      sbox_wc_path(&b, "A"), pool, pool));
   SVN_ERR(check_moved_to(moved_tos, 0, 1, "X"));
   SVN_TEST_ASSERT(moved_tos->nelts == 1);
 
+  {
+    conflict_info_t conflicts[] = {
+      { "X/D", FALSE, FALSE, TRUE },
+      {0}
+    };
+
+    SVN_ERR(check_db_conflicts(&b, "", conflicts));
+  }
+
   return SVN_NO_ERROR;
 }
 
@@ -5282,8 +5375,8 @@ update_prop_mod_into_moved(const svn_tes
   /* r1: Create files 'f', 'h' */
   SVN_ERR(sbox_wc_mkdir(&b, "A"));
   SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
-  sbox_file_write(&b, "A/B/f", "r1 content\n");
-  sbox_file_write(&b, "A/B/h", "r1 content\n");
+  SVN_ERR(sbox_file_write(&b, "A/B/f", "r1 content\n"));
+  SVN_ERR(sbox_file_write(&b, "A/B/h", "r1 content\n"));
   SVN_ERR(sbox_wc_add(&b, "A/B/f"));
   SVN_ERR(sbox_wc_add(&b, "A/B/h"));
   SVN_ERR(sbox_wc_propset(&b, "pd", "f1", "A/B/f"));
@@ -5294,14 +5387,14 @@ update_prop_mod_into_moved(const svn_tes
 
   /* r2: Modify 'f'. Delete prop 'pd', modify prop 'pm', add prop 'pa',
    * leave prop 'pn' unchanged. */
-  sbox_file_write(&b, "A/B/f", "r1 content\nr2 content\n");
+  SVN_ERR(sbox_file_write(&b, "A/B/f", "r1 content\nr2 content\n"));
   SVN_ERR(sbox_wc_propset(&b, "pd", NULL, "A/B/f"));
   SVN_ERR(sbox_wc_propset(&b, "pm", "f2", "A/B/f"));
   SVN_ERR(sbox_wc_propset(&b, "pa", "f2", "A/B/f"));
   SVN_ERR(sbox_wc_commit(&b, ""));
 
   /* r3: Delete 'h', add 'g' */
-  sbox_file_write(&b, "A/B/g", "r3 content\n");
+  SVN_ERR(sbox_file_write(&b, "A/B/g", "r3 content\n"));
   SVN_ERR(sbox_wc_add(&b, "A/B/g"));
   SVN_ERR(sbox_wc_propset(&b, "p", "g3", "A/B/g"));
   SVN_ERR(sbox_wc_delete(&b, "A/B/h"));
@@ -5413,12 +5506,12 @@ nested_move_update(const svn_test_opts_t
   SVN_ERR(sbox_wc_mkdir(&b, "A"));
   SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
   SVN_ERR(sbox_wc_mkdir(&b, "A/B/C"));
-  sbox_file_write(&b, "A/B/C/f", "r1 content\n");
+  SVN_ERR(sbox_file_write(&b, "A/B/C/f", "r1 content\n"));
   SVN_ERR(sbox_wc_add(&b, "A/B/C/f"));
   SVN_ERR(sbox_wc_commit(&b, ""));
 
   /* r2: Modify 'f' */
-  sbox_file_write(&b, "A/B/C/f", "r1 content\nr2 content\n");
+  SVN_ERR(sbox_file_write(&b, "A/B/C/f", "r1 content\nr2 content\n"));
   SVN_ERR(sbox_wc_commit(&b, ""));
 
   /* r3: Create 'X' */
@@ -5455,6 +5548,30 @@ nested_move_update(const svn_test_opts_t
 
   SVN_ERR(sbox_wc_update(&b, "", 2));
 
+  {
+    nodes_row_t nodes[] = {
+      {0, "",          "normal",       2, ""},
+      {0, "A",         "normal",       2, "A"},
+      {0, "A/B",       "normal",       2, "A/B"},
+      {0, "A/B/C",     "normal",       2, "A/B/C"},
+      {0, "A/B/C/f",   "normal",       2, "A/B/C/f"},
+      {1, "A",         "base-deleted", NO_COPY_FROM, "A2"},
+      {1, "A/B",       "base-deleted", NO_COPY_FROM},
+      {1, "A/B/C",     "base-deleted", NO_COPY_FROM},
+      {1, "A/B/C/f",   "base-deleted", NO_COPY_FROM},
+      {1, "A2",        "normal",       1, "A", MOVED_HERE},
+      {1, "A2/B",      "normal",       1, "A/B", MOVED_HERE},
+      {1, "A2/B/C",    "normal",       1, "A/B/C", MOVED_HERE},
+      {1, "A2/B/C/f",  "normal",       1, "A/B/C/f", MOVED_HERE},
+      {3, "A2/B/C",    "base-deleted", NO_COPY_FROM, "A2/B/C2"},
+      {3, "A2/B/C/f",  "base-deleted", NO_COPY_FROM},
+      {3, "A2/B/C2",   "normal",       1, "A/B/C", MOVED_HERE},
+      {3, "A2/B/C2/f", "normal",       1, "A/B/C/f", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
   /* Following the A->A2 move should raise a tree-conflict on A2/B/C,
      resolving that may require an explicit resolve. */
   SVN_ERR(sbox_wc_resolve(&b, "A", svn_depth_empty,
@@ -5528,7 +5645,7 @@ nested_move_commit(const svn_test_opts_t
   SVN_ERR(sbox_wc_mkdir(&b, "A"));
   SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
   SVN_ERR(sbox_wc_mkdir(&b, "A/B/C"));
-  sbox_file_write(&b, "A/B/C/f", "r1 content\n");
+  SVN_ERR(sbox_file_write(&b, "A/B/C/f", "r1 content\n"));
   SVN_ERR(sbox_wc_add(&b, "A/B/C/f"));
   SVN_ERR(sbox_wc_commit(&b, ""));
   SVN_ERR(sbox_wc_update(&b, "", 1));
@@ -5793,7 +5910,7 @@ check_tree_conflict_repos_path(svn_test_
 
       SVN_TEST_ASSERT(version != NULL);
 
-      SVN_TEST_ASSERT(!strcmp(version->path_in_repos, repos_path1));
+      SVN_TEST_STRING_ASSERT(version->path_in_repos, repos_path1);
     }
 
   if (repos_path2)
@@ -5803,7 +5920,7 @@ check_tree_conflict_repos_path(svn_test_
 
       SVN_TEST_ASSERT(version != NULL);
 
-      SVN_TEST_ASSERT(!strcmp(version->path_in_repos, repos_path2));
+      SVN_TEST_STRING_ASSERT(version->path_in_repos, repos_path2);
     }
 
   return SVN_NO_ERROR;
@@ -5829,7 +5946,7 @@ move_update_conflicts(const svn_test_opt
   SVN_ERR(sbox_wc_update(&b, "", 1));
   SVN_ERR(sbox_wc_move(&b, "A", "A2"));
   SVN_ERR(sbox_wc_move(&b, "A2/B/C", "A2/B/C2"));
-  sbox_file_write(&b, "A2/B/F", "obstruction\n");
+  SVN_ERR(sbox_file_write(&b, "A2/B/F", "obstruction\n"));
 
   {
     nodes_row_t nodes[] = {
@@ -5907,7 +6024,7 @@ move_update_delete_mods(const svn_test_o
   SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
   SVN_ERR(sbox_wc_mkdir(&b, "A/B/C"));
   SVN_ERR(sbox_wc_mkdir(&b, "A/B/D"));
-  sbox_file_write(&b, "A/B/C/f", "r1 content\n");
+  SVN_ERR(sbox_file_write(&b, "A/B/C/f", "r1 content\n"));
   SVN_ERR(sbox_wc_add(&b, "A/B/C/f"));
   SVN_ERR(sbox_wc_commit(&b, ""));
   SVN_ERR(sbox_wc_delete(&b, "A/B/C"));
@@ -5916,7 +6033,7 @@ move_update_delete_mods(const svn_test_o
   SVN_ERR(sbox_wc_update(&b, "", 1));
 
   SVN_ERR(sbox_wc_move(&b, "A/B", "B2"));
-  sbox_file_write(&b, "B2/C/f", "modified content\n");
+  SVN_ERR(sbox_file_write(&b, "B2/C/f", "modified content\n"));
   SVN_ERR(sbox_wc_delete(&b, "B2/D"));
   {
     nodes_row_t nodes[] = {
@@ -6771,7 +6888,7 @@ finite_move_update_bump(const svn_test_o
   SVN_ERR(sbox_wc_mkdir(&b, "A/B/C"));
   SVN_ERR(sbox_wc_mkdir(&b, "P"));
   SVN_ERR(sbox_wc_mkdir(&b, "P/Q"));
-  sbox_file_write(&b, "P/Q/f", "r1 content\n");
+  SVN_ERR(sbox_file_write(&b, "P/Q/f", "r1 content\n"));
   SVN_ERR(sbox_wc_add(&b, "P/Q/f"));
   SVN_ERR(sbox_wc_commit(&b, ""));
   SVN_ERR(sbox_wc_mkdir(&b, "X"));
@@ -6808,10 +6925,25 @@ finite_move_update_bump(const svn_test_o
   SVN_ERR(sbox_wc_move(&b, "P/Q", "Q2"));
   SVN_ERR(sbox_wc_update_depth(&b, "A/B", 2, svn_depth_files, FALSE));
   SVN_ERR(sbox_wc_update_depth(&b, "P/Q", 2, svn_depth_files, FALSE));
-  SVN_ERR(check_tree_conflict_repos_path(&b, "A/B", NULL, NULL));
+  {
+    conflict_info_t conflicts[] = {
+      {"A/B", FALSE, FALSE, TRUE},
+      {"P/Q", FALSE, FALSE, TRUE},
+      {0}
+    };
+    SVN_ERR(check_db_conflicts(&b, "", conflicts));
+  }
+
+  SVN_ERR(check_tree_conflict_repos_path(&b, "A/B", "A/B", "A/B"));
+  SVN_ERR(check_tree_conflict_repos_path(&b, "P/Q", "P/Q", "P/Q"));
   err = sbox_wc_resolve(&b, "A/B", svn_depth_empty,
                         svn_wc_conflict_choose_mine_conflict);
   SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE);
+
+  /* sbox_wc_resolve() obtains a lock on the target path, so now it
+     will apply the change on the target */
+  SVN_ERR(sbox_wc_resolve(&b, "P/Q", svn_depth_empty,
+                          svn_wc_conflict_choose_mine_conflict));
   {
     nodes_row_t nodes[] = {
       {0, "",        "normal",       1, ""},
@@ -6840,10 +6972,21 @@ finite_move_update_bump(const svn_test_o
   SVN_ERR(sbox_wc_move(&b, "P", "P2"));
   SVN_ERR(sbox_wc_update_depth(&b, "A/B", 2, svn_depth_immediates, FALSE));
   SVN_ERR(sbox_wc_update_depth(&b, "P", 2, svn_depth_immediates, FALSE));
-  SVN_ERR(check_tree_conflict_repos_path(&b, "P", NULL, NULL));
+  {
+    conflict_info_t conflicts[] = {
+      {"A/B", FALSE, FALSE, TRUE},
+      {"P", FALSE, FALSE, TRUE},
+      {0}
+    };
+    SVN_ERR(check_db_conflicts(&b, "", conflicts));
+  }
+  SVN_ERR(check_tree_conflict_repos_path(&b, "P", "P", "P"));
+  SVN_ERR(check_tree_conflict_repos_path(&b, "A/B", "A/B", "A/B"));
   err = sbox_wc_resolve(&b, "P", svn_depth_empty,
                         svn_wc_conflict_choose_mine_conflict);
   SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE);
+  SVN_ERR(sbox_wc_resolve(&b, "A/B", svn_depth_empty,
+                          svn_wc_conflict_choose_mine_conflict));
   {
     nodes_row_t nodes[] = {
       {0, "",        "normal",       1, ""},
@@ -6874,10 +7017,21 @@ finite_move_update_bump(const svn_test_o
   SVN_ERR(sbox_wc_move(&b, "P/Q", "Q2"));
   SVN_ERR(sbox_wc_update_depth(&b, "A/B/C", 2, svn_depth_empty, FALSE));
   SVN_ERR(sbox_wc_update_depth(&b, "P/Q", 2, svn_depth_empty, FALSE));
-  SVN_ERR(check_tree_conflict_repos_path(&b, "P/Q", NULL, NULL));
+  {
+    conflict_info_t conflicts[] = {
+      {"A/B/C", FALSE, FALSE, TRUE},
+      {"P/Q", FALSE, FALSE, TRUE},
+      {0}
+    };
+    SVN_ERR(check_db_conflicts(&b, "", conflicts));
+  }
+  SVN_ERR(check_tree_conflict_repos_path(&b, "A/B/C", "A/B/C", "A/B/C"));
+  SVN_ERR(check_tree_conflict_repos_path(&b, "P/Q", "P/Q", "P/Q"));
   err = sbox_wc_resolve(&b, "P/Q", svn_depth_empty,
                         svn_wc_conflict_choose_mine_conflict);
   SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE);
+  SVN_ERR(sbox_wc_resolve(&b, "A/B/C", svn_depth_empty,
+                          svn_wc_conflict_choose_mine_conflict));
   {
     nodes_row_t nodes[] = {
       {0, "",        "normal",       1, ""},
@@ -7894,6 +8048,42 @@ move_depth_expand(const svn_test_opts_t
 
   SVN_ERR(sbox_wc_update_depth(&b, "", 1, svn_depth_infinity, TRUE));
 
+  /* And now verify that there are no not-present nodes left and a
+     consistent working copy */
+  {
+    nodes_row_t nodes[] = {
+      {0, "",        "normal",       1, "" },
+
+      {0, "A",       "normal",       1, "A" },
+      {0, "A/A",     "normal",       1, "A/A" },
+      {0, "A/A/A",   "normal",       1, "A/A/A" },
+      {0, "A/A/A/A", "normal",       1, "A/A/A/A" },
+      {0, "A/B",     "normal",       1, "A/B" },
+      {0, "A/B/A",   "normal",       1, "A/B/A" },
+      {0, "A/B/A/A", "normal",       1, "A/B/A/A" },
+
+      {1, "A",       "base-deleted", NO_COPY_FROM, "C" },
+      {1, "A/A",     "base-deleted", NO_COPY_FROM },
+      {1, "A/A/A",   "base-deleted", NO_COPY_FROM },
+      {1, "A/B",     "base-deleted", NO_COPY_FROM },
+      {1, "A/B/A",   "base-deleted", NO_COPY_FROM },
+      {1, "A/B/A/A", "base-deleted", NO_COPY_FROM },
+      {1, "A/A/A/A", "base-deleted", NO_COPY_FROM },
+
+      {1, "C",       "normal",       1, "A", MOVED_HERE },
+      {1, "C/A",     "normal",       1, "A/A", MOVED_HERE },
+      {1, "C/B",     "not-present",  0, "A/B", MOVED_HERE},
+
+      {2, "C/B",     "normal",       1, "A/A" },
+
+      {3, "C/A/A",   "normal",       NO_COPY_FROM },
+      {3, "C/B/A",   "normal",       NO_COPY_FROM },
+
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
   /* This used to cause a segfault. Then it asserted in a different place */
   SVN_ERR(sbox_wc_resolve(&b, "A", svn_depth_empty,
                           svn_wc_conflict_choose_mine_conflict));
@@ -7925,10 +8115,6 @@ move_depth_expand(const svn_test_opts_t
       {1, "C/A",     "normal",       1, "A/A", MOVED_HERE },
       {1, "C/A/A",   "normal",       1, "A/A/A", MOVED_HERE },
       {1, "C/A/A/A", "normal",       1, "A/A/A/A", MOVED_HERE },
-
-      {3, "C/A/A",   "normal",       NO_COPY_FROM },
-      {3, "C/A/A/A", "base-deleted", NO_COPY_FROM },
-
       {1, "C/B",     "normal",       1, "A/B", MOVED_HERE },
       {1, "C/B/A",   "normal",       1, "A/B/A", MOVED_HERE },
       {1, "C/B/A/A", "normal",       1, "A/B/A/A", MOVED_HERE },
@@ -7937,6 +8123,8 @@ move_depth_expand(const svn_test_opts_t
       {2, "C/B/A",   "base-deleted", NO_COPY_FROM },
       {2, "C/B/A/A", "base-deleted", NO_COPY_FROM },
 
+      {3, "C/A/A",   "normal",       NO_COPY_FROM },
+      {3, "C/A/A/A", "base-deleted", NO_COPY_FROM },
       {3, "C/B/A",   "normal",       NO_COPY_FROM },
 
       {0}
@@ -8104,7 +8292,7 @@ move_delete_file_externals(const svn_tes
 
   SVN_ERR(sbox_wc_mkdir(&b, "A"));
   SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
-  sbox_file_write(&b, "f", "New file");
+  SVN_ERR(sbox_file_write(&b, "f", "New file"));
   SVN_ERR(sbox_wc_add(&b, "f"));
   SVN_ERR(sbox_wc_propset(&b, "svn:externals", "^/f B/P/g", "A"));
   SVN_ERR(sbox_wc_propset(&b, "svn:externals", "^/f Q/g\n^/f g", "A/B"));
@@ -8980,6 +9168,21 @@ init_move4(svn_test__sandbox_t *sandbox,
       SVN_ERR(sbox_wc_mkdir(sandbox, "C/A/A/NEW"));
       SVN_ERR(sbox_wc_mkdir(sandbox, "D/A/A/NEW"));
     }
+  else if (strstr(test_name, "_replace_"))
+    {
+      SVN_ERR(sbox_wc_delete(sandbox, "A/A/A/A"));
+      SVN_ERR(sbox_wc_delete(sandbox, "B/A/A/A"));
+      SVN_ERR(sbox_wc_delete(sandbox, "C/A/A/A"));
+      SVN_ERR(sbox_wc_delete(sandbox, "D/A/A/A"));
+      SVN_ERR(sbox_file_write(sandbox, "A/A/A/A", "A"));
+      SVN_ERR(sbox_file_write(sandbox, "B/A/A/A", "A"));
+      SVN_ERR(sbox_file_write(sandbox, "C/A/A/A", "A"));
+      SVN_ERR(sbox_file_write(sandbox, "D/A/A/A", "A"));
+      SVN_ERR(sbox_wc_add(sandbox, "A/A/A/A"));
+      SVN_ERR(sbox_wc_add(sandbox, "B/A/A/A"));
+      SVN_ERR(sbox_wc_add(sandbox, "C/A/A/A"));
+      SVN_ERR(sbox_wc_add(sandbox, "D/A/A/A"));
+    }
   else if (strstr(test_name, "_delself_"))
     {
       SVN_ERR(sbox_wc_delete(sandbox, "A/A/A"));
@@ -8987,6 +9190,21 @@ init_move4(svn_test__sandbox_t *sandbox,
       SVN_ERR(sbox_wc_delete(sandbox, "C/A/A"));
       SVN_ERR(sbox_wc_delete(sandbox, "D/A/A"));
     }
+  else if (strstr(test_name, "_replaceself_"))
+    {
+      SVN_ERR(sbox_wc_delete(sandbox, "A/A/A"));
+      SVN_ERR(sbox_wc_delete(sandbox, "B/A/A"));
+      SVN_ERR(sbox_wc_delete(sandbox, "C/A/A"));
+      SVN_ERR(sbox_wc_delete(sandbox, "D/A/A"));
+      SVN_ERR(sbox_file_write(sandbox, "A/A/A", "A"));
+      SVN_ERR(sbox_file_write(sandbox, "B/A/A", "A"));
+      SVN_ERR(sbox_file_write(sandbox, "C/A/A", "A"));
+      SVN_ERR(sbox_file_write(sandbox, "D/A/A", "A"));
+      SVN_ERR(sbox_wc_add(sandbox, "A/A/A"));
+      SVN_ERR(sbox_wc_add(sandbox, "B/A/A"));
+      SVN_ERR(sbox_wc_add(sandbox, "C/A/A"));
+      SVN_ERR(sbox_wc_add(sandbox, "D/A/A"));
+    }
 
   SVN_ERR(sbox_wc_commit(sandbox, ""));
   SVN_ERR(sbox_wc_update(sandbox, "", 1));
@@ -9135,6 +9353,26 @@ del4_update_add_AAA(const svn_test_opts_
 }
 
 static svn_error_t *
+del4_update_replace_AAA(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+  svn_test__sandbox_t b;
+
+  SVN_ERR(init_move4(&b, "del4_update_replace_AAA", opts, FALSE, pool));
+
+  /* Update and resolve via mine strategy */
+  SVN_ERR(sbox_wc_update(&b, "", 2));
+  SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_mine_conflict));
+  /* Go back to start position */
+  SVN_ERR(sbox_wc_update(&b, "", 1));
+  SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_mine_conflict));
+  /* Update and resolve via their strategy */
+  SVN_ERR(sbox_wc_update(&b, "", 2));
+  SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_merged));
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
 del4_update_delself_AAA(const svn_test_opts_t *opts, apr_pool_t *pool)
 {
   svn_test__sandbox_t b;
@@ -9144,6 +9382,19 @@ del4_update_delself_AAA(const svn_test_o
   /* Update and resolve via mine strategy */
   SVN_ERR(sbox_wc_update(&b, "", 2));
 
+  {
+    conflict_info_t conflicts[] = {
+      {"A", FALSE, FALSE, TRUE},
+      {"B", FALSE, FALSE, TRUE},
+      {"C/A", FALSE, FALSE, TRUE},
+      {"D/A/A", FALSE, FALSE, TRUE},
+      {0}
+    };
+
+    SVN_ERR(check_db_conflicts(&b, "", conflicts));
+  }
+
+
   /* Resolve a few conflicts manually */
   SVN_ERR(sbox_wc_resolve(&b, "A", svn_depth_empty,
                           svn_wc_conflict_choose_mine_conflict));
@@ -9152,7 +9403,54 @@ del4_update_delself_AAA(const svn_test_o
   SVN_ERR(sbox_wc_resolve(&b, "C/A", svn_depth_empty,
                           svn_wc_conflict_choose_mine_conflict));
 
-  /* ### These can currently only be resolved to merged ???? */
+  {
+    nodes_row_t nodes[] = {
+      {0, "",           "normal",       2, ""},
+      {0, "A",          "normal",       2, "A"},
+      {0, "A/A",        "normal",       2, "A/A"},
+      {0, "B",          "normal",       2, "B"},
+      {0, "B/A",        "normal",       2, "B/A"},
+      {0, "C",          "normal",       2, "C"},
+      {0, "C/A",        "normal",       2, "C/A"},
+      {0, "D",          "normal",       2, "D"},
+      {0, "D/A",        "normal",       2, "D/A"},
+      {1, "A",          "normal",       2, "B", MOVED_HERE},
+      {1, "A/A",        "normal",       2, "B/A", MOVED_HERE},
+      {1, "AAA_1",      "normal",       1, "A/A/A"},
+      {1, "AAA_1/A",    "normal",       1, "A/A/A/A"},
+      {1, "AAA_2",      "normal",       1, "B/A/A"},
+      {1, "AAA_2/A",    "normal",       1, "B/A/A/A"},
+      {1, "AAA_3",      "normal",       1, "C/A/A"},
+      {1, "AAA_3/A",    "normal",       1, "C/A/A/A"},
+      {1, "B",          "base-deleted", NO_COPY_FROM, "A"},
+      {1, "B/A",        "base-deleted", NO_COPY_FROM},
+      {2, "A/A",        "normal",       2, "C/A", MOVED_HERE},
+      {2, "C/A",        "base-deleted", NO_COPY_FROM, "A/A"},
+      {3, "A/A/A",      "normal",       1, "D/A/A"},
+      {3, "A/A/A/A",    "normal",       1, "D/A/A/A"},
+
+      { 0 },
+    };
+
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+  {
+    conflict_info_t conflicts[] = {
+      /* Not resolved yet */
+      {"D/A/A", FALSE, FALSE, TRUE},
+
+      /* New */
+      {"A/A", FALSE, FALSE, TRUE},
+      {"A/A/A", FALSE, FALSE, TRUE},
+
+      {0}
+    };
+
+    SVN_ERR(check_db_conflicts(&b, "", conflicts));
+  }
+
+  /* These can only be resolved to merged, as the merge is already broken
+     (because the move source is gone): incoming delete on moved_away */
   SVN_ERR(sbox_wc_resolve(&b, "D/A/A", svn_depth_empty,
                           svn_wc_conflict_choose_merged));
   SVN_ERR(sbox_wc_resolve(&b, "A/A/A", svn_depth_empty,
@@ -9170,6 +9468,27 @@ del4_update_delself_AAA(const svn_test_o
 }
 
 static svn_error_t *
+del4_update_replaceself_AAA(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+  svn_test__sandbox_t b;
+
+  SVN_ERR(init_move4(&b, "del4_update_replaceself_AAA", opts, FALSE, pool));
+
+  /* Update and resolve via mine strategy */
+  SVN_ERR(sbox_wc_update(&b, "", 2));
+  SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_mine_conflict));
+  /* Go back to start position */
+  SVN_ERR(sbox_wc_update(&b, "", 1));
+  SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_mine_conflict));
+  /* Update and resolve via their strategy */
+  SVN_ERR(sbox_wc_update(&b, "", 2));
+  SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_merged));
+
+  return SVN_NO_ERROR;
+}
+
+
+static svn_error_t *
 move4_update_edit_AAA(const svn_test_opts_t *opts, apr_pool_t *pool)
 {
     svn_test__sandbox_t b;
@@ -9287,6 +9606,26 @@ move4_update_add_AAA(const svn_test_opts
 }
 
 static svn_error_t *
+move4_update_replace_AAA(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+    svn_test__sandbox_t b;
+
+    SVN_ERR(init_move4(&b, "move4_update_replace_AAA", opts, TRUE, pool));
+
+    /* Update and resolve via mine strategy */
+    SVN_ERR(sbox_wc_update(&b, "", 2));
+    SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_mine_conflict));
+    /* Go back to start position */
+    SVN_ERR(sbox_wc_update(&b, "", 1));
+    SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_mine_conflict));
+    /* Update and resolve via their strategy */
+    SVN_ERR(sbox_wc_update(&b, "", 2));
+    SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_merged));
+
+    return SVN_NO_ERROR;
+}
+
+static svn_error_t *
 move4_update_delself_AAA(const svn_test_opts_t *opts, apr_pool_t *pool)
 {
     svn_test__sandbox_t b;
@@ -9296,14 +9635,73 @@ move4_update_delself_AAA(const svn_test_
     /* Update and resolve via mine strategy */
     SVN_ERR(sbox_wc_update(&b, "", 2));
 
+    {
+      nodes_row_t nodes[] = {
+
+        {1, "A_moved",        "normal",       1, "A", MOVED_HERE},
+        {1, "A_moved/A",      "normal",       1, "A/A", MOVED_HERE},
+        {1, "A_moved/A/A",    "normal",       1, "A/A/A", MOVED_HERE},
+        {3, "A_moved/A/A",    "base-deleted", NO_COPY_FROM, "AAA_1"},
+        {1, "A_moved/A/A/A",  "normal",       1, "A/A/A/A", MOVED_HERE},
+        {3, "A_moved/A/A/A",  "base-deleted", NO_COPY_FROM},
+
+        { 0 },
+      };
+        SVN_ERR(check_db_rows(&b, "A_moved", nodes));
+    }
+
     /* Resolve a few conflicts manually */
     SVN_ERR(sbox_wc_resolve(&b, "A", svn_depth_empty,
         svn_wc_conflict_choose_mine_conflict));
+
+    {
+      nodes_row_t nodes[] = {
+        {0, "",               "normal",       2, ""},
+        {0, "A",              "normal",       2, "A"},
+        {0, "A/A",            "normal",       2, "A/A"},
+        {0, "B",              "normal",       2, "B"},
+        {0, "B/A",            "normal",       2, "B/A"},
+        {0, "C",              "normal",       2, "C"},
+        {0, "C/A",            "normal",       2, "C/A"},
+        {0, "D",              "normal",       2, "D"},
+        {0, "D/A",            "normal",       2, "D/A"},
+        {1, "A",              "normal",       1, "B", FALSE, "A_moved", TRUE},
+        {1, "A/A",            "normal",       1, "B/A", MOVED_HERE},
+        {1, "A/A/A",          "normal",       1, "B/A/A", MOVED_HERE},
+        {1, "A/A/A/A",        "normal",       1, "B/A/A/A", MOVED_HERE},
+        {1, "AAA_1",          "normal",       1, "A/A/A"},
+        {1, "AAA_1/A",        "normal",       1, "A/A/A/A"},
+        {1, "AAA_2",          "normal",       1, "B/A/A", MOVED_HERE},
+        {1, "AAA_2/A",        "normal",       1, "B/A/A/A", MOVED_HERE},
+        {1, "AAA_3",          "normal",       1, "C/A/A", MOVED_HERE},
+        {1, "AAA_3/A",        "normal",       1, "C/A/A/A", MOVED_HERE},
+        {1, "A_moved",        "normal",       2, "A", MOVED_HERE},
+        {1, "A_moved/A",      "normal",       2, "A/A", MOVED_HERE},
+        {1, "B",              "base-deleted", NO_COPY_FROM, "A"},
+        {1, "B/A",            "base-deleted", NO_COPY_FROM},
+        {1, "BA_moved",       "normal",       1, "B/A", MOVED_HERE},
+        {1, "BA_moved/A",     "normal",       1, "B/A/A", MOVED_HERE},
+        {1, "BA_moved/A/A",   "normal",       1, "B/A/A/A", MOVED_HERE},
+        {2, "A/A",            "normal",       1, "C/A", FALSE, "BA_moved", TRUE},
+        {2, "A/A/A",          "normal",       1, "C/A/A", MOVED_HERE},
+        {2, "A/A/A/A",        "normal",       1, "C/A/A/A", MOVED_HERE},
+        {2, "BA_moved/A",     "base-deleted", NO_COPY_FROM, "AAA_2"},
+        {2, "BA_moved/A/A",   "base-deleted", NO_COPY_FROM},
+        {2, "C/A",            "base-deleted", NO_COPY_FROM, "A/A"},
+        {3, "A/A/A",          "normal",       1, "D/A/A", FALSE, "AAA_3"},
+        {3, "A/A/A/A",        "normal",       1, "D/A/A/A"},
+
+        { 0 },
+      };
+        SVN_ERR(check_db_rows(&b, "", nodes));
+    }
+
     SVN_ERR(sbox_wc_resolve(&b, "B", svn_depth_empty,
         svn_wc_conflict_choose_mine_conflict));
     SVN_ERR(sbox_wc_resolve(&b, "C/A", svn_depth_empty,
         svn_wc_conflict_choose_mine_conflict));
 
+
     /* ### These can currently only be resolved to merged ???? */
     SVN_ERR(sbox_wc_resolve(&b, "D/A/A", svn_depth_empty,
                             svn_wc_conflict_choose_merged));
@@ -9311,11 +9709,77 @@ move4_update_delself_AAA(const svn_test_
                             svn_wc_conflict_choose_merged));
     SVN_ERR(sbox_wc_resolve(&b, "A_moved/A/A", svn_depth_empty,
                             svn_wc_conflict_choose_merged));
-    /*SVN_ERR(check_db_conflicts(&b, "", NULL));*/
     SVN_ERR(sbox_wc_resolve(&b, "A/A", svn_depth_empty,
                             svn_wc_conflict_choose_mine_conflict));
     SVN_ERR(sbox_wc_resolve(&b, "BA_moved/A", svn_depth_empty,
                             svn_wc_conflict_choose_merged));
+    SVN_ERR(check_db_conflicts(&b, "", NULL));
+    /* Go back to start position */
+    SVN_ERR(sbox_wc_update(&b, "", 1));
+    {
+      nodes_row_t nodes[] = {
+        {0, "",               "normal",       1, ""},
+        {0, "A",              "normal",       1, "A"},
+        {0, "A/A",            "normal",       1, "A/A"},
+        {0, "A/A/A",          "normal",       1, "A/A/A"},
+        {0, "A/A/A/A",        "normal",       1, "A/A/A/A"},
+        {0, "B",              "normal",       1, "B"},
+        {0, "B/A",            "normal",       1, "B/A"},
+        {0, "B/A/A",          "normal",       1, "B/A/A"},
+        {0, "B/A/A/A",        "normal",       1, "B/A/A/A"},
+        {0, "C",              "normal",       1, "C"},
+        {0, "C/A",            "normal",       1, "C/A"},
+        {0, "C/A/A",          "normal",       1, "C/A/A"},
+        {0, "C/A/A/A",        "normal",       1, "C/A/A/A"},
+        {0, "D",              "normal",       1, "D"},
+        {0, "D/A",            "normal",       1, "D/A"},
+        {0, "D/A/A",          "normal",       1, "D/A/A"},
+        {0, "D/A/A/A",        "normal",       1, "D/A/A/A"},
+        {1, "A",              "normal",       2, "B", FALSE, "A_moved", TRUE},
+        {1, "A/A",            "normal",       2, "B/A", MOVED_HERE},
+        {1, "A/A/A",          "base-deleted", NO_COPY_FROM},
+        {1, "A/A/A/A",        "base-deleted", NO_COPY_FROM},
+        {1, "A_moved",        "normal",       2, "A", MOVED_HERE},
+        {1, "A_moved/A",      "normal",       2, "A/A", MOVED_HERE},
+        {1, "AAA_1",          "normal",       1, "A/A/A"},
+        {1, "AAA_1/A",        "normal",       1, "A/A/A/A"},
+        {1, "AAA_2",          "normal",       1, "B/A/A"},
+        {1, "AAA_2/A",        "normal",       1, "B/A/A/A"},
+        {1, "AAA_3",          "normal",       1, "C/A/A"},
+        {1, "AAA_3/A",        "normal",       1, "C/A/A/A"},
+        {1, "B",              "base-deleted", NO_COPY_FROM, "A"},
+        {1, "B/A",            "base-deleted", NO_COPY_FROM},
+        {1, "B/A/A",          "base-deleted", NO_COPY_FROM},
+        {1, "B/A/A/A",        "base-deleted", NO_COPY_FROM},
+        {1, "BA_moved",       "normal",       2, "B/A", MOVED_HERE},
+        {2, "A/A",            "normal",       2, "C/A", FALSE, "BA_moved", TRUE},
+        {2, "C/A",            "base-deleted", NO_COPY_FROM, "A/A"},
+        {2, "C/A/A",          "base-deleted", NO_COPY_FROM},
+        {2, "C/A/A/A",        "base-deleted", NO_COPY_FROM},
+        {3, "A/A/A",          "normal",       1, "D/A/A"},
+        {3, "A/A/A/A",        "normal",       1, "D/A/A/A"},
+
+        { 0 },
+      };
+        SVN_ERR(check_db_rows(&b, "", nodes));
+    }
+    SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_mine_conflict));
+    /* Update and resolve via their strategy */
+    SVN_ERR(sbox_wc_update(&b, "", 2));
+    SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_merged));
+
+    return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+move4_update_replaceself_AAA(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+    svn_test__sandbox_t b;
+
+    SVN_ERR(init_move4(&b, "move4_update_replaceself_AAA", opts, TRUE, pool));
+
+    /* Update and resolve via mine strategy */
+    SVN_ERR(sbox_wc_update(&b, "", 2));
     SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_mine_conflict));
     /* Go back to start position */
     SVN_ERR(sbox_wc_update(&b, "", 1));
@@ -9576,7 +10040,6 @@ static svn_error_t *
 repo_wc_copy(const svn_test_opts_t *opts, apr_pool_t *pool)
 {
   svn_test__sandbox_t b;
-  const char *repos_dir;
   const char *new_repos_dir;
   const char *new_repos_url;
 
@@ -9604,15 +10067,13 @@ repo_wc_copy(const svn_test_opts_t *opts
     SVN_ERR(check_db_rows(&b, "AA", nodes));
   }
 
-  SVN_ERR(svn_uri_get_dirent_from_file_url(&repos_dir, b.repos_url,
-                                           pool));
-  new_repos_dir = apr_pstrcat(pool, repos_dir, "-2", SVN_VA_NULL);
+  new_repos_dir = apr_pstrcat(pool, b.repos_dir, "-2", SVN_VA_NULL);
   new_repos_url = apr_pstrcat(pool, b.repos_url, "-2", SVN_VA_NULL);
 
   svn_test_add_dir_cleanup(new_repos_dir);
 
   SVN_ERR(svn_io_remove_dir2(new_repos_dir, TRUE, NULL, NULL, pool));
-  SVN_ERR(svn_io_copy_dir_recursively(repos_dir,
+  SVN_ERR(svn_io_copy_dir_recursively(b.repos_dir,
                                       svn_dirent_dirname(new_repos_dir, pool),
                                       svn_dirent_basename(new_repos_dir, pool),
                                       FALSE, NULL, NULL, pool));
@@ -9733,6 +10194,395 @@ break_move_in_delete(const svn_test_opts
 }
 
 
+static svn_error_t *
+nested_move_delete(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+  svn_test__sandbox_t b;
+
+  SVN_ERR(svn_test__sandbox_create(&b, "nested_move_delete", opts, pool));
+
+  SVN_ERR(sbox_add_and_commit_greek_tree(&b));
+
+  SVN_ERR(sbox_wc_mkdir(&b, "A/Z"));
+  SVN_ERR(sbox_wc_move(&b, "A/B/lambda", "A/Z/lambda"));
+
+  SVN_ERR(sbox_wc_delete(&b, "A/B"));
+
+  {
+    nodes_row_t nodes_AB[] = {
+      {0, "A/B",          "normal",       1, "A/B"},
+      {2, "A/B",          "base-deleted", NO_COPY_FROM},
+      {0, "A/B/E",        "normal",       1, "A/B/E"},
+      {2, "A/B/E",        "base-deleted", NO_COPY_FROM},
+      {0, "A/B/E/alpha",  "normal",       1, "A/B/E/alpha"},
+      {2, "A/B/E/alpha",  "base-deleted", NO_COPY_FROM},
+      {0, "A/B/E/beta",   "normal",       1, "A/B/E/beta"},
+      {2, "A/B/E/beta",   "base-deleted", NO_COPY_FROM},
+      {0, "A/B/F",        "normal",       1, "A/B/F"},
+      {2, "A/B/F",        "base-deleted", NO_COPY_FROM},
+      {0, "A/B/lambda",   "normal",       1, "A/B/lambda"},
+      {2, "A/B/lambda",   "base-deleted", NO_COPY_FROM, "A/Z/lambda"},
+      {0}
+    };
+    nodes_row_t nodes_AZ[] = {
+      {2, "A/Z",          "normal",       NO_COPY_FROM},
+      {3, "A/Z/lambda",   "normal",       1, "A/B/lambda", MOVED_HERE },
+      {0}
+    };
+
+    SVN_ERR(check_db_rows(&b, "A/B", nodes_AB));
+    SVN_ERR(check_db_rows(&b, "A/Z", nodes_AZ));
+  }
+
+  SVN_ERR(sbox_wc_move(&b, "A", "A_moved"));
+
+  {
+    nodes_row_t nodes[] = {
+      {0, "",                   "normal",       0, ""},
+      {0, "A",                  "normal",       1, "A"},
+      {1, "A",                  "base-deleted", NO_COPY_FROM, "A_moved"},
+      {0, "A/B",                "normal",       1, "A/B"},
+      {1, "A/B",                "base-deleted", NO_COPY_FROM},
+      {0, "A/B/E",              "normal",       1, "A/B/E"},
+      {1, "A/B/E",              "base-deleted", NO_COPY_FROM},
+      {0, "A/B/E/alpha",        "normal",       1, "A/B/E/alpha"},
+      {1, "A/B/E/alpha",        "base-deleted", NO_COPY_FROM},
+      {0, "A/B/E/beta",         "normal",       1, "A/B/E/beta"},
+      {1, "A/B/E/beta",         "base-deleted", NO_COPY_FROM},
+      {0, "A/B/F",              "normal",       1, "A/B/F"},
+      {1, "A/B/F",              "base-deleted", NO_COPY_FROM},
+      {0, "A/B/lambda",         "normal",       1, "A/B/lambda"},
+      {1, "A/B/lambda",         "base-deleted", NO_COPY_FROM},
+      {0, "A/C",                "normal",       1, "A/C"},
+      {1, "A/C",                "base-deleted", NO_COPY_FROM},
+      {0, "A/D",                "normal",       1, "A/D"},
+      {1, "A/D",                "base-deleted", NO_COPY_FROM},
+      {0, "A/D/G",              "normal",       1, "A/D/G"},
+      {1, "A/D/G",              "base-deleted", NO_COPY_FROM},
+      {0, "A/D/G/pi",           "normal",       1, "A/D/G/pi"},
+      {1, "A/D/G/pi",           "base-deleted", NO_COPY_FROM},
+      {0, "A/D/G/rho",          "normal",       1, "A/D/G/rho"},
+      {1, "A/D/G/rho",          "base-deleted", NO_COPY_FROM},
+      {0, "A/D/G/tau",          "normal",       1, "A/D/G/tau"},
+      {1, "A/D/G/tau",          "base-deleted", NO_COPY_FROM},
+      {0, "A/D/H",              "normal",       1, "A/D/H"},
+      {1, "A/D/H",              "base-deleted", NO_COPY_FROM},
+      {0, "A/D/H/chi",          "normal",       1, "A/D/H/chi"},
+      {1, "A/D/H/chi",          "base-deleted", NO_COPY_FROM},
+      {0, "A/D/H/omega",        "normal",       1, "A/D/H/omega"},
+      {1, "A/D/H/omega",        "base-deleted", NO_COPY_FROM},
+      {0, "A/D/H/psi",          "normal",       1, "A/D/H/psi"},
+      {1, "A/D/H/psi",          "base-deleted", NO_COPY_FROM},
+      {0, "A/D/gamma",          "normal",       1, "A/D/gamma"},
+      {1, "A/D/gamma",          "base-deleted", NO_COPY_FROM},
+      {0, "A/mu",               "normal",       1, "A/mu"},
+      {1, "A/mu",               "base-deleted", NO_COPY_FROM},
+      {1, "A_moved",            "normal",       1, "A", MOVED_HERE},
+      {1, "A_moved/B",          "normal",       1, "A/B", MOVED_HERE},
+      {2, "A_moved/B",          "base-deleted", NO_COPY_FROM},
+      {2, "A_moved/B/E",        "base-deleted", NO_COPY_FROM},
+      {1, "A_moved/B/E",        "normal",       1, "A/B/E", MOVED_HERE},
+      {1, "A_moved/B/E/alpha",  "normal",       1, "A/B/E/alpha", MOVED_HERE},
+      {2, "A_moved/B/E/alpha",  "base-deleted", NO_COPY_FROM},
+      {1, "A_moved/B/E/beta",   "normal",       1, "A/B/E/beta", MOVED_HERE},
+      {2, "A_moved/B/E/beta",   "base-deleted", NO_COPY_FROM},
+      {1, "A_moved/B/F",        "normal",       1, "A/B/F", MOVED_HERE},
+      {2, "A_moved/B/F",        "base-deleted", NO_COPY_FROM},
+      {1, "A_moved/B/lambda",   "normal",       1, "A/B/lambda", MOVED_HERE},
+      {2, "A_moved/B/lambda",   "base-deleted", NO_COPY_FROM, "A_moved/Z/lambda"},
+      {1, "A_moved/C",          "normal",       1, "A/C", MOVED_HERE},
+      {1, "A_moved/D",          "normal",       1, "A/D", MOVED_HERE},
+      {1, "A_moved/D/G",        "normal",       1, "A/D/G", MOVED_HERE},
+      {1, "A_moved/D/G/pi",     "normal",       1, "A/D/G/pi", MOVED_HERE},
+      {1, "A_moved/D/G/rho",    "normal",       1, "A/D/G/rho", MOVED_HERE},
+      {1, "A_moved/D/G/tau",    "normal",       1, "A/D/G/tau", MOVED_HERE},
+      {1, "A_moved/D/H",        "normal",       1, "A/D/H", MOVED_HERE},
+      {1, "A_moved/D/H/chi",    "normal",       1, "A/D/H/chi", MOVED_HERE},
+      {1, "A_moved/D/H/omega",  "normal",       1, "A/D/H/omega", MOVED_HERE},
+      {1, "A_moved/D/H/psi",    "normal",       1, "A/D/H/psi", MOVED_HERE},
+      {1, "A_moved/D/gamma",    "normal",       1, "A/D/gamma", MOVED_HERE},
+      {2, "A_moved/Z",          "normal",       NO_COPY_FROM},
+      {3, "A_moved/Z/lambda",   "normal",       1, "A/B/lambda", MOVED_HERE},
+      {1, "A_moved/mu",         "normal",       1, "A/mu", MOVED_HERE},
+      {0, "iota", "normal",  1, "iota"},
+
+      {0}
+    };
+
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+move_within_mixed_move(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+  svn_test__sandbox_t b;
+
+  SVN_ERR(svn_test__sandbox_create(&b, "move_within_mixed_move", opts, pool));
+
+  SVN_ERR(sbox_add_and_commit_greek_tree(&b));
+
+  SVN_ERR(sbox_wc_delete(&b, "iota"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+
+  /* Make A mixed revision */
+  SVN_ERR(sbox_wc_update(&b, "A/B/E", 2));
+
+  /* Single rev moves.. ok */
+  SVN_ERR(sbox_wc_move(&b, "A/D", "A/D_mv"));
+  SVN_ERR(sbox_wc_move(&b, "A/C", "C_mv"));
+
+  {
+    nodes_row_t nodes[] = {
+      {0, "",                 "normal",       0, ""},
+      {0, "A",                "normal",       1, "A"},
+      {0, "A/B",              "normal",       1, "A/B"},
+      {0, "A/B/E",            "normal",       2, "A/B/E"},
+      {0, "A/B/E/alpha",      "normal",       2, "A/B/E/alpha"},
+      {0, "A/B/E/beta",       "normal",       2, "A/B/E/beta"},
+      {0, "A/B/F",            "normal",       1, "A/B/F"},
+      {0, "A/B/lambda",       "normal",       1, "A/B/lambda"},
+      {0, "A/C",              "normal",       1, "A/C"},
+      {0, "A/D",              "normal",       1, "A/D"},
+      {0, "A/D/G",            "normal",       1, "A/D/G"},
+      {0, "A/D/G/pi",         "normal",       1, "A/D/G/pi"},
+      {0, "A/D/G/rho",        "normal",       1, "A/D/G/rho"},
+      {0, "A/D/G/tau",        "normal",       1, "A/D/G/tau"},
+      {0, "A/D/gamma",        "normal",       1, "A/D/gamma"},
+      {0, "A/D/H",            "normal",       1, "A/D/H"},
+      {0, "A/D/H/chi",        "normal",       1, "A/D/H/chi"},
+      {0, "A/D/H/omega",      "normal",       1, "A/D/H/omega"},
+      {0, "A/D/H/psi",        "normal",       1, "A/D/H/psi"},
+      {0, "A/mu",             "normal",       1, "A/mu"},
+      {0, "iota",             "not-present",  2, "iota"},
+      {1, "C_mv",             "normal",       1, "A/C", MOVED_HERE},
+      {2, "A/C",              "base-deleted", NO_COPY_FROM, "C_mv"},
+      {2, "A/D",              "base-deleted", NO_COPY_FROM, "A/D_mv"},
+      {2, "A/D/G",            "base-deleted", NO_COPY_FROM},
+      {2, "A/D/G/pi",         "base-deleted", NO_COPY_FROM},
+      {2, "A/D/G/rho",        "base-deleted", NO_COPY_FROM},
+      {2, "A/D/G/tau",        "base-deleted", NO_COPY_FROM},
+      {2, "A/D/gamma",        "base-deleted", NO_COPY_FROM},
+      {2, "A/D/H",            "base-deleted", NO_COPY_FROM},
+      {2, "A/D/H/chi",        "base-deleted", NO_COPY_FROM},
+      {2, "A/D/H/omega",      "base-deleted", NO_COPY_FROM},
+      {2, "A/D/H/psi",        "base-deleted", NO_COPY_FROM},
+      {2, "A/D_mv",           "normal",       1, "A/D", MOVED_HERE},
+      {2, "A/D_mv/G",         "normal",       1, "A/D/G", MOVED_HERE},
+      {2, "A/D_mv/G/pi",      "normal",       1, "A/D/G/pi", MOVED_HERE},
+      {2, "A/D_mv/G/rho",     "normal",       1, "A/D/G/rho", MOVED_HERE},
+      {2, "A/D_mv/G/tau",     "normal",       1, "A/D/G/tau", MOVED_HERE},
+      {2, "A/D_mv/gamma",     "normal",       1, "A/D/gamma", MOVED_HERE},
+      {2, "A/D_mv/H",         "normal",       1, "A/D/H", MOVED_HERE},
+      {2, "A/D_mv/H/chi",     "normal",       1, "A/D/H/chi", MOVED_HERE},
+      {2, "A/D_mv/H/omega",   "normal",       1, "A/D/H/omega", MOVED_HERE},
+      {2, "A/D_mv/H/psi",     "normal",       1, "A/D/H/psi", MOVED_HERE},
+      {0}
+    };
+
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  /* Mixed rev move... breaks recordings "A/D" -> "A/D_mv"  */
+  SVN_ERR(sbox_wc_move(&b, "A", "A_mv"));
+
+  {
+    nodes_row_t nodes[] = {
+      {0, "",                 "normal",       0, ""},
+      {0, "A",                "normal",       1, "A"},
+      {0, "A/B",              "normal",       1, "A/B"},
+      {0, "A/B/E",            "normal",       2, "A/B/E"},
+      {0, "A/B/E/alpha",      "normal",       2, "A/B/E/alpha"},
+      {0, "A/B/E/beta",       "normal",       2, "A/B/E/beta"},
+      {0, "A/B/F",            "normal",       1, "A/B/F"},
+      {0, "A/B/lambda",       "normal",       1, "A/B/lambda"},
+      {0, "A/C",              "normal",       1, "A/C"},
+      {0, "A/D",              "normal",       1, "A/D"},
+      {0, "A/D/G",            "normal",       1, "A/D/G"},
+      {0, "A/D/G/pi",         "normal",       1, "A/D/G/pi"},
+      {0, "A/D/G/rho",        "normal",       1, "A/D/G/rho"},
+      {0, "A/D/G/tau",        "normal",       1, "A/D/G/tau"},
+      {0, "A/D/gamma",        "normal",       1, "A/D/gamma"},
+      {0, "A/D/H",            "normal",       1, "A/D/H"},
+      {0, "A/D/H/chi",        "normal",       1, "A/D/H/chi"},
+      {0, "A/D/H/omega",      "normal",       1, "A/D/H/omega"},
+      {0, "A/D/H/psi",        "normal",       1, "A/D/H/psi"},
+      {0, "A/mu",             "normal",       1, "A/mu"},
+      {0, "iota",             "not-present",  2, "iota"},
+      {1, "A",                "base-deleted", NO_COPY_FROM },
+      {1, "A/B",              "base-deleted", NO_COPY_FROM },
+      {1, "A/B/E",            "base-deleted", NO_COPY_FROM },
+      {1, "A/B/E/alpha",      "base-deleted", NO_COPY_FROM },
+      {1, "A/B/E/beta",       "base-deleted", NO_COPY_FROM },
+      {1, "A/B/F",            "base-deleted", NO_COPY_FROM },
+      {1, "A/B/lambda",       "base-deleted", NO_COPY_FROM },
+      {1, "A/C",              "base-deleted", NO_COPY_FROM, "C_mv"},
+      {1, "A/D",              "base-deleted", NO_COPY_FROM, "A/D_mv" },
+      {1, "A/D/G",            "base-deleted", NO_COPY_FROM },
+      {1, "A/D/G/pi",         "base-deleted", NO_COPY_FROM },
+      {1, "A/D/G/rho",        "base-deleted", NO_COPY_FROM },
+      {1, "A/D/G/tau",        "base-deleted", NO_COPY_FROM },
+      {1, "A/D/gamma",        "base-deleted", NO_COPY_FROM },
+      {1, "A/D/H",            "base-deleted", NO_COPY_FROM },
+      {1, "A/D/H/chi",        "base-deleted", NO_COPY_FROM },
+      {1, "A/D/H/omega",      "base-deleted", NO_COPY_FROM },
+      {1, "A/D/H/psi",        "base-deleted", NO_COPY_FROM },
+      {1, "A/mu",             "base-deleted", NO_COPY_FROM },
+      {1, "A_mv",             "normal",       1, "A"},
+      {1, "A_mv/B",           "normal",       1, "A/B"},
+      {1, "A_mv/B/E",         "not-present",  2, "A/B/E"},
+      {1, "A_mv/B/F",         "normal",       1, "A/B/F"},
+      {1, "A_mv/B/lambda",    "normal",       1, "A/B/lambda"},
+      {1, "A_mv/C",           "normal",       1, "A/C"},
+      {1, "A_mv/D",           "normal",       1, "A/D"},
+      {1, "A_mv/D/G",         "normal",       1, "A/D/G"},
+      {1, "A_mv/D/G/pi",      "normal",       1, "A/D/G/pi"},
+      {1, "A_mv/D/G/rho",     "normal",       1, "A/D/G/rho"},
+      {1, "A_mv/D/G/tau",     "normal",       1, "A/D/G/tau"},
+      {1, "A_mv/D/gamma",     "normal",       1, "A/D/gamma"},
+      {1, "A_mv/D/H",         "normal",       1, "A/D/H"},
+      {1, "A_mv/D/H/chi",     "normal",       1, "A/D/H/chi"},
+      {1, "A_mv/D/H/omega",   "normal",       1, "A/D/H/omega"},
+      {1, "A_mv/D/H/psi",     "normal",       1, "A/D/H/psi"},
+      {1, "A_mv/mu",          "normal",       1, "A/mu"},
+      {1, "C_mv",             "normal",       1, "A/C", MOVED_HERE},
+      {2, "A_mv/C",           "base-deleted", NO_COPY_FROM },
+      {2, "A_mv/D",           "base-deleted", NO_COPY_FROM },
+      {2, "A_mv/D/G",         "base-deleted", NO_COPY_FROM },
+      {2, "A_mv/D/G/pi",      "base-deleted", NO_COPY_FROM },
+      {2, "A_mv/D/G/rho",     "base-deleted", NO_COPY_FROM },
+      {2, "A_mv/D/G/tau",     "base-deleted", NO_COPY_FROM },
+      {2, "A_mv/D/gamma",     "base-deleted", NO_COPY_FROM },
+      {2, "A_mv/D/H",         "base-deleted", NO_COPY_FROM },
+      {2, "A_mv/D/H/chi",     "base-deleted", NO_COPY_FROM },
+      {2, "A_mv/D/H/omega",   "base-deleted", NO_COPY_FROM },
+      {2, "A_mv/D/H/psi",     "base-deleted", NO_COPY_FROM },
+      {2, "A_mv/D_mv",        "normal",       1, "A/D", MOVED_HERE},
+      {2, "A_mv/D_mv/G",      "normal",       1, "A/D/G", MOVED_HERE},
+      {2, "A_mv/D_mv/G/pi",   "normal",       1, "A/D/G/pi", MOVED_HERE},
+      {2, "A_mv/D_mv/G/rho",  "normal",       1, "A/D/G/rho", MOVED_HERE},
+      {2, "A_mv/D_mv/G/tau",  "normal",       1, "A/D/G/tau", MOVED_HERE},
+      {2, "A_mv/D_mv/gamma",  "normal",       1, "A/D/gamma", MOVED_HERE},
+      {2, "A_mv/D_mv/H",      "normal",       1, "A/D/H", MOVED_HERE},
+      {2, "A_mv/D_mv/H/chi",  "normal",       1, "A/D/H/chi", MOVED_HERE},
+      {2, "A_mv/D_mv/H/omega","normal",       1, "A/D/H/omega", MOVED_HERE},
+      {2, "A_mv/D_mv/H/psi",  "normal",       1, "A/D/H/psi", MOVED_HERE},
+      {3, "A_mv/B/E",         "normal",       2, "A/B/E"},
+      {3, "A_mv/B/E/alpha",   "normal",       2, "A/B/E/alpha"},
+      {3, "A_mv/B/E/beta",    "normal",       2, "A/B/E/beta"},
+
+      {0}
+    };
+
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+move_edit_obstruction(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+  svn_test__sandbox_t b;
+
+  SVN_ERR(svn_test__sandbox_create(&b, "move_edit_obstruction", opts, pool));
+
+  SVN_ERR(sbox_add_and_commit_greek_tree(&b));
+
+  SVN_ERR(sbox_file_write(&b, "A/B/E/alpha", "Update alpha"));
+  SVN_ERR(sbox_wc_propset(&b, "a", "b", "A/B/F"));
+  SVN_ERR(sbox_wc_commit(&b, "")); /* r2 */
+
+  SVN_ERR(sbox_wc_update(&b, "", 1));
+
+  /* Simple move */
+  SVN_ERR(sbox_wc_move(&b, "A", "A_mv"));
+  SVN_ERR(sbox_wc_update(&b, "", 2));
+  SVN_ERR(sbox_wc_resolve(&b, "A", svn_depth_empty,
+                          svn_wc_conflict_choose_mine_conflict));
+
+  {
+    nodes_row_t nodes[] = {
+      {1, "A_mv",             "normal",       2, "A", MOVED_HERE},
+      {1, "A_mv/B",           "normal",       2, "A/B", MOVED_HERE},
+      {1, "A_mv/B/E",         "normal",       2, "A/B/E", MOVED_HERE},
+      {1, "A_mv/B/E/alpha",   "normal",       2, "A/B/E/alpha", MOVED_HERE},
+      {1, "A_mv/B/E/beta",    "normal",       2, "A/B/E/beta", MOVED_HERE},
+      {1, "A_mv/B/F",         "normal",       2, "A/B/F", MOVED_HERE, "a"},
+      {1, "A_mv/B/lambda",    "normal",       2, "A/B/lambda", MOVED_HERE},
+      {1, "A_mv/C",           "normal",       2, "A/C", MOVED_HERE},
+      {1, "A_mv/D",           "normal",       2, "A/D", MOVED_HERE},
+      {1, "A_mv/D/G",         "normal",       2, "A/D/G", MOVED_HERE},
+      {1, "A_mv/D/G/pi",      "normal",       2, "A/D/G/pi", MOVED_HERE},
+      {1, "A_mv/D/G/rho",     "normal",       2, "A/D/G/rho", MOVED_HERE},
+      {1, "A_mv/D/G/tau",     "normal",       2, "A/D/G/tau", MOVED_HERE},
+      {1, "A_mv/D/gamma",     "normal",       2, "A/D/gamma", MOVED_HERE},
+      {1, "A_mv/D/H",         "normal",       2, "A/D/H", MOVED_HERE},
+      {1, "A_mv/D/H/chi",     "normal",       2, "A/D/H/chi", MOVED_HERE},
+      {1, "A_mv/D/H/omega",   "normal",       2, "A/D/H/omega", MOVED_HERE},
+      {1, "A_mv/D/H/psi",     "normal",       2, "A/D/H/psi", MOVED_HERE},
+      {1, "A_mv/mu",          "normal",       2, "A/mu", MOVED_HERE},
+      {0}
+    };
+
+    SVN_ERR(check_db_rows(&b, "A_mv", nodes));
+    SVN_ERR(check_db_conflicts(&b, "", NULL));
+  }
+
+  /* Now do the same thing with local obstructions on the edited nodes */
+  SVN_ERR(sbox_wc_update(&b, "", 1));
+  SVN_ERR(sbox_wc_revert(&b, "", svn_depth_infinity));
+  SVN_ERR(sbox_wc_move(&b, "A", "A_mv"));
+
+  SVN_ERR(svn_io_remove_file2(sbox_wc_path(&b, "A_mv/B/E/alpha"), FALSE, pool));
+  SVN_ERR(svn_io_dir_make(sbox_wc_path(&b, "A_mv/B/E/alpha"), APR_OS_DEFAULT,
+                          pool));
+  SVN_ERR(svn_io_dir_remove_nonrecursive(sbox_wc_path(&b, "A_mv/B/F"), pool));
+  SVN_ERR(sbox_file_write(&b, "A_mv/B/F", "F file"));
+
+  SVN_ERR(sbox_wc_update(&b, "", 2));
+  SVN_ERR(sbox_wc_resolve(&b, "A", svn_depth_empty,
+                          svn_wc_conflict_choose_mine_conflict));
+
+  {
+    nodes_row_t nodes[] = {
+      {1, "A_mv",             "normal",       2, "A", MOVED_HERE},
+      {1, "A_mv/B",           "normal",       2, "A/B", MOVED_HERE},
+      {1, "A_mv/B/E",         "normal",       2, "A/B/E", MOVED_HERE},
+      {1, "A_mv/B/E/alpha",   "normal",       2, "A/B/E/alpha", MOVED_HERE},
+      {1, "A_mv/B/E/beta",    "normal",       2, "A/B/E/beta", MOVED_HERE},
+      {1, "A_mv/B/F",         "normal",       2, "A/B/F", MOVED_HERE, "a"},
+      {1, "A_mv/B/lambda",    "normal",       2, "A/B/lambda", MOVED_HERE},
+      {1, "A_mv/C",           "normal",       2, "A/C", MOVED_HERE},
+      {1, "A_mv/D",           "normal",       2, "A/D", MOVED_HERE},
+      {1, "A_mv/D/G",         "normal",       2, "A/D/G", MOVED_HERE},
+      {1, "A_mv/D/G/pi",      "normal",       2, "A/D/G/pi", MOVED_HERE},
+      {1, "A_mv/D/G/rho",     "normal",       2, "A/D/G/rho", MOVED_HERE},
+      {1, "A_mv/D/G/tau",     "normal",       2, "A/D/G/tau", MOVED_HERE},
+      {1, "A_mv/D/gamma",     "normal",       2, "A/D/gamma", MOVED_HERE},
+      {1, "A_mv/D/H",         "normal",       2, "A/D/H", MOVED_HERE},
+      {1, "A_mv/D/H/chi",     "normal",       2, "A/D/H/chi", MOVED_HERE},
+      {1, "A_mv/D/H/omega",   "normal",       2, "A/D/H/omega", MOVED_HERE},
+      {1, "A_mv/D/H/psi",     "normal",       2, "A/D/H/psi", MOVED_HERE},
+      {1, "A_mv/mu",          "normal",       2, "A/mu", MOVED_HERE},
+      {0}
+    };
+    conflict_info_t conflicts[] = {
+      { "A_mv/B/E/alpha", FALSE, FALSE, TRUE },
+      { "A_mv/B/F", FALSE, FALSE, TRUE },
+
+      {0}
+    };
+
+    SVN_ERR(check_db_rows(&b, "A_mv", nodes));
+    SVN_ERR(check_db_conflicts(&b, "", conflicts));
+  }
+
+  return SVN_NO_ERROR;
+}
+
 /* ---------------------------------------------------------------------- */
 /* The list of test functions */
 
@@ -9854,13 +10704,13 @@ static struct svn_test_descriptor_t test
                        "move_replace"),
     SVN_TEST_OPTS_PASS(layered_moved_to,
                        "layered_moved_to"),
-    SVN_TEST_OPTS_XFAIL(update_within_move,
+    SVN_TEST_OPTS_PASS(update_within_move,
                        "update_within_move"),
     SVN_TEST_OPTS_PASS(commit_moved_descendant,
                        "commit_moved_descendant"),
     SVN_TEST_OPTS_XFAIL(commit_moved_away_descendant,
                         "commit_moved_away_descendant"),
-    SVN_TEST_OPTS_XFAIL(finite_move_update_bump,
+    SVN_TEST_OPTS_PASS(finite_move_update_bump,
                        "finite_move_update_bump"),
     SVN_TEST_OPTS_PASS(move_away_delete_update,
                        "move_away_delete_update"),
@@ -9876,7 +10726,7 @@ static struct svn_test_descriptor_t test
                        "new_basemove"),
     SVN_TEST_OPTS_PASS(move_back,
                        "move_back (issue 4302)"),
-    SVN_TEST_OPTS_XFAIL(move_update_subtree,
+    SVN_TEST_OPTS_PASS(move_update_subtree,
                        "move_update_subtree (issue 4232)"),
     SVN_TEST_OPTS_PASS(move_parent_into_child,
                        "move_parent_into_child (issue 4333)"),
@@ -9886,7 +10736,7 @@ static struct svn_test_descriptor_t test
                        "move retract (issue 4336)"),
     SVN_TEST_OPTS_PASS(move_delete_file_externals,
                        "move/delete file externals (issue 4293)"),
-    SVN_TEST_OPTS_XFAIL(update_with_tree_conflict,
+    SVN_TEST_OPTS_PASS(update_with_tree_conflict,
                        "update with tree conflict (issue 4347)"),
     SVN_TEST_OPTS_PASS(move_update_parent_replace,
                        "move update with replaced parent (issue 4388)"),
@@ -9908,24 +10758,38 @@ static struct svn_test_descriptor_t test
                        "del4: delete AAA"),
     SVN_TEST_OPTS_PASS(del4_update_add_AAA,
                        "del4: add AAA"),
+    SVN_TEST_OPTS_PASS(del4_update_replace_AAA,
+                       "del4: replace AAA"),
     SVN_TEST_OPTS_PASS(del4_update_delself_AAA,
                        "del4: delete self AAA"),
+    SVN_TEST_OPTS_XFAIL(del4_update_replaceself_AAA,
+                       "del4: replace self AAA"),
     SVN_TEST_OPTS_PASS(move4_update_edit_AAA,
                        "move4: edit AAA"),
     SVN_TEST_OPTS_PASS(move4_update_delete_AAA,
                        "move4: delete AAA"),
     SVN_TEST_OPTS_PASS(move4_update_add_AAA,
                        "move4: add AAA"),
-    SVN_TEST_OPTS_XFAIL(move4_update_delself_AAA,
+    SVN_TEST_OPTS_PASS(move4_update_replace_AAA,
+                       "move4: replace AAA"),
+    SVN_TEST_OPTS_PASS(move4_update_delself_AAA,
                        "move4: delete self AAA"),
+    SVN_TEST_OPTS_XFAIL(move4_update_replaceself_AAA,
+                       "move4: replace self AAA"),
     SVN_TEST_OPTS_PASS(simple_move_bump,
                        "simple move bump"),
     SVN_TEST_OPTS_PASS(movedhere_extract_retract,
                        "movedhere extract retract"),
     SVN_TEST_OPTS_PASS(repo_wc_copy,
                        "repo_wc_copy"),
-    SVN_TEST_OPTS_XFAIL(break_move_in_delete,
+    SVN_TEST_OPTS_PASS(break_move_in_delete,
                        "break move in delete (issue 4491)"),
+    SVN_TEST_OPTS_PASS(nested_move_delete,
+                       "nested move delete"),
+    SVN_TEST_OPTS_XFAIL(move_within_mixed_move,
+                        "move within mixed move"),
+    SVN_TEST_OPTS_PASS(move_edit_obstruction,
+                       "move edit obstruction"),
     SVN_TEST_NULL
   };
 

Modified: subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/utils.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/utils.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/utils.c (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/utils.c Mon Feb  9 11:23:39 2015
@@ -22,6 +22,7 @@
 
 #include "svn_error.h"
 #include "svn_client.h"
+#include "svn_cmdline.h"
 #include "svn_pools.h"
 
 #include "utils.h"
@@ -33,9 +34,25 @@
 #define SVN_WC__I_AM_WC_DB
 #include "../../libsvn_wc/wc_db_private.h"
 
+svn_error_t *
+svn_test__create_client_ctx(svn_client_ctx_t **ctx,
+                            svn_test__sandbox_t *sbox,
+                            apr_pool_t *result_pool)
+{
+  SVN_ERR(svn_client_create_context2(ctx, NULL, result_pool));
+
+  SVN_ERR(svn_test__init_auth_baton(&(*ctx)->auth_baton,
+                                    result_pool));
+
+  if (sbox)
+    (*ctx)->wc_ctx = sbox->wc_ctx;
+
+  return SVN_NO_ERROR;
+}
 
 /* Create an empty repository and WC for the test TEST_NAME.  Set *REPOS_URL
- * to the URL of the new repository and *WC_ABSPATH to the root path of the
+ * to the URL of the new repository, *REPOS_DIR to its local path and
+ * *WC_ABSPATH to the root path of the
  * new WC.
  *
  * Create the repository and WC in subdirectories called
@@ -45,6 +62,7 @@
  * Register the repo and WC to be cleaned up when the test suite exits. */
 static svn_error_t *
 create_repos_and_wc(const char **repos_url,
+                    const char **repos_dir,
                     const char **wc_abspath,
                     const char *test_name,
                     const svn_test_opts_t *opts,
@@ -65,8 +83,6 @@ create_repos_and_wc(const char **repos_u
 
   /* Create a repos. Register it for clean-up. Set *REPOS_URL to its path. */
   {
-    svn_repos_t *repos;
-
     /* Use a subpool to create the repository and then destroy the subpool
        so the repository's underlying filesystem is closed.  If opts->fs_type
        is BDB this prevents any attempt to open a second environment handle
@@ -74,8 +90,8 @@ create_repos_and_wc(const char **repos_u
        only a single environment handle to be open per process. */
     apr_pool_t *subpool = svn_pool_create(pool);
 
-    SVN_ERR(svn_test__create_repos(&repos, repos_path, opts, subpool));
-    SVN_ERR(svn_uri_get_file_url_from_dirent(repos_url, repos_path, pool));
+    SVN_ERR(svn_test__create_repos2(NULL, repos_url, repos_dir, repos_path,
+                                    opts, pool, subpool));
     svn_pool_destroy(subpool);
   }
 
@@ -85,7 +101,7 @@ create_repos_and_wc(const char **repos_u
     svn_client_ctx_t *ctx;
     svn_opt_revision_t head_rev = { svn_opt_revision_head, {0} };
 
-    SVN_ERR(svn_client_create_context2(&ctx, NULL, subpool));
+    SVN_ERR(svn_test__create_client_ctx(&ctx, NULL, subpool));
     SVN_ERR(svn_dirent_get_absolute(wc_abspath, wc_path, pool));
     SVN_ERR(svn_client_checkout3(NULL, *repos_url, *wc_abspath,
                                  &head_rev, &head_rev, svn_depth_infinity,
@@ -101,7 +117,6 @@ create_repos_and_wc(const char **repos_u
   return SVN_NO_ERROR;
 }
 
-
 WC_QUERIES_SQL_DECLARE_STATEMENTS(statements);
 
 svn_error_t *
@@ -149,19 +164,28 @@ svn_test__sandbox_create(svn_test__sandb
                          apr_pool_t *pool)
 {
   sandbox->pool = pool;
-  SVN_ERR(create_repos_and_wc(&sandbox->repos_url, &sandbox->wc_abspath,
+  SVN_ERR(create_repos_and_wc(&sandbox->repos_url, &sandbox->repos_dir,
+                              &sandbox->wc_abspath,
                               test_name, opts, pool));
   SVN_ERR(svn_wc_context_create(&sandbox->wc_ctx, NULL, pool, pool));
   return SVN_NO_ERROR;
 }
 
-void
+svn_error_t *
 sbox_file_write(svn_test__sandbox_t *b, const char *path, const char *text)
 {
-  FILE *f = fopen(sbox_wc_path(b, path), "w");
+  apr_file_t *f;
+
+  SVN_ERR(svn_io_file_open(&f, sbox_wc_path(b, path),
+                           (APR_WRITE | APR_CREATE | APR_TRUNCATE),
+                           APR_OS_DEFAULT,
+                           b->pool));
+
+  SVN_ERR(svn_io_file_write_full(f, text, strlen(text), NULL, b->pool));
 
-  fputs(text, f);
-  fclose(f);
+  SVN_ERR(svn_io_file_close(f, b->pool));
+
+  return SVN_NO_ERROR;
 }
 
 svn_error_t *
@@ -240,8 +264,7 @@ sbox_wc_copy_url(svn_test__sandbox_t *b,
                                         scratch_pool, 1,
                                         sizeof(svn_client_copy_source_t *));
 
-  SVN_ERR(svn_client_create_context2(&ctx, NULL, scratch_pool));
-  ctx->wc_ctx = b->wc_ctx;
+  SVN_ERR(svn_test__create_client_ctx(&ctx, b, scratch_pool));
 
   if (SVN_IS_VALID_REVNUM(revision))
     {
@@ -282,7 +305,11 @@ sbox_wc_revert(svn_test__sandbox_t *b, c
   SVN_ERR(svn_wc__acquire_write_lock(&lock_root_abspath, b->wc_ctx,
                                      dir_abspath, FALSE /* lock_anchor */,
                                      b->pool, b->pool));
-  SVN_ERR(svn_wc_revert5(b->wc_ctx, abspath, depth, FALSE, NULL, FALSE,
+  SVN_ERR(svn_wc_revert5(b->wc_ctx, abspath, depth,
+                         FALSE /* use_commit_times */,
+                         NULL /* changelist_filter */,
+                         FALSE /* clear_changelists */,
+                         FALSE /* metadata_only */,
                          NULL, NULL, /* cancel baton + func */
                          NULL, NULL, /* notify baton + func */
                          b->pool));
@@ -334,8 +361,7 @@ sbox_wc_commit_ex(svn_test__sandbox_t *b
   apr_pool_t *scratch_pool = svn_pool_create(b->pool);
   svn_error_t *err;
 
-  SVN_ERR(svn_client_create_context2(&ctx, NULL, scratch_pool));
-  ctx->wc_ctx = b->wc_ctx;
+  SVN_ERR(svn_test__create_client_ctx(&ctx, b, scratch_pool));
 
   /* A successfull commit doesn't close the ra session, but leaves that
      to the caller. This leaves the BDB handle open, which might cause
@@ -387,8 +413,8 @@ sbox_wc_update_depth(svn_test__sandbox_t
     }
 
   APR_ARRAY_PUSH(paths, const char *) = sbox_wc_path(b, path);
-  SVN_ERR(svn_client_create_context2(&ctx, NULL, b->pool));
-  ctx->wc_ctx = b->wc_ctx;
+  SVN_ERR(svn_test__create_client_ctx(&ctx, b, b->pool));
+
   return svn_client_update4(&result_revs, paths, &revision, depth,
                             sticky, FALSE, FALSE, FALSE, FALSE,
                             ctx, b->pool);
@@ -412,8 +438,8 @@ sbox_wc_switch(svn_test__sandbox_t *b,
   svn_opt_revision_t head_rev = { svn_opt_revision_head, {0} };
 
   url = apr_pstrcat(b->pool, b->repos_url, url, SVN_VA_NULL);
-  SVN_ERR(svn_client_create_context2(&ctx, NULL, b->pool));
-  ctx->wc_ctx = b->wc_ctx;
+  SVN_ERR(svn_test__create_client_ctx(&ctx, b, b->pool));
+
   return svn_client_switch3(&result_rev, sbox_wc_path(b, path), url,
                             &head_rev, &head_rev, depth,
                             FALSE /* depth_is_sticky */,
@@ -464,8 +490,8 @@ sbox_wc_move(svn_test__sandbox_t *b, con
   apr_array_header_t *paths = apr_array_make(b->pool, 1,
                                              sizeof(const char *));
 
-  SVN_ERR(svn_client_create_context2(&ctx, NULL, b->pool));
-  ctx->wc_ctx = b->wc_ctx;
+  SVN_ERR(svn_test__create_client_ctx(&ctx, b, b->pool));
+
   APR_ARRAY_PUSH(paths, const char *) = sbox_wc_path(b, src);
   return svn_client_move7(paths, sbox_wc_path(b, dst),
                           FALSE /* move_as_child */,
@@ -488,8 +514,8 @@ sbox_wc_propset(svn_test__sandbox_t *b,
                                              sizeof(const char *));
   svn_string_t *pval = value ? svn_string_create(value, b->pool) : NULL;
 
-  SVN_ERR(svn_client_create_context2(&ctx, NULL, b->pool));
-  ctx->wc_ctx = b->wc_ctx;
+  SVN_ERR(svn_test__create_client_ctx(&ctx, b, b->pool));
+
   APR_ARRAY_PUSH(paths, const char *) = sbox_wc_path(b, path);
   return svn_client_propset_local(name, pval, paths, svn_depth_empty,
                                   TRUE /* skip_checks */,
@@ -503,8 +529,7 @@ sbox_wc_relocate(svn_test__sandbox_t *b,
   apr_pool_t *scratch_pool = b->pool;
   svn_client_ctx_t *ctx;
 
-  SVN_ERR(svn_client_create_context2(&ctx, NULL, scratch_pool));
-  ctx->wc_ctx = b->wc_ctx;
+  SVN_ERR(svn_test__create_client_ctx(&ctx, b, scratch_pool));
 
   SVN_ERR(svn_client_relocate2(b->wc_abspath, b->repos_url,
                                new_repos_url, FALSE, ctx,scratch_pool));
@@ -523,7 +548,7 @@ sbox_add_and_commit_greek_tree(svn_test_
     {
       if (node->contents)
         {
-          sbox_file_write(b, node->path, node->contents);
+          SVN_ERR(sbox_file_write(b, node->path, node->contents));
           SVN_ERR(sbox_wc_add(b, node->path));
         }
       else

Modified: subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/utils.h
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/utils.h?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/utils.h (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/libsvn_wc/utils.h Mon Feb  9 11:23:39 2015
@@ -25,6 +25,8 @@
 
 #include <apr_pools.h>
 #include "svn_error.h"
+#include "svn_client.h"
+
 #include "../svn_test.h"
 
 #ifdef __cplusplus
@@ -53,6 +55,8 @@ typedef struct svn_test__sandbox_t
   svn_wc_context_t *wc_ctx;
   /* The repository URL. */
   const char *repos_url;
+  /* Local path to the repository */
+  const char *repos_dir;
   /* The absolute local path of the WC root. */
   const char *wc_abspath;
   /* A pool that can be used for all allocations. */
@@ -83,7 +87,7 @@ svn_test__sandbox_create(svn_test__sandb
           (svn_dirent_join((b)->wc_abspath, (path), (b)->pool))
 
 /* Create a file on disk at PATH, with TEXT as its content. */
-void
+svn_error_t *
 sbox_file_write(svn_test__sandbox_t *b, const char *path, const char *text);
 
 /* Schedule for addition the single node that exists on disk at PATH,
@@ -185,6 +189,13 @@ svn_test__create_fake_wc(const char *wc_
                          apr_pool_t *scratch_pool);
 
 
+/* Create a client context for the specified sandbox */
+svn_error_t *
+svn_test__create_client_ctx(svn_client_ctx_t **ctx,
+                            svn_test__sandbox_t *sbox,
+                            apr_pool_t *result_pool);
+
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/remove-log-addressing/subversion/tests/svn_test.h
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/svn_test.h?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/svn_test.h (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/svn_test.h Mon Feb  9 11:23:39 2015
@@ -34,6 +34,7 @@
 #include "svn_types.h"
 #include "svn_error.h"
 #include "svn_string.h"
+#include "svn_auth.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -117,12 +118,20 @@ extern "C" {
  */
 typedef struct svn_test_opts_t
 {
+  /* The name of the application (to generate unique names) */
+  const char *prog_name;
   /* Description of the fs backend that should be used for testing. */
   const char *fs_type;
   /* Config file. */
   const char *config_file;
   /* Source dir. */
   const char *srcdir;
+  /* Repository dir: temporary directory to create repositories in as subdir */
+  const char *repos_dir;
+  /* Repository url: The url to access REPOS_DIR as */
+  const char *repos_url;
+  /* Repository template: pre-created repository to copy for tests */
+  const char *repos_template;
   /* Minor version to use for servers and FS backends, or zero to use
      the current latest version. */
   int server_minor_version;
@@ -269,6 +278,11 @@ svn_test_get_srcdir(const char **srcdir,
                     const svn_test_opts_t *opts,
                     apr_pool_t *pool);
 
+/* Initializes a standard auth baton for accessing the repositories */
+svn_error_t *
+svn_test__init_auth_baton(svn_auth_baton_t **baton,
+                          apr_pool_t *result_pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/remove-log-addressing/subversion/tests/svn_test_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/svn_test_fs.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/svn_test_fs.c (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/svn_test_fs.c Mon Feb  9 11:23:39 2015
@@ -212,42 +212,115 @@ svn_test__create_fs(svn_fs_t **fs_p,
 }
 
 svn_error_t *
-svn_test__create_repos(svn_repos_t **repos_p,
-                       const char *name,
-                       const svn_test_opts_t *opts,
-                       apr_pool_t *pool)
+svn_test__create_repos2(svn_repos_t **repos_p,
+                        const char **repos_url,
+                        const char **repos_dirent,
+                        const char *name,
+                        const svn_test_opts_t *opts,
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool)
 {
   svn_repos_t *repos;
   svn_boolean_t must_reopen;
+  const char *repos_abspath;
+  apr_pool_t *repos_pool = repos_p ? result_pool : scratch_pool;
+  svn_boolean_t init_svnserve = FALSE;
   apr_hash_t *fs_config = make_fs_config(opts->fs_type,
-                                         opts->server_minor_version, pool);
+                                         opts->server_minor_version,
+                                         repos_pool);
+
+  if (repos_url && opts->repos_dir && opts->repos_url)
+    {
+      name = apr_psprintf(scratch_pool, "%s-%s", opts->prog_name,
+                          svn_dirent_basename(name, NULL));
+
+      repos_abspath = svn_dirent_join(opts->repos_dir, name, scratch_pool);
+
+      SVN_ERR(svn_dirent_get_absolute(&repos_abspath, repos_abspath,
+                                      scratch_pool));
+
+      SVN_ERR(svn_io_make_dir_recursively(repos_abspath, scratch_pool));
+
+      *repos_url = svn_path_url_add_component2(opts->repos_url, name,
+                                               result_pool);
+
+      if (strstr(opts->repos_url, "svn://"))
+        init_svnserve = TRUE;
+    }
+  else
+    {
+      SVN_ERR(svn_dirent_get_absolute(&repos_abspath, name, scratch_pool));
+
+      if (repos_url)
+        SVN_ERR(svn_uri_get_file_url_from_dirent(repos_url, repos_abspath,
+                                                 result_pool));
+    }
 
   /* If there's already a repository named NAME, delete it.  Doing
      things this way means that repositories stick around after a
      failure for postmortem analysis, but also that tests can be
      re-run without cleaning out the repositories created by prior
      runs.  */
-  SVN_ERR(svn_io_remove_dir2(name, TRUE, NULL, NULL, pool));
+  SVN_ERR(svn_io_remove_dir2(repos_abspath, TRUE, NULL, NULL, scratch_pool));
 
-  SVN_ERR(svn_repos_create(&repos, name, NULL, NULL, NULL,
-                           fs_config, pool));
+  SVN_ERR(svn_repos_create(&repos, repos_abspath, NULL, NULL, NULL,
+                           fs_config, repos_pool));
 
   /* Register this repo for cleanup. */
-  svn_test_add_dir_cleanup(name);
+  svn_test_add_dir_cleanup(repos_abspath);
 
   SVN_ERR(maybe_install_fs_conf(svn_repos_fs(repos), opts, &must_reopen,
-                                pool));
+                                scratch_pool));
   if (must_reopen)
     {
-      SVN_ERR(svn_repos_open3(&repos, name, NULL, pool, pool));
-      svn_fs_set_warning_func(svn_repos_fs(repos), fs_warning_handler, NULL);
+      SVN_ERR(svn_repos_open3(&repos, repos_abspath, NULL, repos_pool,
+                              scratch_pool));
     }
 
-  *repos_p = repos;
+  svn_fs_set_warning_func(svn_repos_fs(repos), fs_warning_handler, NULL);
+
+  if (init_svnserve)
+    {
+      const char *cfg;
+      const char *pwd;
+
+      cfg = svn_dirent_join(repos_abspath, "conf/svnserve.conf", scratch_pool);
+      SVN_ERR(svn_io_remove_file2(cfg, FALSE, scratch_pool));
+      SVN_ERR(svn_io_file_create(cfg,
+                                 "[general]\n"
+                                 "auth-access = write\n"
+                                 "password-db = passwd\n",
+                                 scratch_pool));
+
+      pwd = svn_dirent_join(repos_abspath, "conf/passwd", scratch_pool);
+      SVN_ERR(svn_io_remove_file2(pwd, FALSE, scratch_pool));
+      SVN_ERR(svn_io_file_create(pwd,
+                                 "[users]\n"
+                                 "jrandom = rayjandom\n"
+                                 "jconstant = rayjandom\n",
+                                 scratch_pool));
+    }
+
+  if (repos_p)
+    *repos_p = repos;
+  if (repos_dirent)
+    *repos_dirent = apr_pstrdup(result_pool, repos_abspath);
+
   return SVN_NO_ERROR;
 }
 
 svn_error_t *
+svn_test__create_repos(svn_repos_t **repos_p,
+                       const char *name,
+                       const svn_test_opts_t *opts,
+                       apr_pool_t *pool)
+{
+  return svn_error_trace(
+            svn_test__create_repos2(repos_p, NULL, NULL, name,
+                                    opts, pool, pool));
+}
+
+svn_error_t *
 svn_test__stream_to_string(svn_stringbuf_t **string,
                            svn_stream_t *stream,
                            apr_pool_t *pool)

Modified: subversion/branches/remove-log-addressing/subversion/tests/svn_test_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/svn_test_fs.h?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/svn_test_fs.h (original)
+++ subversion/branches/remove-log-addressing/subversion/tests/svn_test_fs.h Mon Feb  9 11:23:39 2015
@@ -82,6 +82,19 @@ svn_test__create_repos(svn_repos_t **rep
                        const svn_test_opts_t *opts,
                        apr_pool_t *pool);
 
+/* Create a repository with a filesystem based on OPTS in a subdir NAME
+   and return optionally new REPOS object, the directory it was created in
+   and/or the url of the repository .  */
+svn_error_t *
+svn_test__create_repos2(svn_repos_t **repos_p,
+                        const char **repos_url,
+                        const char **repos_dirent,
+                        const char *name,
+                        const svn_test_opts_t *opts,
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool);
+
+
 /* Read all data from a generic read STREAM, and return it in STRING.
    Allocate the svn_stringbuf_t in POOL.  (All data in STRING will be
    dup'ed from STREAM using POOL too.) */



Mime
View raw message