subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1455881 - in /subversion/trunk/subversion: libsvn_wc/wc_db_update_move.c tests/libsvn_wc/op-depth-test.c tests/libsvn_wc/utils.c tests/libsvn_wc/utils.h
Date Wed, 13 Mar 2013 10:55:01 GMT
Author: rhuijben
Date: Wed Mar 13 10:55:01 2013
New Revision: 1455881

URL: http://svn.apache.org/r1455881
Log:
Add initial regression test playing with depth expansion during update/move
handling. This somehow caused a segfault.

The scenarios that I intended to test here looks a lot like the cases that
would needed to be handled for mixed revision moves, but I didn't get that
far.

* subversion/libsvn_wc/wc_db_update_move.c
  (mark_tree_conflict): Add assertion right before the segfault.

* subversion/tests/libsvn_wc/op-depth-test.c
  (finite_move_update_bump): Update caller.
  (move_depth_expand): New function.
  (test_list): Add move_depth_expand as XFail.

* subversion/tests/libsvn_wc/utils.c
  (sbox_wc_update_depth): Add argument (equivalent to --set-depth)
  (sbox_wc_update): Update caller. Pass depth unknown, like 'svn' does.

* subversion/tests/libsvn_wc/utils.h
  (sbox_wc_update_depth): Add argument.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c
    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/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c?rev=1455881&r1=1455880&r2=1455881&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c Wed Mar 13 10:55:01 2013
@@ -326,6 +326,7 @@ mark_tree_conflict(const char *local_rel
 
   if (reason != svn_wc_conflict_reason_unversioned)
     {
+      SVN_ERR_ASSERT(old_repos_relpath != NULL);
       conflict_old_version = svn_wc_conflict_version_create2(
                                old_version->repos_url, old_version->repos_uuid,
                                old_repos_relpath, old_version->peg_rev,

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=1455881&r1=1455880&r2=1455881&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Wed Mar 13 10:55:01 2013
@@ -6634,8 +6634,8 @@ finite_move_update_bump(const svn_test_o
   SVN_ERR(sbox_wc_update(&b, "", 1));
   SVN_ERR(sbox_wc_move(&b, "A/B", "B2"));
   SVN_ERR(sbox_wc_move(&b, "P/Q", "Q2"));
-  SVN_ERR(sbox_wc_update_depth(&b, "A/B", 2, svn_depth_files));
-  SVN_ERR(sbox_wc_update_depth(&b, "P/Q", 2, svn_depth_files));
+  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));
   err = sbox_wc_resolve(&b, "A/B", svn_depth_empty,
                         svn_wc_conflict_choose_mine_conflict);
@@ -6666,8 +6666,8 @@ finite_move_update_bump(const svn_test_o
   SVN_ERR(sbox_wc_update(&b, "", 1));
   SVN_ERR(sbox_wc_move(&b, "A/B", "B2"));
   SVN_ERR(sbox_wc_move(&b, "P", "P2"));
-  SVN_ERR(sbox_wc_update_depth(&b, "A/B", 2, svn_depth_immediates));
-  SVN_ERR(sbox_wc_update_depth(&b, "P", 2, svn_depth_immediates));
+  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));
   err = sbox_wc_resolve(&b, "P", svn_depth_empty,
                         svn_wc_conflict_choose_mine_conflict);
@@ -6700,8 +6700,8 @@ finite_move_update_bump(const svn_test_o
   SVN_ERR(sbox_wc_update(&b, "", 1));
   SVN_ERR(sbox_wc_move(&b, "A/B/C", "C2"));
   SVN_ERR(sbox_wc_move(&b, "P/Q", "Q2"));
-  SVN_ERR(sbox_wc_update_depth(&b, "A/B/C", 2, svn_depth_empty));
-  SVN_ERR(sbox_wc_update_depth(&b, "P/Q", 2, svn_depth_empty));
+  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));
   err = sbox_wc_resolve(&b, "P/Q", svn_depth_empty,
                         svn_wc_conflict_choose_mine_conflict);
@@ -7672,6 +7672,43 @@ move_parent_into_child(const svn_test_op
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+move_depth_expand(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+  svn_test__sandbox_t b;
+
+  SVN_ERR(svn_test__sandbox_create(&b, "move_depth_expand", opts, pool));
+  SVN_ERR(sbox_wc_mkdir(&b, "A"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/A"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/A/A"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/A/A/A"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/A/A/A/A"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/A/A/A/A/A"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+  SVN_ERR(sbox_wc_update(&b, "", 0));
+
+  SVN_ERR(sbox_wc_update_depth(&b, "", 1, svn_depth_immediates, FALSE));
+  SVN_ERR(sbox_wc_update_depth(&b, "A", 1, svn_depth_immediates, FALSE));
+
+  SVN_ERR(sbox_wc_move(&b, "A", "C"));
+  SVN_ERR(sbox_wc_mkdir(&b, "C/A/A"));
+
+  SVN_ERR(sbox_wc_update_depth(&b, "", 1, svn_depth_infinity, TRUE));
+
+  /* This causes a segfault */
+  SVN_ERR(sbox_wc_resolve(&b, "A", svn_depth_empty,
+                          svn_wc_conflict_choose_mine_conflict));
+
+  /*{
+    nodes_row_t nodes[] = {
+      // TODO
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }*/
+
+  return SVN_NO_ERROR;
+}
 
 /* ---------------------------------------------------------------------- */
 /* The list of test functions */
@@ -7818,5 +7855,7 @@ struct svn_test_descriptor_t test_funcs[
                        "move_update_subtree (issue 4232)"),
     SVN_TEST_OPTS_PASS(move_parent_into_child,
                        "move_parent_into_child (issue 4333)"),
+    SVN_TEST_OPTS_XFAIL(move_depth_expand,
+                       "move depth expansion"),
     SVN_TEST_NULL
   };

Modified: subversion/trunk/subversion/tests/libsvn_wc/utils.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/utils.c?rev=1455881&r1=1455880&r2=1455881&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/utils.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/utils.c Wed Mar 13 10:55:01 2013
@@ -317,7 +317,8 @@ svn_error_t *
 sbox_wc_update_depth(svn_test__sandbox_t *b,
                      const char *path,
                      svn_revnum_t revnum,
-                     svn_depth_t depth)
+                     svn_depth_t depth,
+                     svn_boolean_t sticky)
 {
   svn_client_ctx_t *ctx;
   apr_array_header_t *result_revs;
@@ -332,14 +333,14 @@ sbox_wc_update_depth(svn_test__sandbox_t
   SVN_ERR(svn_client_create_context2(&ctx, NULL, b->pool));
   ctx->wc_ctx = b->wc_ctx;
   return svn_client_update4(&result_revs, paths, &revision, depth,
-                            FALSE, FALSE, FALSE, FALSE, FALSE,
+                            TRUE, FALSE, FALSE, FALSE, FALSE,
                             ctx, b->pool);
 }
 
 svn_error_t *
 sbox_wc_update(svn_test__sandbox_t *b, const char *path, svn_revnum_t revnum)
 {
-  SVN_ERR(sbox_wc_update_depth(b, path, revnum, svn_depth_infinity));
+  SVN_ERR(sbox_wc_update_depth(b, path, revnum, svn_depth_unknown, FALSE));
   return SVN_NO_ERROR;
 }
 

Modified: subversion/trunk/subversion/tests/libsvn_wc/utils.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/utils.h?rev=1455881&r1=1455880&r2=1455881&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/utils.h (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/utils.h Wed Mar 13 10:55:01 2013
@@ -134,7 +134,8 @@ svn_error_t *
 sbox_wc_update_depth(svn_test__sandbox_t *b,
                      const char *path,
                      svn_revnum_t revnum,
-                     svn_depth_t depth);
+                     svn_depth_t depth,
+                     svn_boolean_t sticky);
 
 svn_error_t *
 sbox_wc_switch(svn_test__sandbox_t *b,



Mime
View raw message