subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1659271 - in /subversion/trunk/subversion: libsvn_wc/conflicts.c libsvn_wc/wc_db_update_move.c tests/cmdline/move_tests.py tests/libsvn_wc/op-depth-test.c
Date Thu, 12 Feb 2015 14:21:30 GMT
Author: rhuijben
Date: Thu Feb 12 14:21:30 2015
New Revision: 1659271

URL: http://svn.apache.org/r1659271
Log:
In the move-update logic properly detect incoming add conflicts. Add
regression test.

* subversion/libsvn_wc/conflicts.c
  (read_tree_conflict_desc): When the local change is an add or replace
    the node kind isn't fetchable from the conflict kind.

* subversion/libsvn_wc/wc_db_update_move.c
  (create_tree_conflict): While applying moves we always have an old version
    to record.
  (create_node_tree_conflict): As we know src and dest we can just calculate
    the relpath we need.
  (mark_tc_on_op_root): Remove unneeded argument. Update caller.
  (mark_node_edited): Update caller.
  (tc_editor_add_directory,
   tc_editor_add_file): Properly detect all kinds of local add tree conflicts.
  (tc_editor_alter_directory,
   svn_node_file): What we try to merge doesn't change on an obstruction.
     Update caller.
  (tc_editor_delete): Update caller.

* subversion/tests/cmdline/move_tests.py
  (move_conflict_details): Extend test.

* subversion/tests/libsvn_wc/op-depth-test.c
  (del4_update_delself_AAA,
   move4_update_delself_AAA,
   movedhere_extract_retract): Extend test. Update expected results.

Modified:
    subversion/trunk/subversion/libsvn_wc/conflicts.c
    subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c
    subversion/trunk/subversion/tests/cmdline/move_tests.py
    subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c

Modified: subversion/trunk/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/conflicts.c?rev=1659271&r1=1659270&r2=1659271&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/conflicts.c Thu Feb 12 14:21:30 2015
@@ -1817,7 +1817,9 @@ read_tree_conflict_desc(svn_wc_conflict_
            operation == svn_wc_operation_switch)
     {
       /* For updates, the left version corresponds to the pre-update state. */
-      if (left_version)
+      if (left_version
+          && reason != svn_wc_conflict_reason_added
+          && reason != svn_wc_conflict_reason_replaced)
         local_kind = left_version->node_kind;
       else
         {

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=1659271&r1=1659270&r2=1659271&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c Thu Feb 12 14:21:30 2015
@@ -447,16 +447,10 @@ create_tree_conflict(svn_skel_t **confli
                      result_pool,
                      scratch_pool));
 
-  if (reason != svn_wc_conflict_reason_unversioned
-      && old_repos_relpath != NULL /* no local additions */)
-    {
-      conflict_old_version = svn_wc_conflict_version_create2(
+  conflict_old_version = svn_wc_conflict_version_create2(
                                old_version->repos_url, old_version->repos_uuid,
                                old_repos_relpath, old_version->peg_rev,
                                old_kind, scratch_pool);
-    }
-  else
-    conflict_old_version = NULL;
 
   conflict_new_version = svn_wc_conflict_version_create2(
                            new_version->repos_url, new_version->repos_uuid,
@@ -487,7 +481,6 @@ create_node_tree_conflict(svn_skel_t **c
                           const char *dst_local_relpath,
                           svn_node_kind_t old_kind,
                           svn_node_kind_t new_kind,
-                          const char *old_repos_relpath,
                           svn_wc_conflict_reason_t reason,
                           svn_wc_conflict_action_t action,
                           const char *move_src_op_root_relpath,
@@ -495,6 +488,18 @@ create_node_tree_conflict(svn_skel_t **c
                           apr_pool_t *scratch_pool)
 {
   update_move_baton_t *umb = nmb->umb;
+  const char *dst_repos_relpath;
+  const char *dst_root_relpath = svn_relpath_limit(nmb->dst_relpath,
+                                                   nmb->umb->dst_op_depth,
+                                                   scratch_pool);
+
+  dst_repos_relpath =
+            svn_relpath_join(nmb->umb->old_version->path_in_repos,
+                             svn_relpath_skip_ancestor(dst_root_relpath,
+                                                       nmb->dst_relpath),
+                             scratch_pool);
+
+
 
   return svn_error_trace(
             create_tree_conflict(conflict_p, umb->wcroot, dst_local_relpath,
@@ -504,7 +509,7 @@ create_node_tree_conflict(svn_skel_t **c
                                  umb->db,
                                  umb->old_version, umb->new_version,
                                  umb->operation, old_kind, new_kind,
-                                 old_repos_relpath,
+                                 dst_repos_relpath,
                                  reason, action, move_src_op_root_relpath,
                                  result_pool, scratch_pool));
 }
@@ -547,7 +552,6 @@ static svn_error_t *
 mark_tc_on_op_root(node_move_baton_t *nmb,
                    svn_node_kind_t old_kind,
                    svn_node_kind_t new_kind,
-                   const char *old_repos_relpath,
                    svn_wc_conflict_action_t action,
                    apr_pool_t *scratch_pool)
 {
@@ -569,7 +573,6 @@ mark_tc_on_op_root(node_move_baton_t *nm
 
   SVN_ERR(create_node_tree_conflict(&conflict, nmb, nmb->dst_relpath,
                                     old_kind, new_kind,
-                                    old_repos_relpath,
                                     (move_dst_relpath
                                      ? svn_wc_conflict_reason_moved_away
                                      : svn_wc_conflict_reason_deleted),
@@ -611,10 +614,9 @@ mark_node_edited(node_move_baton_t *nmb,
   if (nmb->shadowed && !(nmb->pb && nmb->pb->shadowed))
     {
       svn_node_kind_t dst_kind, src_kind;
-      const char *dst_repos_relpath;
 
       SVN_ERR(svn_wc__db_depth_get_info(NULL, &dst_kind, NULL,
-                                        &dst_repos_relpath, NULL, NULL, NULL,
+                                        NULL, NULL, NULL, NULL,
                                         NULL, NULL, NULL, NULL, NULL, NULL,
                                         nmb->umb->wcroot, nmb->dst_relpath,
                                         nmb->umb->dst_op_depth,
@@ -629,7 +631,6 @@ mark_node_edited(node_move_baton_t *nmb,
 
       SVN_ERR(mark_tc_on_op_root(nmb,
                                  dst_kind, src_kind,
-                                 dst_repos_relpath,
                                  svn_wc_conflict_action_edit,
                                  scratch_pool));
     }
@@ -659,61 +660,61 @@ tc_editor_add_directory(node_move_baton_
                         apr_pool_t *scratch_pool)
 {
   update_move_baton_t *b = nmb->umb;
-  const char *move_dst_repos_relpath;
   const char *local_abspath;
   svn_node_kind_t wc_kind;
   svn_skel_t *work_item = NULL;
   svn_skel_t *conflict = NULL;
+  svn_wc_conflict_reason_t reason = svn_wc_conflict_reason_unversioned;
 
   SVN_ERR(mark_parent_edited(nmb, scratch_pool));
   if (nmb->skip)
     return SVN_NO_ERROR;
 
-  /* We can't read the information from the pre-add node to obtain the
-     relpath, but in WORKING we can just calculate it from the op-root */
-  {
-    const char *dst_op_root_relpath = svn_relpath_limit(nmb->pb->dst_relpath,
-                                                        b->dst_op_depth,
-                                                        scratch_pool);
-    SVN_ERR(svn_wc__db_depth_get_info(NULL, NULL, NULL,
-                                      &move_dst_repos_relpath, NULL, NULL,
-                                      NULL, NULL, NULL, NULL, NULL, NULL,
-                                      NULL,
-                                      b->wcroot, dst_op_root_relpath,
-                                      b->dst_op_depth,
-                                      scratch_pool, scratch_pool));
-
-    move_dst_repos_relpath =
-            svn_relpath_join(move_dst_repos_relpath,
-                             svn_relpath_skip_ancestor(dst_op_root_relpath,
-                                                       relpath),
-                             scratch_pool);
-  }
-
   if (nmb->shadowed)
     {
-      SVN_ERR(mark_tc_on_op_root(nmb,
-                                 svn_node_none, svn_node_dir,
-                                 move_dst_repos_relpath,
-                                 svn_wc_conflict_action_add,
-                                 scratch_pool));
-      return SVN_NO_ERROR;
+      svn_wc__db_status_t status;
+
+      SVN_ERR(svn_wc__db_read_info_internal(&status, &wc_kind, NULL, NULL,
+                                            NULL, NULL, NULL, NULL, NULL, NULL,
+                                            NULL, NULL, NULL, NULL, NULL, NULL,
+                                            NULL, NULL, NULL, NULL, NULL, NULL,
+                                            NULL, NULL, NULL,
+                                            b->wcroot, relpath,
+                                            scratch_pool, scratch_pool));
+
+      if (status == svn_wc__db_status_deleted)
+        reason = svn_wc_conflict_reason_deleted;
+      else if (status != svn_wc__db_status_added)
+        wc_kind = svn_node_none;
+      else if (old_kind == svn_node_none)
+        reason = svn_wc_conflict_reason_added;
+      else
+        reason = svn_wc_conflict_reason_replaced;
     }
+  else
+    wc_kind = svn_node_none;
 
-  /* Check for unversioned tree-conflict */
   local_abspath = svn_dirent_join(b->wcroot->abspath, relpath, scratch_pool);
 
-  SVN_ERR(svn_io_check_path(local_abspath, &wc_kind, scratch_pool));
-  if (wc_kind == old_kind)
+  if (wc_kind == svn_node_none)
+    {
+      /* Check for unversioned tree-conflict */
+      SVN_ERR(svn_io_check_path(local_abspath, &wc_kind, scratch_pool));
+    }
+
+  if (!nmb->shadowed && wc_kind == old_kind)
     wc_kind = svn_node_none; /* Node will be gone once we install */
 
-  if (wc_kind != svn_node_none)
+  if (wc_kind != svn_node_none
+      && (nmb->shadowed || wc_kind != old_kind)) /* replace */
     {
       SVN_ERR(create_node_tree_conflict(&conflict, nmb, relpath,
-                                        wc_kind, svn_node_dir,
-                                        move_dst_repos_relpath,
-                                        svn_wc_conflict_reason_unversioned,
-                                        svn_wc_conflict_action_add, NULL,
+                                        old_kind, svn_node_dir,
+                                        reason,
+                                        (old_kind == svn_node_none)
+                                          ? svn_wc_conflict_action_add
+                                          : svn_wc_conflict_action_replace,
+                                        NULL,
                                         scratch_pool, scratch_pool));
       nmb->skip = TRUE;
     }
@@ -743,7 +744,7 @@ tc_editor_add_file(node_move_baton_t *nm
                    apr_pool_t *scratch_pool)
 {
   update_move_baton_t *b = nmb->umb;
-  const char *move_dst_repos_relpath;
+  svn_wc_conflict_reason_t reason = svn_wc_conflict_reason_unversioned;
   svn_node_kind_t wc_kind;
   const char *local_abspath;
   svn_skel_t *work_item = NULL;
@@ -753,52 +754,48 @@ tc_editor_add_file(node_move_baton_t *nm
   if (nmb->skip)
     return SVN_NO_ERROR;
 
-  /* We can't read the information from the pre-add node to obtain the
-     relpath, but in WORKING we can just calculate it from the op-root */
-  {
-    const char *dst_op_root_relpath = svn_relpath_limit(nmb->pb->dst_relpath,
-                                                        b->dst_op_depth,
-                                                        scratch_pool);
-    SVN_ERR(svn_wc__db_depth_get_info(NULL, NULL, NULL,
-                                      &move_dst_repos_relpath, NULL, NULL,
-                                      NULL, NULL, NULL, NULL, NULL, NULL,
-                                      NULL,
-                                      b->wcroot, dst_op_root_relpath,
-                                      b->dst_op_depth,
-                                      scratch_pool, scratch_pool));
-
-    move_dst_repos_relpath =
-            svn_relpath_join(move_dst_repos_relpath,
-                             svn_relpath_skip_ancestor(dst_op_root_relpath,
-                                                       relpath),
-                             scratch_pool);
-  }
-
-  /* Check for NODES tree-conflict. */
   if (nmb->shadowed)
     {
-      SVN_ERR(mark_tc_on_op_root(nmb,
-                                 svn_node_none, svn_node_file,
-                                 move_dst_repos_relpath,
-                                 svn_wc_conflict_action_add,
-                                 scratch_pool));
-      return SVN_NO_ERROR;
+      svn_wc__db_status_t status;
+
+      SVN_ERR(svn_wc__db_read_info_internal(&status, &wc_kind, NULL, NULL,
+                                            NULL, NULL, NULL, NULL, NULL, NULL,
+                                            NULL, NULL, NULL, NULL, NULL, NULL,
+                                            NULL, NULL, NULL, NULL, NULL, NULL,
+                                            NULL, NULL, NULL,
+                                            b->wcroot, relpath,
+                                            scratch_pool, scratch_pool));
+
+      if (status == svn_wc__db_status_deleted)
+        reason = svn_wc_conflict_reason_deleted;
+      else if (status != svn_wc__db_status_added)
+        wc_kind = svn_node_none;
+      else if (old_kind == svn_node_none)
+        reason = svn_wc_conflict_reason_added;
+      else
+        reason = svn_wc_conflict_reason_replaced;
     }
+  else
+    wc_kind = svn_node_none;
 
-  /* Check for unversioned tree-conflict */
   local_abspath = svn_dirent_join(b->wcroot->abspath, relpath, scratch_pool);
-  SVN_ERR(svn_io_check_path(local_abspath, &wc_kind, scratch_pool));
 
-  if (wc_kind == old_kind)
-    wc_kind = svn_node_none; /* Node will be gone once we install */
+  if (wc_kind == svn_node_none)
+    {
+      /* Check for unversioned tree-conflict */
+      SVN_ERR(svn_io_check_path(local_abspath, &wc_kind, scratch_pool));
+    }
 
-  if (wc_kind != svn_node_none)
+  if (wc_kind != svn_node_none
+      && (nmb->shadowed || wc_kind != old_kind)) /* replace */
     {
       SVN_ERR(create_node_tree_conflict(&conflict, nmb, relpath,
-                                        wc_kind, svn_node_file,
-                                        move_dst_repos_relpath,
-                                        svn_wc_conflict_reason_unversioned,
-                                        svn_wc_conflict_action_add, NULL,
+                                        old_kind, svn_node_file,
+                                        reason,
+                                        (old_kind == svn_node_none)
+                                          ? svn_wc_conflict_action_add
+                                          : svn_wc_conflict_action_replace,
+                                        NULL,
                                         scratch_pool, scratch_pool));
       nmb->skip = TRUE;
     }
@@ -977,8 +974,7 @@ tc_editor_alter_directory(node_move_bato
   if (wc_kind != svn_node_none && wc_kind != svn_node_dir)
     {
       SVN_ERR(create_node_tree_conflict(&conflict_skel, nmb, dst_relpath,
-                                        wc_kind, svn_node_dir,
-                                        NULL /* local obstruction relpath */,
+                                        svn_node_dir, svn_node_dir,
                                         svn_wc_conflict_reason_obstructed,
                                         svn_wc_conflict_action_edit,
                                         NULL,
@@ -1080,8 +1076,7 @@ tc_editor_alter_file(node_move_baton_t *
   if (wc_kind != svn_node_none && wc_kind != svn_node_file)
     {
       SVN_ERR(create_node_tree_conflict(&conflict_skel, nmb, dst_relpath,
-                                        wc_kind, svn_node_file,
-                                        NULL /* local obstruction relpath */,
+                                        svn_node_file, svn_node_file,
                                         svn_wc_conflict_reason_obstructed,
                                         svn_wc_conflict_action_edit,
                                         NULL,
@@ -1209,8 +1204,6 @@ tc_editor_delete(node_move_baton_t *nmb,
 {
   update_move_baton_t *b = nmb->umb;
   svn_sqlite__stmt_t *stmt;
-  const char *move_dst_repos_relpath;
-  svn_node_kind_t move_dst_kind;
   const char *local_abspath;
   svn_boolean_t is_modified, is_all_deletes;
   svn_skel_t *work_items = NULL;
@@ -1220,21 +1213,13 @@ tc_editor_delete(node_move_baton_t *nmb,
   if (nmb->skip)
     return SVN_NO_ERROR;
 
-  SVN_ERR(svn_wc__db_depth_get_info(NULL, &move_dst_kind, NULL,
-                                    &move_dst_repos_relpath, NULL, NULL, NULL,
-                                    NULL, NULL, NULL, NULL, NULL, NULL,
-                                    b->wcroot, relpath, b->dst_op_depth,
-                                    scratch_pool, scratch_pool));
-
   /* Check before retracting delete to catch delete-delete
      conflicts. This catches conflicts on the node itself; deleted
      children are caught as local modifications below.*/
   if (nmb->shadowed)
     {
       SVN_ERR(mark_tc_on_op_root(nmb,
-                                 move_dst_kind,
-                                 new_kind,
-                                 move_dst_repos_relpath,
+                                 old_kind, new_kind,
                                  svn_wc_conflict_action_delete,
                                  scratch_pool));
       return SVN_NO_ERROR;
@@ -1262,8 +1247,7 @@ tc_editor_delete(node_move_baton_t *nmb,
       reason = svn_wc_conflict_reason_edited;
 
       SVN_ERR(create_node_tree_conflict(&conflict, nmb, relpath,
-                                        move_dst_kind, new_kind,
-                                        move_dst_repos_relpath, reason,
+                                        old_kind, new_kind, reason,
                                         (new_kind == svn_node_none)
                                           ? svn_wc_conflict_action_delete
                                           : svn_wc_conflict_action_replace,
@@ -1331,7 +1315,7 @@ tc_editor_delete(node_move_baton_t *nmb,
   if (conflict || (new_kind == svn_node_none))
     SVN_ERR(update_move_list_add(b->wcroot, relpath, b->db,
                                  svn_wc_notify_update_delete,
-                                 move_dst_kind,
+                                 new_kind,
                                  svn_wc_notify_state_inapplicable,
                                  svn_wc_notify_state_inapplicable,
                                  conflict, work_items, scratch_pool));

Modified: subversion/trunk/subversion/tests/cmdline/move_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/move_tests.py?rev=1659271&r1=1659270&r2=1659271&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/move_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/move_tests.py Thu Feb 12 14:21:30 2015
@@ -1574,83 +1574,140 @@ def move_conflict_details(sbox):
   sbox.simple_append('A/B/E/new', 'new\n')
   sbox.simple_add('A/B/E/new')
   sbox.simple_append('A/B/E/alpha', '\nextra\nlines\n')
-  sbox.simple_rm('A/B/E/beta')
-  sbox.simple_propset('key', 'VAL', 'A/B/E')
+  sbox.simple_rm('A/B/E/beta', 'A/B/F')
+  sbox.simple_propset('key', 'VAL', 'A/B/E', 'A/B')
+  sbox.simple_mkdir('A/B/E/new-dir1')
+  sbox.simple_mkdir('A/B/E/new-dir2')
+  sbox.simple_mkdir('A/B/E/new-dir3')
+  sbox.simple_rm('A/B/lambda')
+  sbox.simple_mkdir('A/B/lambda')
   sbox.simple_commit()
 
   sbox.simple_update('', 1)
 
-  sbox.simple_move('A/B/E', 'E')
+  sbox.simple_move('A/B', 'B')
 
   sbox.simple_update('', 2)
 
   expected_info = [
-    {"Tree conflict": re.escape(
+    {
+      "Moved To": "B", # Just 'B'?? Not the full/relative path or something?
+      "Tree conflict": re.escape(
               'local dir moved away, incoming dir edit upon update' +
-              ' Source  left: (dir) ^/A/B/E@1' +
-              ' Source right: (dir) ^/A/B/E@2')
+              ' Source  left: (dir) ^/A/B@1' +
+              ' Source right: (dir) ^/A/B@2')
     }
   ]
-  svntest.actions.run_and_verify_info(expected_info, sbox.ospath('A/B/E'))
+  svntest.actions.run_and_verify_info(expected_info, sbox.ospath('A/B'))
+
+  sbox.simple_propset('key', 'vAl', 'B')
+  sbox.simple_move('B/E/beta', 'beta')
+  sbox.simple_propset('a', 'b', 'B/F', 'B/lambda')
+  sbox.simple_append('B/E/alpha', 'other\nnew\nlines')
+  sbox.simple_mkdir('B/E/new')
+  sbox.simple_mkdir('B/E/new-dir1')
+  sbox.simple_append('B/E/new-dir2', 'something')
+  sbox.simple_append('B/E/new-dir3', 'something')
+  sbox.simple_add('B/E/new-dir3')
 
-  sbox.simple_propset('key', 'vAl', 'E')
-  sbox.simple_move('E/beta', 'beta')
-  sbox.simple_append('E/alpha', 'other\nnew\nlines')
-  sbox.simple_mkdir('E/new')
 
   expected_output = [
-    " C   %s\n" % sbox.ospath('E'),         # Property conflicted
-    "C    %s\n" % sbox.ospath('E/alpha'),   # Text conflicted
-    "   C %s\n" % sbox.ospath('E/beta'),
-    "   C %s\n" % sbox.ospath('E/new'),
+    " C   %s\n" % sbox.ospath('B'),         # Property conflicted
+    " U   %s\n" % sbox.ospath('B/E'),       # Just updated
+    "C    %s\n" % sbox.ospath('B/E/alpha'), # Text conflicted
+    "   C %s\n" % sbox.ospath('B/E/beta'),
+    "   C %s\n" % sbox.ospath('B/E/new'),
+    "   C %s\n" % sbox.ospath('B/E/new-dir1'),
+    "   C %s\n" % sbox.ospath('B/E/new-dir2'),
+    "   C %s\n" % sbox.ospath('B/E/new-dir3'),
+    "   C %s\n" % sbox.ospath('B/F'),
+    "   C %s\n" % sbox.ospath('B/lambda'),
     "Updated to revision 2.\n",
-    "Resolved conflicted state of '%s'\n" % sbox.ospath('A/B/E')
+    "Resolved conflicted state of '%s'\n" % sbox.ospath('A/B')
   ]
   svntest.actions.run_and_verify_svn(expected_output, [],
-                                     'resolve', sbox.ospath('A/B/E'),
+                                     'resolve', sbox.ospath('A/B'),
                                      '--depth', 'empty',
                                      '--accept', 'mine-conflict')
 
   expected_info = [
     {
-      "Tree conflict": re.escape(
-         'local dir moved away, incoming dir edit upon update' +
-         ' Source  left: (dir) ^/A/B/E@1' +
-         ' Source right: (dir) ^/A/B/E@2')
-    }
-  ]
-
-  expected_info = [
-    {
-      "Path" : re.escape(sbox.ospath('E')),
+      "Path" : re.escape(sbox.ospath('B')),
+      
       "Conflict Properties File" :
-            re.escape(os.path.abspath(sbox.ospath('E/dir_conflicts.prej'))) +
-            '.*'
+            re.escape(os.path.abspath(sbox.ospath('B/dir_conflicts.prej'))) +
+            '.*',
+      "Conflict Details": re.escape(
+            'incoming dir edit upon update' +
+            ' Source  left: (dir) ^/A/B@1' +
+            ' Source right: (dir) ^/A/B@2')
+    },
+    {
+      "Path" : re.escape(sbox.ospath('B/E')),
     },
     {
-      "Path" : re.escape(sbox.ospath('E/alpha')),
+      "Path" : re.escape(sbox.ospath('B/E/alpha')),
       "Conflict Previous Base File" : '.*alpha.*',
       "Conflict Previous Working File" : '.*alpha.*',
       "Conflict Current Base File": '.*alpha.*',
+      "Conflict Details": re.escape(
+          'incoming file edit upon update' +
+          ' Source  left: (file) ^/A/B/E/alpha@1' +
+          ' Source right: (file) ^/A/B/E/alpha@2')
     },
     {
-      "Path" : re.escape(sbox.ospath('E/beta')),
+      "Path" : re.escape(sbox.ospath('B/E/beta')),
       "Tree conflict": re.escape(
           'local file moved away, incoming file delete or move upon update' +
           ' Source  left: (file) ^/A/B/E/beta@1' +
           ' Source right: (none) ^/A/B/E/beta@2')
     },
     {
-      "Path" : re.escape(sbox.ospath('E/new')),
-      "Tree conflict":
-          'local .*, incoming file add upon update .*' # Not recorded properly
-    }
+      "Path" : re.escape(sbox.ospath('B/E/new')),
+      "Tree conflict": re.escape(
+          'local dir add, incoming file add upon update' +
+          ' Source  left: (none) ^/A/B/E/new@1' +
+          ' Source right: (file) ^/A/B/E/new@2')
+    },
+    {
+      "Path" : re.escape(sbox.ospath('B/E/new-dir1')),
+      "Tree conflict": re.escape(
+          'local dir add, incoming dir add upon update' +
+          ' Source  left: (none) ^/A/B/E/new-dir1@1' +
+          ' Source right: (dir) ^/A/B/E/new-dir1@2')
+    },
+    {
+      "Path" : re.escape(sbox.ospath('B/E/new-dir2')),
+      "Tree conflict": re.escape(
+          'local file unversioned, incoming dir add upon update' +
+          ' Source  left: (none) ^/A/B/E/new-dir2@1' +
+          ' Source right: (dir) ^/A/B/E/new-dir2@2')
+    },
+    {
+      "Path" : re.escape(sbox.ospath('B/E/new-dir3')),
+      "Tree conflict": re.escape(
+          'local file add, incoming dir add upon update' +
+          ' Source  left: (none) ^/A/B/E/new-dir3@1' +
+          ' Source right: (dir) ^/A/B/E/new-dir3@2')
+    },
+    {
+      "Path" : re.escape(sbox.ospath('B/F')),
+      "Tree conflict": re.escape(
+          'local dir edit, incoming dir delete or move upon update' +
+          ' Source  left: (dir) ^/A/B/F@1' +
+          ' Source right: (none) ^/A/B/F@2')
+    },
+    {
+      "Path" : re.escape(sbox.ospath('B/lambda')),
+      "Tree conflict": re.escape(
+          'local file edit, incoming replace with dir upon update' +
+          ' Source  left: (file) ^/A/B/lambda@1' +
+          ' Source right: (dir) ^/A/B/lambda@2')
+    },
   ]
 
-  svntest.actions.run_and_verify_info(expected_info, sbox.ospath('E'),
-                                                     sbox.ospath('E/alpha'),
-                                                     sbox.ospath('E/beta'),
-                                                     sbox.ospath('E/new'))
+  svntest.actions.run_and_verify_info(expected_info, sbox.ospath('B'),
+                                      '--depth', 'infinity')
 
 
 #######################################################################

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=1659271&r1=1659270&r2=1659271&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Thu Feb 12 14:21:30 2015
@@ -9686,7 +9686,40 @@ del4_update_delself_AAA(const svn_test_o
   SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_mine_conflict));
   /* Go back to start position */
   SVN_ERR(sbox_wc_update(&b, "", 1));
-  SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_mine_conflict));
+  {
+    conflict_info_t conflicts[] = {
+      {"A", FALSE, FALSE,   { svn_wc_conflict_action_edit,
+                              svn_wc_conflict_reason_replaced}},
+      {"B", FALSE, FALSE,   { svn_wc_conflict_action_edit,
+                              svn_wc_conflict_reason_moved_away, "B"}},
+      {"C/A", FALSE, FALSE, { svn_wc_conflict_action_edit,
+                              svn_wc_conflict_reason_moved_away, "C/A"}},
+      {0}
+    };
+
+    SVN_ERR(check_db_conflicts(&b, "", conflicts));
+  }
+  SVN_ERR(sbox_wc_resolve(&b, "A", svn_depth_empty,
+                          svn_wc_conflict_choose_mine_conflict));
+  SVN_ERR(sbox_wc_resolve(&b, "B", svn_depth_empty,
+                          svn_wc_conflict_choose_mine_conflict));
+  SVN_ERR(sbox_wc_resolve(&b, "C/A", svn_depth_empty,
+                          svn_wc_conflict_choose_mine_conflict));
+  {
+    conflict_info_t conflicts[] = {
+      {"A/A",  FALSE, FALSE,  { svn_wc_conflict_action_edit,
+                                svn_wc_conflict_reason_deleted}},
+      {"A/A/A", FALSE, FALSE, { svn_wc_conflict_action_add,
+                                svn_wc_conflict_reason_added}},
+      {0}
+    };
+
+    SVN_ERR(check_db_conflicts(&b, "", conflicts));
+  }
+  SVN_ERR(sbox_wc_resolve(&b, "A/A/A", svn_depth_empty,
+                          svn_wc_conflict_choose_merged));
+  SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity,
+                          svn_wc_conflict_choose_mine_conflict));
   /* Update and resolve via their strategy */
   SVN_ERR(sbox_wc_update(&b, "", 2));
   SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_merged));
@@ -9989,14 +10022,46 @@ move4_update_delself_AAA(const svn_test_
 
         { 0 },
       };
-        SVN_ERR(check_db_rows(&b, "", nodes));
+
+      conflict_info_t conflicts[] = {
+        {"A", FALSE, FALSE,   { svn_wc_conflict_action_edit,
+                                svn_wc_conflict_reason_moved_away, "A"}},
+        {"B", FALSE, FALSE,   { svn_wc_conflict_action_edit,
+                                svn_wc_conflict_reason_moved_away, "B"}},
+        {"C/A", FALSE, FALSE, { svn_wc_conflict_action_edit,
+                                svn_wc_conflict_reason_moved_away, "C/A"}},
+        {0}
+      };
+
+      SVN_ERR(check_db_rows(&b, "", nodes));
+      SVN_ERR(check_db_conflicts(&b, "", conflicts));
     }
-    SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_mine_conflict));
-    /* Update and resolve via their strategy */
-    SVN_ERR(sbox_wc_update(&b, "", 2));
-    SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_merged));
 
-    return SVN_NO_ERROR;
+  SVN_ERR(sbox_wc_resolve(&b, "A", svn_depth_empty,
+                          svn_wc_conflict_choose_mine_conflict));
+  SVN_ERR(sbox_wc_resolve(&b, "B", svn_depth_empty,
+                          svn_wc_conflict_choose_mine_conflict));
+  SVN_ERR(sbox_wc_resolve(&b, "C/A", svn_depth_empty,
+                          svn_wc_conflict_choose_mine_conflict));
+  {
+    conflict_info_t conflicts[] = {
+      {"A/A",  FALSE, FALSE,  { svn_wc_conflict_action_edit,
+                                svn_wc_conflict_reason_moved_away, "A/A"}},
+      {"A/A/A", FALSE, FALSE, { svn_wc_conflict_action_add,
+                                svn_wc_conflict_reason_added}},
+      {0}
+    };
+
+    SVN_ERR(check_db_conflicts(&b, "", conflicts));
+  }
+  SVN_ERR(sbox_wc_resolve(&b, "A/A/A", svn_depth_empty,
+                          svn_wc_conflict_choose_merged));
+  SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_mine_conflict));
+  /* Update and resolve via their strategy */
+  SVN_ERR(sbox_wc_update(&b, "", 2));
+  SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity, svn_wc_conflict_choose_merged));
+
+  return SVN_NO_ERROR;
 }
 
 static svn_error_t *
@@ -10191,8 +10256,35 @@ movedhere_extract_retract(const svn_test
   SVN_ERR(sbox_wc_mkdir(&b, "Z/E2"));
 
   SVN_ERR(sbox_wc_update(&b, "", 2));
+  {
+    conflict_info_t conflicts[] = {
+      {"A",    FALSE, FALSE, {svn_wc_conflict_action_edit,
+                              svn_wc_conflict_reason_moved_away, "A"}},
+      {0}
+    };
+
+    SVN_ERR(check_db_conflicts(&b, "", conflicts));
+  }
   SVN_ERR(sbox_wc_resolve(&b, "A", svn_depth_empty,
                           svn_wc_conflict_choose_mine_conflict));
+  {
+    conflict_info_t conflicts[] = {
+      {"Z/B1", FALSE, FALSE, {svn_wc_conflict_action_edit,
+                              svn_wc_conflict_reason_deleted}},
+      {"Z/B2", FALSE, FALSE, {svn_wc_conflict_action_edit,
+                              svn_wc_conflict_reason_moved_away, "Z/B2"}},
+      {"Z/C1", FALSE, FALSE, {svn_wc_conflict_action_delete,
+                              svn_wc_conflict_reason_deleted}},
+      {"Z/C2", FALSE, FALSE, {svn_wc_conflict_action_delete,
+                              svn_wc_conflict_reason_moved_away, "Z/C2"}},
+      {"Z/E2", FALSE, FALSE, {svn_wc_conflict_action_add,
+                              svn_wc_conflict_reason_added}},
+
+      {0}
+    };
+
+    SVN_ERR(check_db_conflicts(&b, "", conflicts));
+  }
   SVN_ERR(sbox_wc_resolve(&b, "Z/B1", svn_depth_empty,
                           svn_wc_conflict_choose_mine_conflict));
   SVN_ERR(sbox_wc_resolve(&b, "Z/B2", svn_depth_empty,
@@ -10203,8 +10295,10 @@ movedhere_extract_retract(const svn_test
   SVN_ERR(sbox_wc_resolve(&b, "Z/C2", svn_depth_empty,
                           svn_wc_conflict_choose_merged));
 
-  SVN_ERR(sbox_wc_resolve(&b, "", svn_depth_infinity,
-                          svn_wc_conflict_choose_mine_conflict));
+  SVN_ERR(sbox_wc_resolve(&b, "Z/E2", svn_depth_empty,
+                          svn_wc_conflict_choose_merged));
+
+  SVN_ERR(check_db_conflicts(&b, "", NULL));
   {
     nodes_row_t nodes[] = {
 
@@ -10259,6 +10353,8 @@ movedhere_extract_retract(const svn_test
       { 0 },
     };
     SVN_ERR(check_db_rows(&b, "", nodes));
+
+    SVN_ERR(check_db_conflicts(&b, "", NULL));
   }
 
   return SVN_NO_ERROR;



Mime
View raw message