subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1300498 - in /subversion/branches/multi-layer-moves/subversion: libsvn_wc/wc-queries.sql libsvn_wc/wc_db.c tests/libsvn_wc/op-depth-test.c
Date Wed, 14 Mar 2012 10:45:46 GMT
Author: philip
Date: Wed Mar 14 10:45:46 2012
New Revision: 1300498

URL: http://svn.apache.org/viewvc?rev=1300498&view=rev
Log:
On multi-layer-move branch, more moved-to rewriting for children of
moved node.

* subversion/libsvn_wc/wc_db.c
  (delete_node): Don't look for rows to rewrite when this is not
   part of a move, rewrite even when not adding rows.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_MOVED_PAIR): Select more rows.

* subversion/tests/libsvn_wc/op-depth-test.c
  (move_to_swap): Test intermediate states, adjust expectations.  This
   test now PASSes.

Modified:
    subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc-queries.sql
    subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c
    subversion/branches/multi-layer-moves/subversion/tests/libsvn_wc/op-depth-test.c

Modified: subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc-queries.sql?rev=1300498&r1=1300497&r2=1300498&view=diff
==============================================================================
--- subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc-queries.sql Wed Mar 14 10:45:46
2012
@@ -1408,7 +1408,9 @@ WHERE wc_id = ?1 AND op_depth > 0
 -- STMT_SELECT_MOVED_PAIR
 SELECT local_relpath, moved_to, op_depth FROM nodes_current
 WHERE wc_id = ?1
-  AND IS_STRICT_DESCENDANT_OF(moved_to, ?2)
+  AND (IS_STRICT_DESCENDANT_OF(moved_to, ?2)
+       OR (IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
+           AND moved_to IS NOT NULL))
 
 /* This statement returns pairs of move-roots below the path ?2 in WC_ID ?1,
  * where the source of the move is within the subtree rooted at path ?2, and

Modified: subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c?rev=1300498&r1=1300497&r2=1300498&view=diff
==============================================================================
--- subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c Wed Mar 14 10:45:46
2012
@@ -6489,7 +6489,7 @@ delete_node(void *baton,
   /* Find children that were moved out of the subtree rooted at this node.
    * We'll need to update their op-depth columns because their deletion
    * is now implied by the deletion of their parent (i.e. this node). */
-  if (kind == svn_kind_dir)
+  if (kind == svn_kind_dir && !b->moved_to_relpath)
     {
       apr_pool_t *iterpool;
 
@@ -6622,22 +6622,22 @@ delete_node(void *baton,
                                 wcroot->wc_id, local_relpath,
                                 select_depth, b->delete_depth));
       SVN_ERR(svn_sqlite__step_done(stmt));
+    }
 
-      if (moved_nodes)
-        {
-          int i;
+  if (moved_nodes)
+    {
+      int i;
 
-          for (i = 0; i < moved_nodes->nelts; ++i)
-            {
-              const struct moved_node_t *moved_node
-                = APR_ARRAY_IDX(moved_nodes, i, void *);
+      for (i = 0; i < moved_nodes->nelts; ++i)
+        {
+          const struct moved_node_t *moved_node
+            = APR_ARRAY_IDX(moved_nodes, i, void *);
 
-              SVN_ERR(delete_update_movedto(wcroot,
-                                            moved_node->local_relpath,
-                                            moved_node->op_depth,
-                                            moved_node->moved_to_relpath,
-                                            scratch_pool));
-            }
+          SVN_ERR(delete_update_movedto(wcroot,
+                                        moved_node->local_relpath,
+                                        moved_node->op_depth,
+                                        moved_node->moved_to_relpath,
+                                        scratch_pool));
         }
     }
 

Modified: subversion/branches/multi-layer-moves/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-layer-moves/subversion/tests/libsvn_wc/op-depth-test.c?rev=1300498&r1=1300497&r2=1300498&view=diff
==============================================================================
--- subversion/branches/multi-layer-moves/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/branches/multi-layer-moves/subversion/tests/libsvn_wc/op-depth-test.c Wed Mar
14 10:45:46 2012
@@ -4138,11 +4138,54 @@ move_to_swap(const svn_test_opts_t *opts
   }
 
   SVN_ERR(wc_move(&b, "A", "A2"));
+
+  {
+    nodes_row_t nodes[] = {
+      {0, "",     "normal",       1, ""},
+      {0, "A",    "normal",       1, "A"},
+      {0, "A/B",  "normal",       1, "A/B"},
+      {0, "X",    "normal",       1, "X"},
+      {0, "X/Y",  "normal",       1, "X/Y"},
+      {1, "A",    "base-deleted", NO_COPY_FROM, FALSE, "A2"},
+      {1, "A/B",  "base-deleted", NO_COPY_FROM},
+      {1, "A2",   "normal",       1, "A", MOVED_HERE},
+      {1, "A2/B", "normal",       1, "A/B", MOVED_HERE},
+      {2, "A2/B", "base-deleted", NO_COPY_FROM, FALSE, "X/B"},
+      {2, "A2/Y", "normal",       1, "X/Y", MOVED_HERE},
+      {2, "X/Y",  "base-deleted", NO_COPY_FROM, FALSE, "A2/Y"},
+      {2, "X/B",  "normal",       1, "A/B", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
   SVN_ERR(wc_move(&b, "X", "A"));
+
+  {
+    nodes_row_t nodes[] = {
+      {0, "",     "normal",       1, ""},
+      {0, "A",    "normal",       1, "A"},
+      {0, "A/B",  "normal",       1, "A/B"},
+      {0, "X",    "normal",       1, "X"},
+      {0, "X/Y",  "normal",       1, "X/Y"},
+      {1, "A",    "normal",       1, "X", FALSE, "A2", TRUE},
+      {1, "A/B",  "base-deleted", NO_COPY_FROM},
+      {1, "A/Y",  "normal",       1, "X/Y", MOVED_HERE},
+      {1, "A2",   "normal",       1, "A", MOVED_HERE},
+      {1, "A2/B", "normal",       1, "A/B", MOVED_HERE},
+      {1, "X",    "base-deleted", NO_COPY_FROM, FALSE, "A"},
+      {1, "X/Y",  "base-deleted", NO_COPY_FROM},
+      {2, "A/B",  "normal",       1, "A/B", MOVED_HERE},
+      {2, "A/Y",  "base-deleted", NO_COPY_FROM, FALSE, "A2/Y"},
+      {2, "A2/B", "base-deleted", NO_COPY_FROM, FALSE, "A/B"},
+      {2, "A2/Y", "normal",       1, "X/Y", MOVED_HERE},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
   SVN_ERR(wc_move(&b, "A2", "X"));
 
-  /* Is this correct or should A/Y and X/B at op-depth=1 be marked
-     moved-here? */
   {
     nodes_row_t nodes[] = {
       {0, "",    "normal",       1, ""},
@@ -4152,12 +4195,12 @@ move_to_swap(const svn_test_opts_t *opts
       {0, "X/Y", "normal",       1, "X/Y"},
       {1, "A",   "normal",       1, "X",   FALSE, "X", TRUE},
       {1, "A/Y", "normal",       1, "X/Y", MOVED_HERE},
-      {1, "A/B", "base-deleted", NO_COPY_FROM, FALSE, "A/B"},
+      {1, "A/B", "base-deleted", NO_COPY_FROM},
       {1, "X",   "normal",       1, "A",   FALSE, "A", TRUE},
       {1, "X/B", "normal",       1, "A/B", MOVED_HERE},
-      {1, "X/Y", "base-deleted", NO_COPY_FROM, FALSE, "X/Y"},
-      {2, "A/Y", "base-deleted", NO_COPY_FROM},
-      {2, "X/B", "base-deleted", NO_COPY_FROM},
+      {1, "X/Y", "base-deleted", NO_COPY_FROM},
+      {2, "A/Y", "base-deleted", NO_COPY_FROM, FALSE, "X/Y"},
+      {2, "X/B", "base-deleted", NO_COPY_FROM, FALSE, "A/B"},
       {2, "A/B", "normal",       1, "A/B", MOVED_HERE},
       {2, "X/Y", "normal",       1, "X/Y", MOVED_HERE},
       {0}
@@ -4179,10 +4222,10 @@ move_to_swap(const svn_test_opts_t *opts
       {0, "A/B", "normal",       1, "A/B"},
       {0, "X",   "normal",       1, "X"},
       {0, "X/Y", "normal",       1, "X/Y"},
-      {1, "A",   "normal",       1, "X",   MOVED_HERE},
+      {1, "A",   "normal",       1, "X",   FALSE, "X", TRUE},
       {1, "A/Y", "normal",       1, "X/Y", MOVED_HERE},
       {1, "A/B", "base-deleted", NO_COPY_FROM},
-      {1, "X",   "normal",       1, "A",   MOVED_HERE},
+      {1, "X",   "normal",       1, "A",   FALSE, "A", TRUE},
       {1, "X/B", "normal",       1, "A/B", MOVED_HERE},
       {1, "X/Y", "base-deleted", NO_COPY_FROM},
       {0}
@@ -4196,18 +4239,18 @@ move_to_swap(const svn_test_opts_t *opts
   {
     nodes_row_t nodes[] = {
       {0, "",    "normal",       1, ""},
-      {0, "A",   "normal",       1, "A",   FALSE, "X"},
-      {0, "A/B", "normal",       1, "A/B", FALSE, "A/B"},
-      {0, "X",   "normal",       1, "X",   FALSE, "A"},
-      {0, "X/Y", "normal",       1, "X/Y", FALSE, "X/Y"},
-      {1, "A",   "normal",       1, "X",   MOVED_HERE},
+      {0, "A",   "normal",       1, "A"},
+      {0, "A/B", "normal",       1, "A/B"},
+      {0, "X",   "normal",       1, "X"},
+      {0, "X/Y", "normal",       1, "X/Y"},
+      {1, "A",   "normal",       1, "X",   FALSE, "X", TRUE},
       {1, "A/Y", "normal",       1, "X/Y", MOVED_HERE},
       {1, "A/B", "base-deleted", NO_COPY_FROM},
-      {1, "X",   "normal",       1, "A",   MOVED_HERE},
+      {1, "X",   "normal",       1, "A",   FALSE, "A", TRUE},
       {1, "X/B", "normal",       1, "A/B", MOVED_HERE},
       {1, "X/Y", "base-deleted", NO_COPY_FROM},
-      {2, "A/Y", "base-deleted", NO_COPY_FROM},
-      {2, "X/B", "base-deleted", NO_COPY_FROM},
+      {2, "A/Y", "base-deleted", NO_COPY_FROM, FALSE, "X/Y"},
+      {2, "X/B", "base-deleted", NO_COPY_FROM, FALSE, "A/B"},
       {2, "A/B", "normal",       1, "A/B", MOVED_HERE},
       {2, "X/Y", "normal",       1, "X/Y", MOVED_HERE},
       {0}



Mime
View raw message