You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2012/03/07 22:26:00 UTC

svn commit: r1298126 - /subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c

Author: stsp
Date: Wed Mar  7 21:25:59 2012
New Revision: 1298126

URL: http://svn.apache.org/viewvc?rev=1298126&view=rev
Log:
On the multi-layer moves branch, fix the db end state for "mv A B; mv B/F B/G"

The differences between db-states before and after this change are:

before: 1|A/F|base-deleted|B/G
        2|B/F|base-deleted|

after:  1|A/F|base-deleted|
        2|B/F|base-deleted|B/G
(columns: op_depth, local_relpath, presence, moved_to)

The db end state after "svn mv A B; svn mv B/F D/G" now matches the desired
end state described in http://wiki.apache.org/subversion/MultiLayerMoves

* subversion/libsvn_wc/wc_db.c
  (delete_node): With multi-layer moves, a node may become a move-root for
   the first time even if it is already within a moved-away subtree.
   Update move information for such nodes, too.

Modified:
    subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c

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=1298126&r1=1298125&r2=1298126&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  7 21:25:59 2012
@@ -6365,6 +6365,7 @@ delete_node(void *baton,
 
   if (b->moved_to_relpath)
     {
+      const char *moved_from_op_root_relpath;
       struct moved_node_t *moved_node
         = apr_palloc(scratch_pool, sizeof(struct moved_node_t));
 
@@ -6373,14 +6374,17 @@ delete_node(void *baton,
        * is the first time the node is moved. */
       if (status == svn_wc__db_status_added)
         SVN_ERR(scan_addition(&status, NULL, NULL, NULL, NULL, NULL, NULL,
-                              &moved_node->local_relpath, NULL,
+                              &moved_node->local_relpath,
+                              &moved_from_op_root_relpath,
                               &moved_node->op_depth,
                               wcroot, local_relpath,
                               scratch_pool, scratch_pool));
 
-      if (status != svn_wc__db_status_moved_here)
+      if (status != svn_wc__db_status_moved_here ||
+          strcmp(moved_from_op_root_relpath, moved_node->local_relpath) != 0)
         {
-          /* The node is being moved for the first time. */
+          /* The node is becoming a move-root for the first time,
+           * possibly because of a nested move operation. */
           moved_node->local_relpath = local_relpath;
           moved_node->op_depth = b->delete_depth;
         }