subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1434709 - in /subversion/trunk/subversion: libsvn_wc/conflicts.c tests/cmdline/update_tests.py
Date Thu, 17 Jan 2013 15:11:52 GMT
Author: stsp
Date: Thu Jan 17 15:11:52 2013
New Revision: 1434709

URL: http://svn.apache.org/viewvc?rev=1434709&view=rev
Log:
Allow 'svn resolve' to break a move by reverting the delete-half of the move,
if the user chooses --accept=theirs-conflict at the conflict prompt, and only
if the delete-half of the move is still deleted (i.e. has not been replaced).

* subversion/libsvn_wc/conflicts.c
  (conflict_status_walker_baton): Add wc_ctx. This makes the 'db' member
   of this baton redundant, but do not remove the 'db' member right now
   to avoid lots of code churn.
  (conflict_status_walker): If the user picked 'theirs-conflict' to resolve
   a tree conflict involving a local move, and the delete-half of the move
   is still deleted, break the move by reverting the delete-half.
   This requires a wc context in order to lock the parent of the delete-half
   of the move. The wc context is obtained from the status walker baton. 
  (svn_wc__resolve_conflicts): Put the wc_ctx into the status walker baton.

* subversion/tests/cmdline/update_tests.py
  (break_moved_dir_edited_leaf_del): Remove XFAIL marker.

Modified:
    subversion/trunk/subversion/libsvn_wc/conflicts.c
    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=1434709&r1=1434708&r2=1434709&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/conflicts.c Thu Jan 17 15:11:52 2013
@@ -2557,6 +2557,7 @@ svn_wc__resolve_text_conflict(svn_wc__db
 /* Baton for conflict_status_walker */
 struct conflict_status_walker_baton
 {
+  svn_wc_context_t *wc_ctx;
   svn_wc__db_t *db;
   svn_boolean_t resolve_text;
   const char *resolve_prop;
@@ -2646,7 +2647,29 @@ conflict_status_walker(void *baton,
                             scratch_pool, scratch_pool));
                  else if (my_choice == svn_wc_conflict_choose_theirs_conflict)
                   {
-                    /* ### TODO break move */
+                    switch (status->node_status)
+                      {
+                        case svn_wc_status_deleted:
+                          /* Break the move by reverting the deleted half of
+                           * the move, keeping the copied-half as a copy.
+                           * Reverting a node requires write lock on parent. */
+                          SVN_WC__CALL_WITH_WRITE_LOCK(
+                            svn_wc__revert_internal(cswb->db, local_abspath,
+                                                    svn_depth_infinity,
+                                                    FALSE, 
+                                                    cswb->cancel_func,
+                                                    cswb->cancel_baton,
+                                                    cswb->notify_func,
+                                                    cswb->notify_baton,
+                                                    scratch_pool),
+                            cswb->wc_ctx,
+                            svn_dirent_dirname(local_abspath, scratch_pool),
+                            FALSE, scratch_pool);
+                          break;
+                        default:
+                          /* ### TODO other node_status cases */
+                          break;
+                      }
                   }
               }
             else if (my_choice != svn_wc_conflict_choose_merged)
@@ -2790,6 +2813,7 @@ svn_wc__resolve_conflicts(svn_wc_context
   else if (depth == svn_depth_unknown)
     depth = svn_depth_infinity;
 
+  cswb.wc_ctx = wc_ctx;
   cswb.db = wc_ctx->db;
   cswb.resolve_text = resolve_text;
   cswb.resolve_prop = resolve_prop;

Modified: subversion/trunk/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/update_tests.py?rev=1434709&r1=1434708&r2=1434709&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/update_tests.py Thu Jan 17 15:11:52 2013
@@ -6030,7 +6030,6 @@ def update_deleted(sbox):
                                         None, None, 1,
                                         sbox.ospath('A/B'))
 
-@XFail()
 @Issue(3144,3630)
 # Like update_moved_dir_edited_leaf_del, but with --accept=theirs-conflict
 def break_moved_dir_edited_leaf_del(sbox):



Mime
View raw message