Author: stsp
Date: Mon Feb 25 16:13:44 2013
New Revision: 1449761

URL: http://svn.apache.org/r1449761
Log:
Refuse attempts to resolve tree conflicts with --accept=theirs-conflict.

Doing so used to break moves. But so does --accept=working and it is
confusing to have two different --accept arguments with the same effect.
And we'll probably want to use 'theirs-conflict' for some smarter resolution
strategy in some future release of Subversion.

* subversion/libsvn_wc/conflicts.c
  (resolve_tree_conflict_on_node): Stop accepting both 'theirs-conflict'
   and 'working' resolutions for breaking moves. Accept only 'working'.

* subversion/tests/cmdline/move_tests.py
  (build_simple_file_move_tests): Adjust test expectations accordingly.

* subversion/tests/cmdline/update_tests.py
  (break_moved_dir_edited_leaf_del): Adjust test expectations.


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

Modified: subversion/trunk/subversion/libsvn_wc/conflicts.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/conflicts.c?rev=1449761&r1=1449760&r2=1449761&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/conflicts.c Mon Feb 25 16:13:44 2013
@@ -2704,13 +2704,11 @@ resolve_tree_conflict_on_node(svn_skel_t
                         scratch_pool, scratch_pool));
               did_resolve = TRUE;
             }
-          else if (conflict_choice == svn_wc_conflict_choose_theirs_conflict
-                   || conflict_choice == svn_wc_conflict_choose_merged)
+          else if (conflict_choice == svn_wc_conflict_choose_merged)
             {
-              /* We must break the move even if the user accepts
-               * the current working copy state (choose_merged)
-               * instead of updating the move. Else the move would
-               * be left in an invalid state. */
+              /* We must break the move if the user accepts the current
+               * working copy state instead of updating the move.
+               * Else the move would be left in an invalid state. */
 
               /* ### This breaks the move but leaves the conflict
                  ### involving the move until

Modified: subversion/trunk/subversion/tests/cmdline/move_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/move_tests.py?rev=1449761&r1=1449760&r2=1449761&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/move_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/move_tests.py Mon Feb 25 16:13:44 
2013
@@ -239,14 +239,10 @@ def build_simple_file_move_tests(sbox, s
   mc['status'].tweak(source, status='D ', moved_to=dest)
   mc['status'].add({dest: Item(status='A ', moved_from=source,
                                copied='+', wc_rev='-')})
+  # theirs-conflict doesn't work
   tc = {}
-  tc['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % source_path, match_all=False
-  )
-  # theirs-conflict breaks the move
-  tc['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev']) 
-  tc['status'].tweak(source, status='D ')
-  tc['status'].add({dest: Item(status='A ', copied='+', wc_rev='-')})
+  tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", 
match_all=False)
+  tc['status'] = test['up_status']
   working = {}
   working['output'] = svntest.verify.ExpectedOutput(
     "Resolved conflicted state of '%s'\n" % source_path, match_all=False
@@ -672,14 +668,10 @@ def build_simple_file_move_tests(sbox, s
   mc['status'].tweak(source, status='D ', moved_to=dest)
   mc['status'].add({dest: Item(status='A ', moved_from=source,
                                copied='+', wc_rev='-')})
+  # theirs-conflict doesn't work
   tc = {}
-  tc['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % source_path, match_all=False
-  )
-  # theirs-conflict breaks the move
-  tc['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev']) 
-  tc['status'].tweak(source, status='D ')
-  tc['status'].add({dest: Item(status='A ', copied='+', wc_rev='-')})
+  tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", 
match_all=False)
+  tc['status'] = test['up_status']
   working = {}
   working['output'] = svntest.verify.ExpectedOutput(
     "Resolved conflicted state of '%s'\n" % source_path, match_all=False
@@ -720,14 +712,10 @@ def build_simple_file_move_tests(sbox, s
   mc['status'].tweak(source, status='D ', moved_to=dest)
   mc['status'].add({dest: Item(status='A ', moved_from=source,
                                copied='+', wc_rev='-')})
+  # theirs-conflict doesn't work
   tc = {}
-  tc['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % source_path, match_all=False
-  )
-  # theirs-conflict breaks the move
-  tc['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev']) 
-  tc['status'].tweak(source, status='D ')
-  tc['status'].add({dest: Item(status='A ', copied='+', wc_rev='-')})
+  tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", 
match_all=False)
+  tc['status'] = test['up_status']
   working = {}
   working['output'] = svntest.verify.ExpectedOutput(
     "Resolved conflicted state of '%s'\n" % source_path, match_all=False
@@ -768,14 +756,10 @@ def build_simple_file_move_tests(sbox, s
   mc['status'].tweak(source, status='D ', moved_to=dest)
   mc['status'].add({dest: Item(status='A ', moved_from=source,
                                copied='+', wc_rev='-')})
+  # theirs-conflict doesn't work
   tc = {}
-  tc['output'] = svntest.verify.ExpectedOutput(
-    "Resolved conflicted state of '%s'\n" % source_path, match_all=False
-  )
-  # theirs-conflict breaks the move
-  tc['status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev']) 
-  tc['status'].tweak(source, status='D ')
-  tc['status'].add({dest: Item(status='A ', copied='+', wc_rev='-')})
+  tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", 
match_all=False)
+  tc['status'] = test['up_status']
   working = {}
   working['output'] = svntest.verify.ExpectedOutput(
     "Resolved conflicted state of '%s'\n" % source_path, match_all=False

Modified: subversion/trunk/subversion/tests/cmdline/update_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/update_tests.py?rev=1449761&r1=1449760&r2=1449761&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/update_tests.py Mon Feb 25 
16:13:44 2013
@@ -6118,12 +6118,12 @@ def break_moved_dir_edited_leaf_del(sbox
                                         None, None, None,
                                         None, None, 1)
 
-  # Now resolve the conflict, using --accept=theirs-conflict.
+  # Now resolve the conflict, using --accept=working
   # This should break the move of A/B/E to A/B/E2, leaving A/B/E2
   # as a copy. The deletion of A/B/E is not reverted.
   svntest.actions.run_and_verify_svn("resolve failed", None, [],
                                      'resolve', '--recursive',
-                                     '--accept=theirs-conflict', wc_dir)
+                                     '--accept=working', wc_dir)
   expected_status.tweak('A/B/E', treeconflict=None, moved_to=None)
   expected_status.tweak('A/B/E2', moved_from=None)
   svntest.actions.run_and_verify_status(wc_dir, expected_status)


Reply via email to