subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1454408 - in /subversion/trunk/subversion/tests/libsvn_wc: op-depth-test.c utils.c utils.h
Date Fri, 08 Mar 2013 14:39:06 GMT
Author: philip
Date: Fri Mar  8 14:39:06 2013
New Revision: 1454408

URL: http://svn.apache.org/r1454408
Log:
Add more cases to a move-update test.

* subversion/tests/libsvn_wc/utils.h
* subversion/tests/libsvn_wc/utils.c
  (sbox_wc_switch): Add path and depth parameters.

* subversion/tests/libsvn_wc/op-depth-test.c
  (move_update_conflicts, switch_move, move_back): Adjust switch call.
  (move_update_subtree): Extend to test switch and bump.

Modified:
    subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
    subversion/trunk/subversion/tests/libsvn_wc/utils.c
    subversion/trunk/subversion/tests/libsvn_wc/utils.h

Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=1454408&r1=1454407&r2=1454408&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Fri Mar  8 14:39:06 2013
@@ -5653,7 +5653,7 @@ move_update_conflicts(const svn_test_opt
   SVN_ERR(sbox_wc_mkdir(&b, "X/A/B/C/D/E"));
   SVN_ERR(sbox_wc_mkdir(&b, "X/A/B/F"));
   SVN_ERR(sbox_wc_commit(&b, ""));
-  SVN_ERR(sbox_wc_switch(&b, "/X"));
+  SVN_ERR(sbox_wc_switch(&b, "", "/X", svn_depth_infinity));
   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"));
@@ -6001,7 +6001,7 @@ switch_move(const svn_test_opts_t *opts,
   SVN_ERR(sbox_wc_commit(&b, ""));
   SVN_ERR(sbox_wc_mkdir(&b, "X/B/D/E/F"));
   SVN_ERR(sbox_wc_commit(&b, ""));
-  SVN_ERR(sbox_wc_switch(&b, "/A"));
+  SVN_ERR(sbox_wc_switch(&b, "", "/A", svn_depth_infinity));
   SVN_ERR(sbox_wc_update(&b, "", 2));
 
   SVN_ERR(sbox_wc_move(&b, "B/C", "C2"));
@@ -6029,7 +6029,7 @@ switch_move(const svn_test_opts_t *opts,
 
   /* Switch "bumps" revisions and paths and raises conflicts just like
      update. */
-  SVN_ERR(sbox_wc_switch(&b, "/X"));
+  SVN_ERR(sbox_wc_switch(&b, "", "/X", svn_depth_infinity));
   {
     nodes_row_t nodes[] = {
       {0, "",        "normal",       3, "X"},
@@ -7299,7 +7299,7 @@ move_back(const svn_test_opts_t *opts, a
   SVN_ERR(sbox_wc_mkdir(&b, "X/A/B/D"));
   SVN_ERR(sbox_wc_mkdir(&b, "X/E"));
   SVN_ERR(sbox_wc_commit(&b, ""));
-  SVN_ERR(sbox_wc_switch(&b, "/X"));
+  SVN_ERR(sbox_wc_switch(&b, "", "/X", svn_depth_infinity));
 
   SVN_ERR(sbox_wc_move(&b, "A/B", "A/B2"));
   {
@@ -7399,6 +7399,11 @@ move_update_subtree(const svn_test_opts_
   SVN_ERR(sbox_wc_commit(&b, ""));
   SVN_ERR(sbox_wc_mkdir(&b, "A/B/C/D"));
   SVN_ERR(sbox_wc_commit(&b, ""));
+  SVN_ERR(sbox_wc_mkdir(&b, "X"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+  SVN_ERR(sbox_wc_update(&b, "", 3));
+  SVN_ERR(sbox_wc_copy(&b, "A", "P"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
   SVN_ERR(sbox_wc_update(&b, "", 1));
 
   /* Subtree update is like an interrupted update, it leaves a
@@ -7468,6 +7473,138 @@ move_update_subtree(const svn_test_opts_
     SVN_ERR(check_db_rows(&b, "", nodes));
   }
 
+  /* Subtree update that only bumps. */
+  SVN_ERR(sbox_wc_update(&b, "A/B/C", 3));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",         "normal",       1, ""},
+      {0, "A",        "normal",       1, "A"},
+      {0, "A/B",      "normal",       2, "A/B"},
+      {0, "A/B/C",    "normal",       3, "A/B/C"},
+      {0, "A/B/C/D",  "normal",       3, "A/B/C/D"},
+      {2, "A/B",      "base-deleted", NO_COPY_FROM, "A/B2"},
+      {2, "A/B/C",    "base-deleted", NO_COPY_FROM},
+      {2, "A/B/C/D",  "base-deleted", NO_COPY_FROM},
+      {2, "A/B2",     "normal",       2, "A/B", MOVED_HERE},
+      {2, "A/B2/C",   "normal",       2, "A/B/C", MOVED_HERE},
+      {2, "A/B2/C/D", "normal",       2, "A/B/C/D", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  /* Resolve fails because of the mixed-revision. */
+  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);
+
+  /* Update allowed while tree-conflict is present. */
+  SVN_ERR(sbox_wc_update(&b, "A/B", 3));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",         "normal",       1, ""},
+      {0, "A",        "normal",       1, "A"},
+      {0, "A/B",      "normal",       3, "A/B"},
+      {0, "A/B/C",    "normal",       3, "A/B/C"},
+      {0, "A/B/C/D",  "normal",       3, "A/B/C/D"},
+      {2, "A/B",      "base-deleted", NO_COPY_FROM, "A/B2"},
+      {2, "A/B/C",    "base-deleted", NO_COPY_FROM},
+      {2, "A/B/C/D",  "base-deleted", NO_COPY_FROM},
+      {2, "A/B2",     "normal",       2, "A/B", MOVED_HERE},
+      {2, "A/B2/C",   "normal",       2, "A/B/C", MOVED_HERE},
+      {2, "A/B2/C/D", "normal",       2, "A/B/C/D", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  /* Now resolve works. */
+  SVN_ERR(sbox_wc_resolve(&b, "A/B", svn_depth_empty,
+                          svn_wc_conflict_choose_mine_conflict));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",         "normal",       1, ""},
+      {0, "A",        "normal",       1, "A"},
+      {0, "A/B",      "normal",       3, "A/B"},
+      {0, "A/B/C",    "normal",       3, "A/B/C"},
+      {0, "A/B/C/D",  "normal",       3, "A/B/C/D"},
+      {2, "A/B",      "base-deleted", NO_COPY_FROM, "A/B2"},
+      {2, "A/B/C",    "base-deleted", NO_COPY_FROM},
+      {2, "A/B/C/D",  "base-deleted", NO_COPY_FROM},
+      {2, "A/B2",     "normal",       3, "A/B", MOVED_HERE},
+      {2, "A/B2/C",   "normal",       3, "A/B/C", MOVED_HERE},
+      {2, "A/B2/C/D", "normal",       3, "A/B/C/D", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  /* Partial switch of source. */
+  SVN_ERR(sbox_wc_switch(&b, "A", "/P", svn_depth_immediates));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",         "normal",       1, ""},
+      {0, "A",        "normal",       4, "P"},
+      {0, "A/B",      "normal",       4, "P/B"},
+      {0, "A/B/C",    "normal",       3, "A/B/C"},
+      {0, "A/B/C/D",  "normal",       3, "A/B/C/D"},
+      {2, "A/B",      "base-deleted", NO_COPY_FROM, "A/B2"},
+      {2, "A/B/C",    "base-deleted", NO_COPY_FROM},
+      {2, "A/B/C/D",  "base-deleted", NO_COPY_FROM},
+      {2, "A/B2",     "normal",       3, "A/B", MOVED_HERE},
+      {2, "A/B2/C",   "normal",       3, "A/B/C", MOVED_HERE},
+      {2, "A/B2/C/D", "normal",       3, "A/B/C/D", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  /* Resolve fails because of the subtree-switch. */
+  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);
+
+  /* Switch works while tree-conflict is present. */
+  SVN_ERR(sbox_wc_switch(&b, "A", "/P", svn_depth_infinity));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",         "normal",       1, ""},
+      {0, "A",        "normal",       4, "P"},
+      {0, "A/B",      "normal",       4, "P/B"},
+      {0, "A/B/C",    "normal",       4, "P/B/C"},
+      {0, "A/B/C/D",  "normal",       4, "P/B/C/D"},
+      {2, "A/B",      "base-deleted", NO_COPY_FROM, "A/B2"},
+      {2, "A/B/C",    "base-deleted", NO_COPY_FROM},
+      {2, "A/B/C/D",  "base-deleted", NO_COPY_FROM},
+      {2, "A/B2",     "normal",       3, "A/B", MOVED_HERE},
+      {2, "A/B2/C",   "normal",       3, "A/B/C", MOVED_HERE},
+      {2, "A/B2/C/D", "normal",       3, "A/B/C/D", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  /* Now resolve works. */
+  SVN_ERR(sbox_wc_resolve(&b, "A/B", svn_depth_empty,
+                          svn_wc_conflict_choose_mine_conflict));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",         "normal",       1, ""},
+      {0, "A",        "normal",       4, "P"},
+      {0, "A/B",      "normal",       4, "P/B"},
+      {0, "A/B/C",    "normal",       4, "P/B/C"},
+      {0, "A/B/C/D",  "normal",       4, "P/B/C/D"},
+      {2, "A/B",      "base-deleted", NO_COPY_FROM, "A/B2"},
+      {2, "A/B/C",    "base-deleted", NO_COPY_FROM},
+      {2, "A/B/C/D",  "base-deleted", NO_COPY_FROM},
+      {2, "A/B2",     "normal",       4, "P/B", MOVED_HERE},
+      {2, "A/B2/C",   "normal",       4, "P/B/C", MOVED_HERE},
+      {2, "A/B2/C/D", "normal",       4, "P/B/C/D", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
   return SVN_NO_ERROR;
 }
 

Modified: subversion/trunk/subversion/tests/libsvn_wc/utils.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/utils.c?rev=1454408&r1=1454407&r2=1454408&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/utils.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/utils.c Fri Mar  8 14:39:06 2013
@@ -344,7 +344,10 @@ sbox_wc_update(svn_test__sandbox_t *b, c
 }
 
 svn_error_t *
-sbox_wc_switch(svn_test__sandbox_t *b, const char *url)
+sbox_wc_switch(svn_test__sandbox_t *b,
+               const char *path,
+               const char *url,
+               svn_depth_t depth)
 {
   svn_client_ctx_t *ctx;
   svn_revnum_t result_rev;
@@ -353,8 +356,8 @@ sbox_wc_switch(svn_test__sandbox_t *b, c
   url = apr_pstrcat(b->pool, b->repos_url, url, (char*)NULL);
   SVN_ERR(svn_client_create_context2(&ctx, NULL, b->pool));
   ctx->wc_ctx = b->wc_ctx;
-  return svn_client_switch3(&result_rev, sbox_wc_path(b, ""), url,
-                            &head_rev, &head_rev, svn_depth_infinity,
+  return svn_client_switch3(&result_rev, sbox_wc_path(b, path), url,
+                            &head_rev, &head_rev, depth,
                             FALSE /* depth_is_sticky */,
                             TRUE /* ignore_externals */,
                             FALSE /* allow_unver_obstructions */,

Modified: subversion/trunk/subversion/tests/libsvn_wc/utils.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/utils.h?rev=1454408&r1=1454407&r2=1454408&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/utils.h (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/utils.h Fri Mar  8 14:39:06 2013
@@ -137,7 +137,10 @@ sbox_wc_update_depth(svn_test__sandbox_t
                      svn_depth_t depth);
 
 svn_error_t *
-sbox_wc_switch(svn_test__sandbox_t *b, const char *url);
+sbox_wc_switch(svn_test__sandbox_t *b,
+               const char *path,
+               const char *url,
+               svn_depth_t depth);
 
 /* */
 svn_error_t *



Mime
View raw message