You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/04/08 00:42:02 UTC

svn commit: r1090053 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c tests/cmdline/update_tests.py tests/libsvn_wc/op-depth-test.c

Author: rhuijben
Date: Thu Apr  7 22:42:01 2011
New Revision: 1090053

URL: http://svn.apache.org/viewvc?rev=1090053&view=rev
Log:
Following up on r1089903, fix issue #3334 in a better way.

After this patch the make_copy operation just introduces a copy layer below,
a possible working layer. This fixes cases where deletes broke the tree and
fixes the issue #3334 test that verified that a direct copy and a copy made
via make_copy behave in the same way.

This patch fixes the behavior for these tests, but doesn't produce a proper
mixed revision copy yet.

* subversion/libsvn_wc/wc_db.c
  (make_copy_txn): Update schema. Fetch op_depth and only apply deleted
    transformations when we are changing existing rows.
    (Currently this happens never, but it will when we create a proper mixed
     revision copy).

* subversion/tests/cmdline/update_tests.py
  (tree_conflict_uc2_schedule_re_add): Remove XFail marking.

* subversion/tests/libsvn_wc/op-depth-test.c
  (test_temp_op_make_copy): Update expected results to assume higher layers
    don't change when a copy is added below them.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/tests/cmdline/update_tests.py
    subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1090053&r1=1090052&r2=1090053&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Apr  7 22:42:01 2011
@@ -9497,7 +9497,7 @@ struct make_copy_baton_t
     /     normal          -
     A     normal          -
     A/B   normal          -         normal
-    A/B/C normal          -         normal
+    A/B/C normal          -         base-del       normal
     A/F   normal          -         normal
     A/F/G normal          -         normal
     A/F/H normal          -         base-deleted   normal
@@ -9505,23 +9505,20 @@ struct make_copy_baton_t
     A/X   normal          -
     A/X/Y incomplete      -
 
-    This function copies the tree for A from op_depth=0, into the
-    working op_depth of A, i.e. 1, then marks as base-deleted any
-    subtrees in that op_depth that are below higher op_depth, and
-    finally removes base-deleted nodes from higher op_depth.
+    This function adds layers to A and some of its descendants in an attempt
+    to make the working copy look like as if it were a copy of the BASE nodes.
 
              0            1              2            3
-    /     normal          -
-    A     normal       normal
-    A/B   normal       base-deleted   normal
-    A/B/C normal       base-deleted   normal
-    A/F   normal       base-deleted   normal
-    A/F/G normal       base-deleted   normal
-    A/F/H normal       base-deleted                   normal
-    A/F/E normal       base-deleted   not-present
-    A/X   normal       normal
-    A/X/Y incomplete   incomplete
-
+    /     normal        -
+    A     normal        norm
+    A/B   normal        norm        norm
+    A/B/C normal        norm        base-del       normal
+    A/F   normal        norm        norm
+    A/F/G normal        norm        norm
+    A/F/H normal        norm        not-pres
+    A/F/E normal        norm        base-del
+    A/X   normal        norm
+    A/X/Y incomplete  incomplete
  */
 static svn_error_t *
 make_copy_txn(void *baton,
@@ -9546,8 +9543,10 @@ make_copy_txn(void *baton,
   if (have_row)
     {
       svn_wc__db_status_t working_status;
+      apr_int64_t working_op_depth;
 
       working_status = svn_sqlite__column_token(stmt, 1, presence_map);
+      working_op_depth = svn_sqlite__column_int64(stmt, 0);
       SVN_ERR(svn_sqlite__reset(stmt));
 
       SVN_ERR_ASSERT(working_status == svn_wc__db_status_normal
@@ -9555,11 +9554,15 @@ make_copy_txn(void *baton,
                      || working_status == svn_wc__db_status_not_present
                      || working_status == svn_wc__db_status_incomplete);
 
-      if (working_status == svn_wc__db_status_base_deleted)
-        /* Make existing deletions of BASE_NODEs remove WORKING_NODEs */
-        remove_working = TRUE;
+      /* Only change nodes in the layers where we are creating the copy.
+         Deletes in higher layers will just apply to the copy */
+      if (working_op_depth <= mcb->op_depth)
+        {
+          add_working_base_deleted = TRUE;
 
-      add_working_base_deleted = TRUE;
+          if (working_status == svn_wc__db_status_base_deleted)
+            remove_working = TRUE;
+        }
     }
   else
     SVN_ERR(svn_sqlite__reset(stmt));

Modified: subversion/trunk/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/update_tests.py?rev=1090053&r1=1090052&r2=1090053&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/update_tests.py Thu Apr  7 22:42:01 2011
@@ -4858,7 +4858,6 @@ def tree_conflict_uc1_update_deleted_tre
 # Issue #3334: a delete-onto-modified tree conflict should leave the node
 # scheduled for re-addition.
 @Issue(3334)
-@XFail()
 def tree_conflict_uc2_schedule_re_add(sbox):
   "tree conflicts on update UC2, schedule re-add"
   sbox.build()

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=1090053&r1=1090052&r2=1090053&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Thu Apr  7 22:42:01 2011
@@ -1587,12 +1587,12 @@ test_temp_op_make_copy(const svn_test_op
     };
     /*  /           norm        -
         A           norm        norm
-        A/B         norm        base-del    norm
-        A/B/C       norm        base-del                norm
-        A/F         norm        base-del    norm
-        A/F/G       norm        base-del    norm
-        A/F/H       norm        base-del    not-pres
-        A/F/E       norm        base-del
+        A/B         norm        norm        norm
+        A/B/C       norm        norm        base-del    norm
+        A/F         norm        norm        norm
+        A/F/G       norm        norm        norm
+        A/F/H       norm        norm        not-pres
+        A/F/E       norm        norm        base-del
         A/X         norm        norm
         A/X/Y       incomplete  incomplete
     */
@@ -1608,19 +1608,22 @@ test_temp_op_make_copy(const svn_test_op
       { 0, "A/X",   "normal",       2, "A/X" },
       { 0, "A/X/Y", "incomplete",   2, "A/X/Y" },
       { 1, "A",     "normal",       2, "A" },
-      { 1, "A/B",   "base-deleted", 2, "A/B" },
-      { 1, "A/B/C", "base-deleted", 2, "A/B/C" },
-      { 1, "A/F",   "base-deleted", 2, "A/F" },
-      { 1, "A/F/G", "base-deleted", 2, "A/F/G" },
-      { 1, "A/F/H", "base-deleted", 2, "A/F/H" },
-      { 1, "A/F/E", "base-deleted", 2, "A/F/E" },
+      { 1, "A/B",   "normal",       2, "A/B" },
+      { 1, "A/B/C", "normal",       2, "A/B/C" },
+      { 1, "A/F",   "normal",       2, "A/F" },
+      { 1, "A/F/G", "normal",       2, "A/F/G" },
+      { 1, "A/F/H", "normal",       2, "A/F/H" },
+      { 1, "A/F/E", "normal",       2, "A/F/E" },
       { 1, "A/X",   "normal",       2, "A/X" },
       { 1, "A/X/Y", "incomplete",   2, "A/X/Y" },
       { 2, "A/B",   "normal",       NO_COPY_FROM },
-      { 3, "A/B/C", "normal",       NO_COPY_FROM },
+      { 2, "A/B",   "normal",       NO_COPY_FROM },
+      { 2, "A/B/C", "base-deleted", NO_COPY_FROM },
       { 2, "A/F",   "normal",       1, "S2" },
+      { 2, "A/F/E", "base-deleted", 2, "A/F/E" },
       { 2, "A/F/G", "normal",       1, "S2/G" },
       { 2, "A/F/H", "not-present",  1, "S2/H" },
+      { 3, "A/B/C", "normal",       NO_COPY_FROM },
       { 0 }
     };