subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1551579 - in /subversion/trunk/subversion: libsvn_client/copy.c tests/cmdline/move_tests.py
Date Tue, 17 Dec 2013 15:37:29 GMT
Author: rhuijben
Date: Tue Dec 17 15:37:29 2013
New Revision: 1551579

URL: http://svn.apache.org/r1551579
Log:
Following up on r1551524, fix committing a move from an external to an
ancestor directory or moving the other way around.

* subversion/libsvn_client/copy.c
  (do_wc_to_wc_moves): Don't assume that child directories are always part
    of the parent working copy for locking.

* subversion/tests/cmdline/move_tests.py
  (move_to_from_external): Remove XFail marker and fix commit command.

Modified:
    subversion/trunk/subversion/libsvn_client/copy.c
    subversion/trunk/subversion/tests/cmdline/move_tests.py

Modified: subversion/trunk/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy.c?rev=1551579&r1=1551578&r2=1551579&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Tue Dec 17 15:37:29 2013
@@ -315,6 +315,8 @@ do_wc_to_wc_moves(svn_boolean_t *timesta
     {
       const char *src_parent_abspath;
       svn_boolean_t lock_src, lock_dst;
+      const char *src_wcroot_abspath;
+      const char *dst_wcroot_abspath;
 
       svn_client__copy_pair_t *pair = APR_ARRAY_IDX(copy_pairs, i,
                                                     svn_client__copy_pair_t *);
@@ -327,6 +329,13 @@ do_wc_to_wc_moves(svn_boolean_t *timesta
       src_parent_abspath = svn_dirent_dirname(pair->src_abspath_or_url,
                                               iterpool);
 
+      SVN_ERR(svn_wc__get_wcroot(&src_wcroot_abspath,
+                                 ctx->wc_ctx, src_parent_abspath,
+                                 iterpool, iterpool));
+      SVN_ERR(svn_wc__get_wcroot(&dst_wcroot_abspath,
+                                 ctx->wc_ctx, pair->dst_parent_abspath,
+                                 iterpool, iterpool));
+
       /* We now need to lock the right combination of batons.
          Four cases:
            1) src_parent == dst_parent
@@ -335,15 +344,18 @@ do_wc_to_wc_moves(svn_boolean_t *timesta
            4) src_parent and dst_parent are disjoint
          We can handle 1) as either 2) or 3) */
       if (strcmp(src_parent_abspath, pair->dst_parent_abspath) == 0
-          || svn_dirent_is_child(src_parent_abspath, pair->dst_parent_abspath,
-                                 iterpool))
+          || (svn_dirent_is_child(src_parent_abspath, pair->dst_parent_abspath,
+                                  NULL)
+              && !svn_dirent_is_child(src_parent_abspath, dst_wcroot_abspath,
+                                      NULL)))
         {
           lock_src = TRUE;
           lock_dst = FALSE;
         }
       else if (svn_dirent_is_child(pair->dst_parent_abspath,
-                                   src_parent_abspath,
-                                   iterpool))
+                                   src_parent_abspath, NULL)
+               && !svn_dirent_is_child(pair->dst_parent_abspath,
+                                       src_wcroot_abspath, NULL))
         {
           lock_src = FALSE;
           lock_dst = TRUE;

Modified: subversion/trunk/subversion/tests/cmdline/move_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/move_tests.py?rev=1551579&r1=1551578&r2=1551579&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/move_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/move_tests.py Tue Dec 17 15:37:29 2013
@@ -1553,7 +1553,6 @@ def copy_move_commit(sbox):
   sbox.simple_move('A/D/GG', 'A/D/GG-moved')
   sbox.simple_commit('A/D/GG-moved')
 
-@XFail()
 def move_to_from_external(sbox):
   "move to and from an external"
 
@@ -1572,7 +1571,7 @@ def move_to_from_external(sbox):
                                      sbox.ospath('GG/tau'))
                                      
   svntest.actions.run_and_verify_svn(None, None, [],
-                                     'ic',
+                                     'ci', '-m', 'Commit both',
                                      sbox.ospath(''),
                                      sbox.ospath('GG'))
   



Mime
View raw message