Modified: 
subversion/branches/authzperf/subversion/tests/cmdline/merge_tree_conflict_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/merge_tree_conflict_tests.py?rev=1764707&r1=1764706&r2=1764707&view=diff
==============================================================================
--- 
subversion/branches/authzperf/subversion/tests/cmdline/merge_tree_conflict_tests.py
 (original)
+++ 
subversion/branches/authzperf/subversion/tests/cmdline/merge_tree_conflict_tests.py
 Thu Oct 13 15:25:15 2016
@@ -2299,6 +2299,72 @@ def added_revision_recording_in_tree_con
   ]
   svntest.actions.run_and_verify_info(expected_info, sbox.ospath('branch/foo'))
 
+def spurios_tree_conflict_with_added_file(sbox):
+  "spurious tree conflict with unmodified added file"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Create a branch of A, A_copy
+  sbox.simple_copy('A', 'A_branch')
+  sbox.simple_commit()
+
+  # Create a new file on the trunk
+  sbox.simple_append('A/new', 'new\n')
+  sbox.simple_add('A/new')
+  sbox.simple_commit()
+
+  # Sync the branch with the trunk
+  sbox.simple_update()
+  expected_output = wc.State(wc_dir, {
+    "A_branch/new" : Item(status="A "),
+    })
+  expected_skip = wc.State('', { })
+  svntest.actions.run_and_verify_merge(sbox.ospath('A_branch'),
+                                       None, None, '^/A', None,
+                                       expected_output,
+                                       None, None,
+                                       None, None, expected_skip)
+  sbox.simple_commit()
+
+  # Reintegrate the branch (a no-op change, but users are free to do this)
+  sbox.simple_update()
+  expected_output = wc.State(wc_dir, { })
+  svntest.actions.run_and_verify_merge(sbox.ospath('A'),
+                                       None, None, '^/A_branch', None,
+                                       expected_output,
+                                       None, None,
+                                       None, None, expected_skip,
+                                       [], False, True, '--reintegrate',
+                                       sbox.ospath('A'))
+
+  # Delete the new file on the branch
+  sbox.simple_rm('A_branch/new')
+  sbox.simple_commit()
+
+  # Make an unrelated change on the trunk
+  sbox.simple_append('A/mu', 'more text\n')
+  sbox.simple_commit()
+
+  # Merge the trunk to the branch. Forcing a reintegrate merge here since
+  # this is what the automatic merge does, as of the time this test was 
written.
+  # This merge would raise an 'local missing vs incoming edit' tree conflict
+  # on the new file, which is bogus since there are no incoming edits.
+  expected_output = wc.State(wc_dir, {
+    'A_branch/mu' : Item(status='U '),
+  })
+  expected_mergeinfo_output = wc.State(wc_dir, {
+    'A_branch' : Item(status=' U'),
+    })
+  svntest.actions.run_and_verify_merge(sbox.ospath('A_branch'),
+                                       None, None, '^/A', None,
+                                       expected_output,
+                                       expected_mergeinfo_output, None,
+                                       None, None, expected_skip,
+                                       [], False, True, '--reintegrate',
+                                       sbox.ospath('A_branch'))
+
+
 ########################################################################
 # Run the tests
 
@@ -2332,6 +2398,7 @@ test_list = [ None,
               merge_conflict_details,
               merge_obstruction_recording,
               added_revision_recording_in_tree_conflict,
+              spurios_tree_conflict_with_added_file,
              ]
 
 if __name__ == '__main__':

Modified: 
subversion/branches/authzperf/subversion/tests/cmdline/resolve_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/resolve_tests.py?rev=1764707&r1=1764706&r2=1764707&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/resolve_tests.py 
(original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/resolve_tests.py Thu 
Oct 13 15:25:15 2016
@@ -598,6 +598,76 @@ def multi_range_merge_with_accept(sbox):
   svntest.main.run_svn(None, 'merge', '-c4,3', '^/iota', 'iota',
                        '--accept=theirs-conflict')
 
+#----------------------------------------------------------------------
+
+# Test for issue #4647 'auto resolution mine-full fails on binary file'
+@Issue(4647)
+@XFail()
+def automatic_binary_conflict_resolution(sbox):
+  "resolve -R --accept [base | mf | tf] binary file"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Some paths we'll care about
+  A_COPY_path = os.path.join(wc_dir, "A_COPY")
+
+  # Add a binary file to the project in revision 2.
+  theta_contents = open(os.path.join(sys.path[0], "theta.bin"), 'rb').read()
+  theta_path = sbox.ospath('A/theta')
+  svntest.main.file_write(theta_path, theta_contents, 'wb')
+  svntest.main.run_svn(None, 'add', theta_path)
+  svntest.main.run_svn(None, 'commit', '-m', 'log msg', wc_dir)
+
+  # Branch A to A_COPY in revision 3.
+  svntest.main.run_svn(None, 'copy',  wc_dir + "/A",  A_COPY_path)
+  svntest.main.run_svn(None, 'commit', '-m', 'log msg', wc_dir)
+
+  # Modify the binary file on trunk and in the branch, so that both versions
+  # differ.
+  theta_branch_path = sbox.ospath('A_COPY/theta')
+  svntest.main.file_append_binary(theta_path, theta_contents)
+  svntest.main.run_svn(None, 'commit', '-m', 'log msg', wc_dir)
+  svntest.main.file_append_binary(theta_branch_path, theta_contents)
+  svntest.main.file_append_binary(theta_branch_path, theta_contents)
+  svntest.main.run_svn(None, 'commit', '-m', 'log msg', wc_dir)
+
+  # Run an svn update now to prevent mixed-revision working copy [1:4] error.
+  svntest.main.run_svn(None, 'update', wc_dir)
+
+
+  def do_binary_conflicting_merge():
+    svntest.actions.run_and_verify_svn(None, [],
+                                       'revert', '--recursive', A_COPY_path)
+    svntest.main.run_svn(None, 'merge', sbox.repo_url + "/A/theta",
+                          wc_dir + "/A_COPY/theta")
+
+  # Test 'svn resolve -R --accept base'
+  # Regression until r1758160
+  do_binary_conflicting_merge()
+  svntest.actions.run_and_verify_resolve([theta_branch_path],
+                                         '-R', '--accept', 'base',
+                                         A_COPY_path)
+
+  # Test 'svn resolve -R --accept theirs-full'
+  do_binary_conflicting_merge()
+  svntest.actions.run_and_verify_resolve([theta_branch_path],
+                                         '-R', '--accept', 'tf',
+                                         A_COPY_path)
+
+  # Test 'svn resolve -R --accept working'
+  # Equivalent to 'svn resolved'
+  do_binary_conflicting_merge()
+  svntest.actions.run_and_verify_resolve([theta_branch_path],
+                                         '-R', '--accept', 'working',
+                                         A_COPY_path)
+
+  # Test 'svn resolve -R --accept mine-full'
+  # There is no '.mine' for binary file conflicts. Same handling as 'working'
+  do_binary_conflicting_merge()
+  svntest.actions.run_and_verify_resolve([theta_branch_path],
+                                         '-R', '--accept', 'mine-full',
+                                         A_COPY_path)
 
 ########################################################################
 # Run the tests
@@ -611,6 +681,7 @@ test_list = [ None,
               resolved_on_deleted_item,
               theirs_conflict_in_subdir,
               multi_range_merge_with_accept,
+              automatic_binary_conflict_resolution,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/authzperf/subversion/tests/cmdline/update_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/update_tests.py?rev=1764707&r1=1764706&r2=1764707&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/update_tests.py 
(original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/update_tests.py Thu 
Oct 13 15:25:15 2016
@@ -2720,6 +2720,7 @@ def update_with_obstructing_additions(sb
                                         expected_disk,
                                         expected_status,
                                         [], True,
+                                        '--adds-as-modification', wc_backup,
                                         extra_files=extra_files)
 
   # Some obstructions are still not permitted:
@@ -2830,6 +2831,7 @@ def update_with_obstructing_additions(sb
   svntest.actions.run_and_verify_update(wc_dir, expected_output,
                                         expected_disk, expected_status,
                                         [], False,
+                                        '--adds-as-modification',
                                         A_path)
 
   # Resolve the tree conflict.
@@ -2849,7 +2851,7 @@ def update_with_obstructing_additions(sb
   svntest.actions.run_and_verify_update(wc_dir, expected_output,
                                         expected_disk, expected_status,
                                         [], False,
-                                        wc_dir, '-N')
+                                        wc_dir, '-N', '--adds-as-modification')
 
   # Resolve the tree conflict.
   svntest.main.run_svn(None, 'resolved', omicron_path)
@@ -6633,7 +6635,9 @@ def update_conflict_details(sbox):
                                prev_status='  ', prev_treeconflict='C'),
   })
   svntest.actions.run_and_verify_update(wc_dir, expected_output,
-                                        None, expected_status)
+                                        None, expected_status,
+                                        [], False,
+                                        '--adds-as-modification', wc_dir)
 
   # Update can't pass source as none at a specific URL@revision,
   # because it doesn't know... the working copy could be mixed

Modified: 
subversion/branches/authzperf/subversion/tests/cmdline/upgrade_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/upgrade_tests.py?rev=1764707&r1=1764706&r2=1764707&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/upgrade_tests.py 
(original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/upgrade_tests.py Thu 
Oct 13 15:25:15 2016
@@ -1261,12 +1261,17 @@ def upgrade_not_present_replaced(sbox):
                                      sbox.wc_dir)
 
   expected_output = svntest.wc.State(sbox.wc_dir, {
-      'A/B/E'         : Item(status='E '),
-      'A/B/E/alpha'   : Item(status='A '),
-      'A/B/E/beta'    : Item(status='A '),
-      'A/B/lambda'    : Item(status='E '),
+      'A/B/E'         : Item(status='  ', treeconflict='C'),
+      'A/B/E/beta'    : Item(status='  ', treeconflict='A'),
+      'A/B/E/alpha'   : Item(status='  ', treeconflict='A'),
+      'A/B/lambda'    : Item(status='  ', treeconflict='C'),
       })
   expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+  expected_status.tweak('A/B/E', status='R ', treeconflict='C'),
+  expected_status.tweak('A/B/E/beta', status='D '),
+  expected_status.tweak('A/B/E/alpha', status='D '),
+  expected_status.tweak('A/B/lambda', status='R ', treeconflict='C'),
+
   svntest.actions.run_and_verify_update(sbox.wc_dir, expected_output,
                                         None, expected_status)
 


Reply via email to