You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2010/11/03 10:29:35 UTC

svn commit: r1030374 - /subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c

Author: philip
Date: Wed Nov  3 09:29:34 2010
New Revision: 1030374

URL: http://svn.apache.org/viewvc?rev=1030374&view=rev
Log:
Test delete with presence=not-present base node.

* subversion/tests/libsvn_wc/op-depth-test.c
  (wc_commit): New, implementation from...
  (add_and_commit_greek_tree): ...here, call wc_commit.
  (test_deletes_with_base): Extend test to not-present base node.

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

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=1030374&r1=1030373&r2=1030374&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Wed Nov  3 09:29:34 2010
@@ -186,6 +186,20 @@ wc_delete(wc_baton_t *b, const char *pat
                         b->pool);
 }
 
+static svn_error_t *
+wc_commit(wc_baton_t *b, const char *path)
+{
+  svn_client_ctx_t *ctx;
+  apr_array_header_t *targets = apr_array_make(b->pool, 1,
+                                               sizeof(const char *));
+
+  APR_ARRAY_PUSH(targets, const char *) = wc_path(b, path);
+  SVN_ERR(svn_client_create_context(&ctx, b->pool));
+  return svn_client_commit5(targets, svn_depth_infinity,
+                            FALSE, FALSE, /* keep locks/cl's */
+                            NULL, NULL, NULL, NULL, ctx, b->pool);
+}
+
 /* Create the Greek tree on disk in the WC, and commit it. */
 static svn_error_t *
 add_and_commit_greek_tree(wc_baton_t *b)
@@ -227,17 +241,7 @@ add_and_commit_greek_tree(wc_baton_t *b)
       SVN_ERR(wc_add(b, greek_tree_files[i][0]));
     }
 
-  {
-    svn_client_ctx_t *ctx;
-    apr_array_header_t *targets = apr_array_make(b->pool, 1,
-                                                 sizeof(const char *));
-
-    APR_ARRAY_PUSH(targets, const char *) = wc_path(b, "");
-    SVN_ERR(svn_client_create_context(&ctx, b->pool));
-    SVN_ERR(svn_client_commit5(targets, svn_depth_infinity,
-                               FALSE, FALSE, /* keep locks/cl's */
-                               NULL, NULL, NULL, NULL, ctx, b->pool));
-  }
+  SVN_ERR(wc_commit(b, ""));
 
   return SVN_NO_ERROR;
 }
@@ -747,6 +751,8 @@ test_delete_with_base(const svn_test_opt
                                         "deletes_with_base", opts, pool));
   SVN_ERR(svn_wc_context_create(&b.wc_ctx, NULL, pool, pool));
   SVN_ERR(add_and_commit_greek_tree(&b));
+  SVN_ERR(wc_delete(&b, "A/B/E/beta"));
+  SVN_ERR(wc_commit(&b, ""));
 
   SVN_ERR(svn_wc_delete4(b.wc_ctx, wc_path(&b, "A/B/E"),
                          FALSE, TRUE, NULL, NULL, NULL, NULL, pool));
@@ -754,10 +760,9 @@ test_delete_with_base(const svn_test_opt
     nodes_row_t rows[] = {
       { 0, "A/B/E",       "normal",        1, "A/B/E"},
       { 0, "A/B/E/alpha", "normal",        1, "A/B/E/alpha"},
-      { 0, "A/B/E/beta",  "normal",        1, "A/B/E/beta"},
+      { 0, "A/B/E/beta",  "not-present",   2, "A/B/E/beta"},
       { 3, "A/B/E",       "base-deleted",  NO_COPY_FROM},
       { 3, "A/B/E/alpha", "base-deleted",  NO_COPY_FROM},
-      { 3, "A/B/E/beta",  "base-deleted",  NO_COPY_FROM},
       { 0 }
     };
     SVN_ERR(check_db_rows(&b, "A/B/E", rows));
@@ -765,16 +770,17 @@ test_delete_with_base(const svn_test_opt
 
   SVN_ERR(wc_copy(&b, "A/B/F", "A/B/E"));
   SVN_ERR(wc_copy(&b, "A/mu",  "A/B/E/alpha"));
+  SVN_ERR(wc_copy(&b, "A/mu",  "A/B/E/beta"));
   {
     nodes_row_t rows[] = {
       { 0, "A/B/E",       "normal",        1, "A/B/E"},
       { 0, "A/B/E/alpha", "normal",        1, "A/B/E/alpha"},
-      { 0, "A/B/E/beta",  "normal",        1, "A/B/E/beta"},
+      { 0, "A/B/E/beta",  "not-present",   2, "A/B/E/beta"},
       { 3, "A/B/E",       "base-deleted",  NO_COPY_FROM},
       { 3, "A/B/E/alpha", "base-deleted",  NO_COPY_FROM},
-      { 3, "A/B/E/beta",  "base-deleted",  NO_COPY_FROM},
       { 3, "A/B/E",       "normal",        1, "A/B/F"},
       { 4, "A/B/E/alpha", "normal",        1, "A/mu"},
+      { 4, "A/B/E/beta",  "normal",        1, "A/mu"},
       { 0 }
     };
     SVN_ERR(check_db_rows(&b, "A/B/E", rows));
@@ -786,10 +792,9 @@ test_delete_with_base(const svn_test_opt
     nodes_row_t rows[] = {
       { 0, "A/B/E",       "normal",        1, "A/B/E"},
       { 0, "A/B/E/alpha", "normal",        1, "A/B/E/alpha"},
-      { 0, "A/B/E/beta",  "normal",        1, "A/B/E/beta"},
+      { 0, "A/B/E/beta",  "not-present",   2, "A/B/E/beta"},
       { 3, "A/B/E",       "base-deleted",  NO_COPY_FROM},
       { 3, "A/B/E/alpha", "base-deleted",  NO_COPY_FROM},
-      { 3, "A/B/E/beta",  "base-deleted",  NO_COPY_FROM},
       { 0 }
     };
     SVN_ERR(check_db_rows(&b, "A/B/E", rows));