You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ka...@apache.org on 2011/03/14 15:24:58 UTC

svn commit: r1081390 - /subversion/trunk/subversion/tests/cmdline/merge_tests.py

Author: kameshj
Date: Mon Mar 14 14:24:58 2011
New Revision: 1081390

URL: http://svn.apache.org/viewvc?rev=1081390&view=rev
Log:
Adds an XFail test to catch regression created by r1075802

* subversion/tests/cmdline/merge_tests.py
  (dry_run_merge_conflicting_binary): New XFail testcase.
  (test_list): Add dry_run_merge_conflicting_binary.

Patch by: Arwin Arni <arwin{_AT_}collab.net>

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

Modified: subversion/trunk/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_tests.py?rev=1081390&r1=1081389&r2=1081390&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_tests.py Mon Mar 14 14:24:58 2011
@@ -16580,6 +16580,102 @@ def merge_change_to_file_with_executable
   if not os.access(beta_path, os.X_OK):
     raise svntest.Failure("beta is not marked as executable after commit")
 
+@XFail()
+def dry_run_merge_conflicting_binary(sbox):
+  "dry run shouldn't make conflict resoln files"
+
+  # This test-case is to showcase the regression caused by
+  # r1075802. Here is the link to the relevant discussion:
+  # http://svn.haxx.se/dev/archive-2011-03/0145.shtml
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  # Add a binary file to the project
+  theta_contents = open(os.path.join(sys.path[0], "theta.bin"), 'rb').read()
+  # Write PNG file data into 'A/theta'.
+  theta_path = os.path.join(wc_dir, 'A', 'theta')
+  svntest.main.file_write(theta_path, theta_contents, 'wb')
+
+  svntest.main.run_svn(None, 'add', theta_path)
+
+  # Commit the new binary file, creating revision 2.
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/theta' : Item(verb='Adding  (bin)'),
+    })
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.add({
+    'A/theta' : Item(status='  ', wc_rev=2),
+    })
+  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+                                        expected_status, None,
+                                        wc_dir)
+
+  # Make the "other" working copy
+  other_wc = sbox.add_wc_path('other')
+  svntest.actions.duplicate_dir(wc_dir, other_wc)
+
+  # Change the binary file in first working copy, commit revision 3.
+  svntest.main.file_append(theta_path, "some extra junk")
+  expected_output = wc.State(wc_dir, {
+    'A/theta' : Item(verb='Sending'),
+    })
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.add({
+    'A/theta' : Item(status='  ', wc_rev=3),
+    })
+  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+                                        expected_status, None,
+                                        wc_dir)
+
+  # In second working copy, append different content to the binary
+  # and attempt to 'svn merge -r 2:3'.
+  # We should see a conflict during the merge.
+  other_theta_path = os.path.join(other_wc, 'A', 'theta')
+  svntest.main.file_append(other_theta_path, "some other junk")
+  expected_output = wc.State(other_wc, {
+    'A/theta' : Item(status='C '),
+    })
+  expected_mergeinfo_output = wc.State(other_wc, {
+    '' : Item(status=' U'),
+    })
+  expected_elision_output = wc.State(other_wc, {
+    })
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.add({
+    ''        : Item(props={SVN_PROP_MERGEINFO : '/:3'}),
+    'A/theta' : Item(theta_contents + "some other junk",
+                     props={'svn:mime-type' : 'application/octet-stream'}),
+    })
+
+  # verify content of base(left) file
+  expected_disk.add({
+  'A/theta.merge-left.r2' :
+    Item(contents = theta_contents )
+  })
+  # verify content of theirs(right) file
+  expected_disk.add({
+  'A/theta.merge-right.r3' :
+    Item(contents= theta_contents + "some extra junk")
+  })
+
+  expected_status = svntest.actions.get_virginal_state(other_wc, 1)
+  expected_status.add({
+    ''        : Item(status=' M', wc_rev=1),
+    'A/theta' : Item(status='C ', wc_rev=2),
+    })
+  expected_skip = wc.State('', { })
+
+  svntest.actions.run_and_verify_merge(other_wc, '2', '3',
+                                       sbox.repo_url, None,
+                                       expected_output,
+                                       expected_mergeinfo_output,
+                                       expected_elision_output,
+                                       expected_disk,
+                                       expected_status,
+                                       expected_skip,
+                                       None, None, None, None, None,
+                                       True, True, '--allow-mixed-revisions',
+                                       other_wc)
 ########################################################################
 # Run the tests
 
@@ -16702,6 +16798,7 @@ test_list = [ None,
               no_self_referential_or_nonexistent_inherited_mergeinfo,
               subtree_merges_inherit_invalid_working_mergeinfo,
               merge_change_to_file_with_executable,
+              dry_run_merge_conflicting_binary,
              ]
 
 if __name__ == '__main__':



Re: svn commit: r1081390 - /subversion/trunk/subversion/tests/cmdline/merge_tests.py

Posted by Stefan Sperling <st...@elego.de>.
On Mon, Mar 14, 2011 at 02:24:58PM -0000, kameshj@apache.org wrote:
> Author: kameshj
> Date: Mon Mar 14 14:24:58 2011
> New Revision: 1081390
> 
> URL: http://svn.apache.org/viewvc?rev=1081390&view=rev
> Log:
> Adds an XFail test to catch regression created by r1075802
> 
> * subversion/tests/cmdline/merge_tests.py
>   (dry_run_merge_conflicting_binary): New XFail testcase.
>   (test_list): Add dry_run_merge_conflicting_binary.
> 
> Patch by: Arwin Arni <arwin{_AT_}collab.net>
> 
> Modified:
>     subversion/trunk/subversion/tests/cmdline/merge_tests.py

This test prints garbage (i.e. non-UTF-8) to the screen in UTF-8 terminals.

Is there a way to prevent it from showing the expected content of
a binary file?

Excerpt of output (which might look different on your screen than
it does on mine, but whatever):

Couldn't find node 'theta.merge-left.r2' in expected disk tree
 * Node name:   theta.merge-left.r2
    Path:       __SVN_ROOT_NODE/A/theta.merge-left.r2
    Contents:   [
]
[������������������]
[
]
[������������������]
[
]
[������������������]
[
]
[������������������]
[
]
[������������������]
[
]
[������������������]
[
]
[������������������]
[
]


Re: svn commit: r1081390 - /subversion/trunk/subversion/tests/cmdline/merge_tests.py

Posted by Kamesh Jayachandran <ka...@collab.net>.
On 03/14/2011 08:18 PM, Stefan Sperling wrote:
> On Mon, Mar 14, 2011 at 02:24:58PM -0000, kameshj@apache.org wrote:
>> Author: kameshj
>> Date: Mon Mar 14 14:24:58 2011
>> New Revision: 1081390
>>
>> URL: http://svn.apache.org/viewvc?rev=1081390&view=rev
>> Log:
>> Adds an XFail test to catch regression created by r1075802
>>
>> * subversion/tests/cmdline/merge_tests.py
>>    (dry_run_merge_conflicting_binary): New XFail testcase.
>>    (test_list): Add dry_run_merge_conflicting_binary.
>>
>> Patch by: Arwin Arni<arwin{_AT_}collab.net>
>>
>> Modified:
>>      subversion/trunk/subversion/tests/cmdline/merge_tests.py
>> +@XFail()
>> +def dry_run_merge_conflicting_binary(sbox):
>> +  "dry run shouldn't make conflict resoln files"
>                                         ^^^^^
> typo?

Thanks Stefan. Fixed in r1081703.

With regards
Kamesh Jayachandran

Re: svn commit: r1081390 - /subversion/trunk/subversion/tests/cmdline/merge_tests.py

Posted by Stefan Sperling <st...@elego.de>.
On Mon, Mar 14, 2011 at 02:24:58PM -0000, kameshj@apache.org wrote:
> Author: kameshj
> Date: Mon Mar 14 14:24:58 2011
> New Revision: 1081390
> 
> URL: http://svn.apache.org/viewvc?rev=1081390&view=rev
> Log:
> Adds an XFail test to catch regression created by r1075802
> 
> * subversion/tests/cmdline/merge_tests.py
>   (dry_run_merge_conflicting_binary): New XFail testcase.
>   (test_list): Add dry_run_merge_conflicting_binary.
> 
> Patch by: Arwin Arni <arwin{_AT_}collab.net>
> 
> Modified:
>     subversion/trunk/subversion/tests/cmdline/merge_tests.py

> +@XFail()
> +def dry_run_merge_conflicting_binary(sbox):
> +  "dry run shouldn't make conflict resoln files"
                                       ^^^^^
typo?