Author: sbutler
Date: Tue Jun  7 00:21:42 2011
New Revision: 1132843

URL: http://svn.apache.org/viewvc?rev=1132843&view=rev
Log:
More testing for issue 3899 (auto resolve for wc-wc copies/moves).

* subversion/tests/cmdline/copy_tests.py
  (copying_conflicts): Rename to...
  (copy_and_move_conflicts): ...this and add XFAILing test cases for moves.

Modified:
    subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/copy_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?rev=1132843&r1=1132842&r2=1132843&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/copy_tests.py Tue Jun  7 00:21:42 
2011
@@ -5221,12 +5221,13 @@ def case_only_rename(sbox):
   # Test that the necessary deletes and adds are present in status.
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
+@XFail()
 @Issue(3899)
-def copying_conflicts(sbox):
-  """copying conflicts"""
+def copy_and_move_conflicts(sbox):
+  """copy and move conflicts"""
 
-  # The destination of a copy operation should *not* be conflicted,
-  # and should contain the "mine-full" contents.
+  # The destination of a copy or move operation should *not* be
+  # conflicted, and should contain the "mine-full" contents.
 
   sbox.build()
   wc = sbox.ospath
@@ -5306,9 +5307,8 @@ def copying_conflicts(sbox):
 
   # Resolve one text conflict via marker file deletion.
   os.remove(wc('A/B/E/beta.merge-left.r3'))
+  os.rename(wc('A/B/E/beta.merge-right.r4'), wc('A/B/E/beta'))
   os.remove(wc('A/B/E/beta.working'))
-  os.remove(wc('A/B/E/beta'))
-  os.rename(wc('A/B/E/beta.merge-right.r4'), wc('A/B/E/beta')) 
 
   # Prepare for local copies and moves.
   sbox.simple_mkdir('copy-dest')
@@ -5392,6 +5392,54 @@ def copying_conflicts(sbox):
     })
   svntest.actions.verify_disk(wc('copy-dest'), expected_disk, True)
 
+  # Move conflict victims.
+  sbox.simple_move('A/B/E/alpha', 'move-dest')
+  sbox.simple_move('A/D/H', 'move-dest')
+  sbox.simple_move('A/D/G', 'move-dest')
+  sbox.simple_move('A/Q', 'move-dest')
+
+  # Move directories with conflicted children.
+  sbox.simple_move('A/B', 'move-dest')
+  sbox.simple_move('A/D', 'move-dest')
+
+  # Expect same status and disk content as at the copy destination, except
+  # that A/B/E/alpha, A/D/G, and A/D/H were moved away first.
+  expected_status.wc_dir = wc('move-dest')
+  expected_status.tweak('B/E/alpha',
+                        'D/H',
+                        'D/H/chi',
+                        'D/H/omega',
+                        'D/H/psi',
+                        status='D ')
+  # A/D/G had been re-added from r4 due to a "local edit, incoming delete"
+  # tree conflict, so moving it away has a different effect.
+  expected_status.remove('D/G',
+                         'D/G/pi',
+                         'D/G/rho',
+                         'D/G/tau')
+  svntest.actions.run_and_verify_status(wc('move-dest'), expected_status)
+
+  expected_disk = svntest.wc.State('', {
+    'B/E/beta'          : Item(contents="This is the file 'beta'.\n"
+                               "Edit for merge\n"),
+    'B/lambda'          : Item(contents="This is the file 'lambda'.\n"),
+    'B/F'               : Item(),
+    'H'                 : Item(props={'foo':'100'}),
+    'H/chi'             : Item(contents="This is the file 'chi'.\n",
+                               props={'foo':'100'}),
+    'H/psi'             : Item(contents="This is the file 'psi'.\n"),
+    'H/omega'           : Item(contents="This is the file 'omega'.\n"),
+    'D'                 : Item(),
+    'G/tau'             : Item(contents="This is the file 'tau'.\n"),
+    'G/rho'             : Item(contents="This is the file 'rho'.\n"
+                               "Local edit\n"),
+    'G/pi'              : Item(contents="This is the file 'pi'.\n"),
+    'Q/sigma'           : Item(contents="New local file\n"),
+    'alpha'             : Item(contents="This is the file 'alpha'.\n"
+                               "Local edit\n"),
+    })
+  svntest.actions.verify_disk(wc('move-dest'), expected_disk, True)
+
 
 ########################################################################
 # Run the tests
@@ -5501,7 +5549,7 @@ test_list = [ None,
               deleted_file_with_case_clash,
               copy_base_of_deleted,
               case_only_rename,
-              copying_conflicts,
+              copy_and_move_conflicts,
              ]
 
 if __name__ == '__main__':


Reply via email to