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 2016/04/19 18:03:58 UTC

svn commit: r1739953 - in /subversion/trunk/subversion: libsvn_wc/conflicts.c tests/cmdline/move_tests.py tests/cmdline/tree_conflict_tests.py

Author: stsp
Date: Tue Apr 19 16:03:58 2016
New Revision: 1739953

URL: http://svn.apache.org/viewvc?rev=1739953&view=rev
Log:
Start using new svn_wc_notify_action_t values for conflicts.

Fixes regression test fallout caused by ealier related commits.

* subversion/libsvn_wc/conflicts.c
  (conflict_status_walker): Use type-specific conflict resolution
   notifications. Use the generic 'resolved' notification only if
   the caller doesn't care which kind of conflict we're resolving.
  (svn_wc__conflict_tree_update_break_moved_away,
   svn_wc__conflict_tree_update_raise_moved_away,
   svn_wc__conflict_tree_update_moved_away_node): Use specific notification
    action values for tree conflicts.

* subversion/tests/cmdline/move_tests.py
  (build_simple_file_move_tests, move_conflict_details): Adjust expected output.

* subversion/tests/cmdline/tree_conflict_tests.py
  (actual_only_node_behaviour): Adjust expected output.

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

Modified: subversion/trunk/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/conflicts.c?rev=1739953&r1=1739952&r2=1739953&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/conflicts.c Tue Apr 19 16:03:58 2016
@@ -2971,12 +2971,13 @@ conflict_status_walker(void *baton,
 {
   struct conflict_status_walker_baton *cswb = baton;
   svn_wc__db_t *db = cswb->db;
-
+  svn_wc_notify_action_t notify_action = svn_wc_notify_resolved;
   const apr_array_header_t *conflicts;
   apr_pool_t *iterpool;
   int i;
   svn_boolean_t resolved = FALSE;
   svn_skel_t *conflict;
+  const svn_wc_conflict_description2_t *cd;
 
   if (!status->conflicted)
     return SVN_NO_ERROR;
@@ -2991,7 +2992,6 @@ conflict_status_walker(void *baton,
 
   for (i = 0; i < conflicts->nelts; i++)
     {
-      const svn_wc_conflict_description2_t *cd;
       svn_boolean_t did_resolve;
       svn_wc_conflict_choice_t my_choice = cswb->conflict_choice;
       svn_wc_conflict_result_t *result = NULL;
@@ -3043,7 +3043,10 @@ conflict_status_walker(void *baton,
                                                   iterpool));
 
             if (did_resolve)
-              resolved = TRUE;
+              {
+                resolved = TRUE;
+                notify_action = svn_wc_notify_resolved_tree;
+              }
             break;
 
           case svn_wc_conflict_kind_text:
@@ -3067,6 +3070,8 @@ conflict_status_walker(void *baton,
             SVN_ERR(svn_wc__wq_run(db, local_abspath,
                                    cswb->cancel_func, cswb->cancel_baton,
                                    iterpool));
+            if (resolved)
+                notify_action = svn_wc_notify_resolved_text;
             break;
 
           case svn_wc_conflict_kind_property:
@@ -3087,7 +3092,10 @@ conflict_status_walker(void *baton,
                                                   iterpool));
 
             if (did_resolve)
-              resolved = TRUE;
+              {
+                resolved = TRUE;
+                notify_action = svn_wc_notify_resolved_prop;
+              }
             break;
 
           default:
@@ -3098,12 +3106,22 @@ conflict_status_walker(void *baton,
 
   /* Notify */
   if (cswb->notify_func && resolved)
-    cswb->notify_func(cswb->notify_baton,
-                      svn_wc_create_notify(local_abspath,
-                                           svn_wc_notify_resolved,
-                                           iterpool),
-                      iterpool);
+    {
+      svn_wc_notify_t *notify;
+
+      /* If our caller asked for all conflicts to be resolved,
+       * send a general 'resolved' notification. */
+      if (cswb->resolve_text && cswb->resolve_tree &&
+          (cswb->resolve_prop == NULL || cswb->resolve_prop[0] == '\0'))
+        notify_action = svn_wc_notify_resolved;
+
+      notify = svn_wc_create_notify(local_abspath, notify_action, iterpool);
+      if (notify_action == svn_wc_notify_resolved_prop)
+        notify->prop_name = cd->property_name;
 
+      cswb->notify_func(cswb->notify_baton, notify, iterpool);
+
+    }
   if (resolved)
     cswb->resolved_one = TRUE;
 
@@ -3452,7 +3470,8 @@ svn_wc__conflict_tree_update_break_moved
 
       if (notify_func)
         notify_func(notify_baton,
-                    svn_wc_create_notify(local_abspath, svn_wc_notify_resolved,
+                    svn_wc_create_notify(local_abspath,
+                                         svn_wc_notify_resolved_tree,
                                          scratch_pool),
                     scratch_pool);
       return SVN_NO_ERROR;
@@ -3467,7 +3486,8 @@ svn_wc__conflict_tree_update_break_moved
 
   if (notify_func)
     notify_func(notify_baton,
-                svn_wc_create_notify(local_abspath, svn_wc_notify_resolved,
+                svn_wc_create_notify(local_abspath,
+                                     svn_wc_notify_resolved_tree,
                                      scratch_pool),
                 scratch_pool);
 
@@ -3543,7 +3563,8 @@ svn_wc__conflict_tree_update_raise_moved
   /* The conflict was marked resolved by svn_wc__db_op_raise_moved_away(). */
   if (notify_func)
     notify_func(notify_baton,
-                svn_wc_create_notify(local_abspath, svn_wc_notify_resolved,
+                svn_wc_create_notify(local_abspath,
+                                     svn_wc_notify_resolved_tree,
                                      scratch_pool),
                 scratch_pool);
 
@@ -3628,7 +3649,8 @@ svn_wc__conflict_tree_update_moved_away_
 
   if (notify_func)
     notify_func(notify_baton,
-                svn_wc_create_notify(local_abspath, svn_wc_notify_resolved,
+                svn_wc_create_notify(local_abspath,
+                                     svn_wc_notify_resolved_tree,
                                      scratch_pool),
                 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=1739953&r1=1739952&r2=1739953&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/move_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/move_tests.py Tue Apr 19 16:03:58 2016
@@ -237,7 +237,7 @@ def build_simple_file_move_tests(sbox, s
                                     copied='+', wc_rev='-')})
   mc = {}
   mc['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % source_path, match_all=False
+    "Tree conflict at '%s' marked as resolved.\n" % source_path, match_all=False
   )
   mc['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
   mc['status'].tweak(source, status='D ', moved_to=dest)
@@ -250,7 +250,7 @@ def build_simple_file_move_tests(sbox, s
   working['output'] = svntest.verify.ExpectedOutput(
     [
       "Breaking move with source path '%s'\n" % source_path,
-      "Resolved conflicted state of '%s'\n" % source_path,
+      "Tree conflict at '%s' marked as resolved.\n" % source_path,
     ]
   )
   working['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
@@ -288,7 +288,7 @@ def build_simple_file_move_tests(sbox, s
   working = {}
   # XXX: Doesn't say it broke the move it should.
   working['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % source_path, match_all=False
+    "Tree conflict at '%s' marked as resolved.\n" % source_path, match_all=False
   )
   # move is broken now
   working['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
@@ -329,7 +329,7 @@ def build_simple_file_move_tests(sbox, s
   working = {}
   # XXX: Broke the move but doesn't notify that it does.
   working['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % source_path, match_all=False
+    "Tree conflict at '%s' marked as resolved.\n" % source_path, match_all=False
   )
   # XXX: Not sure this status is really correct here
   working['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
@@ -368,7 +368,7 @@ def build_simple_file_move_tests(sbox, s
   working = {}
   # XXX: Doesn't say what it did.
   working['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % dest_path, match_all=False
+    "Tree conflict at '%s' marked as resolved.\n" % dest_path, match_all=False
   )
   # working converts the move into a replacement
   working['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
@@ -410,7 +410,7 @@ def build_simple_file_move_tests(sbox, s
   working['accept'] = 'working'
   # XXX: Doesn't say what it did.
   working['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % dest_path, match_all=False
+    "Tree conflict at '%s' marked as resolved.\n" % dest_path, match_all=False
   )
   # working converts the move into a replacement
   working['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
@@ -474,7 +474,7 @@ def build_simple_file_move_tests(sbox, s
   working = {}
   # XXX: Doesn't say what it did.
   working['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % dest_path, match_all=False
+    "Tree conflict at '%s' marked as resolved.\n" % dest_path, match_all=False
   )
   # working converts the move into a replacement
   working['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
@@ -514,7 +514,7 @@ def build_simple_file_move_tests(sbox, s
   working = {}
   # XXX: Doesn't say what it did.
   working['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % dest_path, match_all=False
+    "Tree conflict at '%s' marked as resolved.\n" % dest_path, match_all=False
   )
   # working converts the move into a replacement
   working['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
@@ -554,7 +554,7 @@ def build_simple_file_move_tests(sbox, s
   working = {}
   # XXX: Didn't tell us what it did.
   working['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % dest_path, match_all=False
+    "Tree conflict at '%s' marked as resolved.\n" % dest_path, match_all=False
   )
   # working converts the move into a replacement
   working['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
@@ -594,7 +594,7 @@ def build_simple_file_move_tests(sbox, s
   working = {}
   # XXX: Doesn't tell you what it did.
   working['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % dest_path, match_all=False
+    "Tree conflict at '%s' marked as resolved.\n" % dest_path, match_all=False
   )
   # working converts the move into a replacement
   working['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
@@ -634,7 +634,7 @@ def build_simple_file_move_tests(sbox, s
   working = {}
   # XXX: Doesn't tell you what it did.
   working['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % dest_path, match_all=False
+    "Tree conflict at '%s' marked as resolved.\n" % dest_path, match_all=False
   )
   # working converts the move into a replacement
   working['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
@@ -670,7 +670,7 @@ def build_simple_file_move_tests(sbox, s
   # TODO: Should check that the output includes that the update was applied to
   # the destination
   mc['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % source_path, match_all=False
+    "Tree conflict at '%s' marked as resolved.\n" % source_path, match_all=False
   )
   mc['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
   mc['status'].tweak(source, status='D ', moved_to=dest)
@@ -682,7 +682,7 @@ def build_simple_file_move_tests(sbox, s
   working['output'] = svntest.verify.ExpectedOutput(
     [
       "Breaking move with source path '%s'\n" % source_path,
-      "Resolved conflicted state of '%s'\n" % source_path
+      "Tree conflict at '%s' marked as resolved.\n" % source_path
     ]
   )
   # XXX: working breaks the move?  Is that right?
@@ -718,7 +718,7 @@ def build_simple_file_move_tests(sbox, s
   # TODO: Should check that the output includes that the update was applied to
   # the destination
   mc['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % source_path, match_all=False
+    "Tree conflict at '%s' marked as resolved.\n" % source_path, match_all=False
   )
   mc['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
   mc['status'].tweak(source, status='D ', moved_to=dest)
@@ -730,7 +730,7 @@ def build_simple_file_move_tests(sbox, s
   working['output'] = svntest.verify.ExpectedOutput(
     [
       "Breaking move with source path '%s'\n" % source_path,
-      "Resolved conflicted state of '%s'\n" % source_path
+      "Tree conflict at '%s' marked as resolved.\n" % source_path
     ]
   )
   # XXX: working breaks the move?  Is that right?
@@ -766,7 +766,7 @@ def build_simple_file_move_tests(sbox, s
   # TODO: Should check that the output includes that the update was applied to
   # the destination
   mc['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % source_path, match_all=False
+    "Tree conflict at '%s' marked as resolved.\n" % source_path, match_all=False
   )
   mc['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
   mc['status'].tweak(source, status='D ', moved_to=dest)
@@ -778,7 +778,7 @@ def build_simple_file_move_tests(sbox, s
   working['output'] = svntest.verify.ExpectedOutput(
     [
       "Breaking move with source path '%s'\n" % source_path,
-      "Resolved conflicted state of '%s'\n" % source_path
+      "Tree conflict at '%s' marked as resolved.\n" % source_path
     ]
   )
   # XXX: working breaks the move?  Is that right?
@@ -820,7 +820,7 @@ def build_simple_file_move_tests(sbox, s
   mc['disk'] = test['up_disk']
   working = {}
   working['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % source_path, match_all=False
+    "Tree conflict at '%s' marked as resolved.\n" % source_path, match_all=False
   )
   # move is broken now
   working['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
@@ -1609,7 +1609,7 @@ def move_conflict_details(sbox):
     "   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')
+    "Tree conflict at '%s' marked as resolved.\n" % sbox.ospath('A/B')
   ]
   svntest.actions.run_and_verify_svn(expected_output, [],
                                      'resolve', sbox.ospath('A/B'),

Modified: subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py?rev=1739953&r1=1739952&r2=1739953&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py Tue Apr 19 16:03:58 2016
@@ -1339,7 +1339,7 @@ def actual_only_node_behaviour(sbox):
                      "relocate", A_copy_url + "/foo", foo_path)
 
   # resolve
-  expected_stdout = "Resolved conflicted state of.*foo.*"
+  expected_stdout = "Tree conflict at.*foo.*marked as resolved"
   expected_stderr = []
   run_and_verify_svn(expected_stdout, expected_stderr,
                      "resolve", "--accept", "working", foo_path)