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 2015/02/12 11:41:22 UTC

svn commit: r1659213 - in /subversion/trunk/subversion: libsvn_wc/wc_db_update_move.c tests/cmdline/move_tests.py

Author: rhuijben
Date: Thu Feb 12 10:41:22 2015
New Revision: 1659213

URL: http://svn.apache.org/r1659213
Log:
Make property and text conflicts during move-update resolving produce the right
notifications. The notification problem could be a recent regression as we
didn't test for this.

The regression test also triggers the problem fixed in r1659185.

* subversion/libsvn_wc/wc_db_update_move.c
  (update_move_list_add): Add db argument. Only change notification to tree
    conflict when there is a tree conflict.
  (mark_tc_on_op_root,
   tc_editor_add_directory,
   tc_editor_add_file,
   tc_editor_alter_directory,
   tc_editor_alter_file,
   tc_editor_delete,
   bump_mark_tree_conflict,
   svn_wc__db_op_raise_moved_away_internal): Update caller.
  (break_moved_away_children): Add db argument. Update caller.
  (svn_wc__db_resolve_break_moved_away_children): Update caller.

* subversion/tests/cmdline/move_tests.py
  (move_conflict_details): New test.
  (test_list): Add move_conflict_details.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c
    subversion/trunk/subversion/tests/cmdline/move_tests.py

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=1659213&r1=1659212&r2=1659213&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 10:41:22 2015
@@ -228,6 +228,7 @@ typedef struct node_move_baton_t
 static svn_error_t *
 update_move_list_add(svn_wc__db_wcroot_t *wcroot,
                      const char *local_relpath,
+                     svn_wc__db_t *db,
                      svn_wc_notify_action_t action,
                      svn_node_kind_t kind,
                      svn_wc_notify_state_t content_state,
@@ -240,9 +241,18 @@ update_move_list_add(svn_wc__db_wcroot_t
 
   if (conflict)
     {
-      action = svn_wc_notify_tree_conflict;
-      content_state = svn_wc_notify_state_inapplicable;
-      prop_state = svn_wc_notify_state_inapplicable;
+      svn_boolean_t tree_conflict;
+
+      SVN_ERR(svn_wc__conflict_read_info(NULL, NULL, NULL, NULL,
+                                         &tree_conflict,
+                                         db, wcroot->abspath, conflict,
+                                         scratch_pool, scratch_pool));
+      if (tree_conflict)
+        {
+          action = svn_wc_notify_tree_conflict;
+          content_state = svn_wc_notify_state_inapplicable;
+          prop_state = svn_wc_notify_state_inapplicable;
+        }
     }
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
@@ -568,7 +578,7 @@ mark_tc_on_op_root(node_move_baton_t *nm
                                               : NULL,
                                     scratch_pool, scratch_pool));
 
-  SVN_ERR(update_move_list_add(b->wcroot, nmb->dst_relpath,
+  SVN_ERR(update_move_list_add(b->wcroot, nmb->dst_relpath, b->db,
                                svn_wc_notify_tree_conflict,
                                new_kind,
                                svn_wc_notify_state_inapplicable,
@@ -713,7 +723,7 @@ tc_editor_add_directory(node_move_baton_
                                            scratch_pool, scratch_pool));
     }
 
-  SVN_ERR(update_move_list_add(b->wcroot, relpath,
+  SVN_ERR(update_move_list_add(b->wcroot, relpath, b->db,
                                (old_kind == svn_node_none)
                                   ? svn_wc_notify_update_add
                                   : svn_wc_notify_update_replace,
@@ -805,7 +815,7 @@ tc_editor_add_file(node_move_baton_t *nm
                                             scratch_pool, scratch_pool));
     }
 
-  SVN_ERR(update_move_list_add(b->wcroot, relpath,
+  SVN_ERR(update_move_list_add(b->wcroot, relpath, b->db,
                                (old_kind == svn_node_none)
                                   ? svn_wc_notify_update_add
                                   : svn_wc_notify_update_replace,
@@ -1010,7 +1020,7 @@ tc_editor_alter_directory(node_move_bato
                                       scratch_pool, scratch_pool));
     }
 
-  SVN_ERR(update_move_list_add(b->wcroot, dst_relpath,
+  SVN_ERR(update_move_list_add(b->wcroot, dst_relpath, b->db,
                                svn_wc_notify_update_update,
                                svn_node_dir,
                                svn_wc_notify_state_inapplicable,
@@ -1180,7 +1190,7 @@ tc_editor_alter_file(node_move_baton_t *
       work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
     }
 
-  SVN_ERR(update_move_list_add(b->wcroot, dst_relpath,
+  SVN_ERR(update_move_list_add(b->wcroot, dst_relpath, b->db,
                                svn_wc_notify_update_update,
                                svn_node_file,
                                content_state,
@@ -1319,7 +1329,7 @@ tc_editor_delete(node_move_baton_t *nmb,
 
   /* Only notify if add_file/add_dir is not going to notify */
   if (conflict || (new_kind == svn_node_none))
-    SVN_ERR(update_move_list_add(b->wcroot, relpath,
+    SVN_ERR(update_move_list_add(b->wcroot, relpath, b->db,
                                  svn_wc_notify_update_delete,
                                  move_dst_kind,
                                  svn_wc_notify_state_inapplicable,
@@ -2026,7 +2036,7 @@ bump_mark_tree_conflict(svn_wc__db_wcroo
                                move_src_op_root_relpath,
                                scratch_pool, scratch_pool));
 
-  SVN_ERR(update_move_list_add(wcroot, move_src_root_relpath,
+  SVN_ERR(update_move_list_add(wcroot, move_src_root_relpath, db,
                                svn_wc_notify_tree_conflict,
                                new_kind,
                                svn_wc_notify_state_inapplicable,
@@ -2385,7 +2395,7 @@ svn_wc__db_op_raise_moved_away_internal(
                                  iterpool, iterpool);
 
       if (!err)
-        err = update_move_list_add(wcroot, src_relpath,
+        err = update_move_list_add(wcroot, src_relpath, db,
                                    svn_wc_notify_tree_conflict,
                                    src_kind,
                                    svn_wc_notify_state_inapplicable,
@@ -2481,6 +2491,7 @@ break_moved_away(svn_wc__db_wcroot_t *wc
 
 static svn_error_t *
 break_moved_away_children(svn_wc__db_wcroot_t *wcroot,
+                          svn_wc__db_t *db,
                           const char *local_relpath,
                           apr_pool_t *scratch_pool)
 {
@@ -2514,7 +2525,7 @@ break_moved_away_children(svn_wc__db_wcr
 
       if (! err)
         {
-          err = update_move_list_add(wcroot, src_relpath,
+          err = update_move_list_add(wcroot, src_relpath, db,
                                      svn_wc_notify_move_broken,
                                      src_kind,
                                      svn_wc_notify_state_inapplicable,
@@ -2599,7 +2610,7 @@ svn_wc__db_resolve_break_moved_away_chil
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_WC__DB_WITH_TXN(
-    break_moved_away_children(wcroot, local_relpath, scratch_pool),
+    break_moved_away_children(wcroot, db, local_relpath, scratch_pool),
     wcroot);
 
   SVN_ERR(svn_wc__db_update_move_list_notify(wcroot,

Modified: subversion/trunk/subversion/tests/cmdline/move_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/move_tests.py?rev=1659213&r1=1659212&r2=1659213&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/move_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/move_tests.py Thu Feb 12 10:41:22 2015
@@ -1566,6 +1566,92 @@ def revert_del_root_of_move(sbox):
     expected_status.tweak('A/B/E', treeconflict='C')
     svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
+def move_conflict_details(sbox):
+  "move conflict details"
+
+  sbox.build()
+
+  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_commit()
+
+  sbox.simple_update('', 1)
+
+  sbox.simple_move('A/B/E', 'E')
+
+  sbox.simple_update('', 2)
+
+  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')
+    }
+  ]
+  svntest.actions.run_and_verify_info(expected_info, sbox.ospath('A/B/E'))
+
+  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'),
+    "Updated to revision 2.\n",
+    "Resolved conflicted state of '%s'\n" % sbox.ospath('A/B/E')
+  ]
+  svntest.actions.run_and_verify_svn(expected_output, [],
+                                     'resolve', sbox.ospath('A/B/E'),
+                                     '--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')),
+      "Conflict Properties File" :
+            re.escape(os.path.abspath(sbox.ospath('E/dir_conflicts.prej'))) +
+            '.*'
+    },
+    {
+      "Path" : re.escape(sbox.ospath('E/alpha')),
+      "Conflict Previous Base File" : '.*alpha.*',
+      "Conflict Previous Working File" : '.*alpha.*',
+      "Conflict Current Base File": '.*alpha.*',
+    },
+    {
+      "Path" : re.escape(sbox.ospath('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
+    }
+  ]
+
+  svntest.actions.run_and_verify_info(expected_info, sbox.ospath('E'),
+                                                     sbox.ospath('E/alpha'),
+                                                     sbox.ospath('E/beta'),
+                                                     sbox.ospath('E/new'))
+
 
 #######################################################################
 # Run the tests
@@ -1585,6 +1671,7 @@ test_list = [ None,
               copy_move_commit,
               move_to_from_external,
               revert_del_root_of_move,
+              move_conflict_details,
             ]
 
 if __name__ == '__main__':