You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2013/04/24 18:35:15 UTC

svn commit: r1471516 - in /subversion/branches/1.8.x: ./ STATUS subversion/libsvn_wc/wc_db.c subversion/tests/cmdline/move_tests.py

Author: svn-role
Date: Wed Apr 24 16:35:14 2013
New Revision: 1471516

URL: http://svn.apache.org/r1471516
Log:
Merge the r1469478 group from trunk:

 * r1469478, r1469489, r1469512
   Fix issue 4356, status SEGV after incomplete move
   Justification:
     It's a SEGV.
   Votes:
     +1: philip, rhuijben, pburba

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/libsvn_wc/wc_db.c
    subversion/branches/1.8.x/subversion/tests/cmdline/move_tests.py

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1469478,1469489,1469512

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1471516&r1=1471515&r2=1471516&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Wed Apr 24 16:35:14 2013
@@ -117,10 +117,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r1469478, r1469489, r1469512
-   Fix issue 4356, status SEGV after incomplete move
-   Justification:
-     It's a SEGV.
-   Votes:
-     +1: philip, rhuijben, pburba

Modified: subversion/branches/1.8.x/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_wc/wc_db.c?rev=1471516&r1=1471515&r2=1471516&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_wc/wc_db.c Wed Apr 24 16:35:14 2013
@@ -11909,7 +11909,7 @@ svn_wc__db_scan_moved(const char **moved
                             : NULL,
                         wcroot, local_relpath, scratch_pool, scratch_pool));
 
-  if (status != svn_wc__db_status_moved_here)
+  if (status != svn_wc__db_status_moved_here || !moved_from_relpath)
     return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
                              _("Path '%s' was not moved here"),
                              path_for_error_message(wcroot, local_relpath,

Modified: subversion/branches/1.8.x/subversion/tests/cmdline/move_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/tests/cmdline/move_tests.py?rev=1471516&r1=1471515&r2=1471516&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/tests/cmdline/move_tests.py (original)
+++ subversion/branches/1.8.x/subversion/tests/cmdline/move_tests.py Wed Apr 24 16:35:14 2013
@@ -1192,6 +1192,48 @@ value3>>>>>>> (incoming property value)
   svntest.actions.verify_disk(wc_dir, expected_disk, True)
 
 
+@Issue(4356)
+def move_missing(sbox):
+  "move a missing directory"
+
+  sbox.build(read_only=True)
+  wc_dir = sbox.wc_dir
+
+  svntest.main.safe_rmtree(sbox.ospath('A/D/G'))
+
+  expected_err = '.*Can\'t move \'.*G\' to \'.*R\':.*'
+
+  # This move currently fails halfway between adding the dest and
+  # deleting the source
+  svntest.actions.run_and_verify_svn(None, None, expected_err,
+                                     'mv', sbox.ospath('A/D/G'),
+                                           sbox.ospath('R'))
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A/D/G', 'A/D/G/tau', 'A/D/G/pi', 'A/D/G/rho',
+                        status='! ', entry_status='  ')
+
+  expected_status.add({
+    'R'                 : Item(status='! ', wc_rev='-',
+                               entry_status='A ', entry_copied='+'),
+    'R/pi'              : Item(status='! ', wc_rev='-',
+                               entry_status='  ', entry_copied='+'),
+    'R/tau'             : Item(status='! ', wc_rev='-',
+                               entry_status='  ', entry_copied='+'),
+    'R/rho'             : Item(status='! ', wc_rev='-',
+                               entry_status='  ', entry_copied='+'),
+  })
+
+  # Verify that the status processing doesn't crash
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+  # The issue is a crash when the destination is present
+  os.mkdir(sbox.ospath('R'))
+  expected_status.tweak('R', status='A ', copied='+')
+
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+
 #######################################################################
 # Run the tests
 
@@ -1202,6 +1244,7 @@ test_list = [ None,
               shallower_move_file_test,
               deeper_move_file_test,
               property_merge,
+              move_missing,
             ]
 
 if __name__ == '__main__':