Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/patch_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/patch_tests.py?rev=1655189&r1=1655188&r2=1655189&view=diff ============================================================================== --- subversion/branches/svn-auth-x509/subversion/tests/cmdline/patch_tests.py (original) +++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/patch_tests.py Tue Jan 27 23:27:44 2015 @@ -4946,6 +4946,122 @@ def patch_hunk_reorder(sbox): expected_output, expected_disk, expected_status, expected_skip) + # In the following case the reordered hunk2 is smaller offset + # magnitude than hunk2 at the end and the reorder is preferred. + sbox.simple_revert('A/mu') + sbox.simple_append('A/mu', + 'x\n' * 2 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n' + + 'x\n' * 2 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n' + + 'x\n' * 10 + + '1\n' '2\n' '3\n' 'hunk1\n' '4\n' '5\n' '6\n' + + 'x\n' * 100 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n', + truncate=True) + sbox.simple_commit() + + unidiff_patch = [ + "Index: A/mu\n" + "===================================================================\n", + "--- A/mu\t(revision 2)\n", + "+++ A/mu\t(working copy)\n", + "@@ -28,7 +28,7 @@\n", + " 1\n", + " 2\n", + " 3\n", + "-hunk1\n", + "+hunk1-mod\n", + " 4\n", + " 5\n", + " 6\n", + "@@ -44,7 +44,7 @@\n", + " 1\n", + " 2\n", + " 3\n", + "-hunk2\n", + "+hunk2-mod\n", + " 4\n", + " 5\n", + " 6\n", + ] + + patch_file_path = make_patch_path(sbox) + svntest.main.file_write(patch_file_path, ''.join(unidiff_patch)) + + expected_output = [ + 'U %s\n' % sbox.ospath('A/mu'), + '> applied hunk @@ -44,7 +44,7 @@ with offset -32\n', + '> applied hunk @@ -28,7 +28,7 @@ with offset 1\n', + ] + expected_disk.tweak('A/mu', contents= + 'x\n' * 2 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n' + + 'x\n' * 2 + + '1\n' '2\n' '3\n' 'hunk2-mod\n' '4\n' '5\n' '6\n' + + 'x\n' * 10 + + '1\n' '2\n' '3\n' 'hunk1-mod\n' '4\n' '5\n' '6\n' + + 'x\n' * 100 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n') + + expected_status.tweak('A/mu', status='M ', wc_rev=3) + expected_skip = wc.State('', { }) + svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path), + expected_output, expected_disk, + expected_status, expected_skip) + sbox.simple_revert('A/mu') + + # In this case the reordered hunk2 is further than hunk2 at the end + # and the reordered is not preferred. + unidiff_patch = [ + "Index: A/mu\n" + "===================================================================\n", + "--- A/mu\t(revision 2)\n", + "+++ A/mu\t(working copy)\n", + "@@ -28,7 +28,7 @@\n", + " 1\n", + " 2\n", + " 3\n", + "-hunk1\n", + "+hunk1-mod\n", + " 4\n", + " 5\n", + " 6\n", + "@@ -110,7 +110,7 @@\n", + " 1\n", + " 2\n", + " 3\n", + "-hunk2\n", + "+hunk2-mod\n", + " 4\n", + " 5\n", + " 6\n", + ] + + patch_file_path = make_patch_path(sbox) + svntest.main.file_write(patch_file_path, ''.join(unidiff_patch)) + + expected_output = [ + 'U %s\n' % sbox.ospath('A/mu'), + '> applied hunk @@ -28,7 +28,7 @@ with offset 1\n', + '> applied hunk @@ -110,7 +110,7 @@ with offset 26\n', + ] + expected_disk.tweak('A/mu', contents= + 'x\n' * 2 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n' + + 'x\n' * 2 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n' + + 'x\n' * 10 + + '1\n' '2\n' '3\n' 'hunk1-mod\n' '4\n' '5\n' '6\n' + + 'x\n' * 100 + + '1\n' '2\n' '3\n' 'hunk2-mod\n' '4\n' '5\n' '6\n') + + expected_status.tweak('A/mu', status='M ', wc_rev=3) + expected_skip = wc.State('', { }) + svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path), + expected_output, expected_disk, + expected_status, expected_skip) + @XFail() def patch_hunk_overlap(sbox): """hunks that overlap""" @@ -5079,6 +5195,251 @@ def patch_delete_modified(sbox): expected_output, expected_disk, expected_status, expected_skip) +def patch_closest(sbox): + "find closest hunk" + + sbox.build() + wc_dir = sbox.wc_dir + + unidiff_patch = [ + "Index: A/mu\n" + "===================================================================\n", + "--- A/mu\t(revision 2)\n", + "+++ A/mu\t(working copy)\n", + "@@ -47,7 +47,7 @@\n", + " 1\n", + " 2\n", + " 3\n", + "-hunk1\n", + "+hunk1-mod\n", + " 4\n", + " 5\n", + " 6\n", + "@@ -66,7 +66,7 @@\n", + " 1\n", + " 2\n", + " 3\n", + "-rejected-hunk2-\n", + "+rejected-hunk2-mod\n", + " 4\n", + " 5\n", + " 6\n", + "@@ -180,7 +180,7 @@\n", + " 1\n", + " 2\n", + " 3\n", + "-hunk3\n", + "+hunk3-mod\n", + " 4\n", + " 5\n", + " 6\n", + ] + patch_file_path = make_patch_path(sbox) + svntest.main.file_write(patch_file_path, ''.join(unidiff_patch)) + + # Previous offset for hunk3 is +4, hunk3 matches at relative offsets + # of -19 and +18, prefer +18 gives final offset +22 + sbox.simple_append('A/mu', + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk1\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk3\n' '4\n' '5\n' '6\n' + + 'x\n' * 30 + + '1\n' '2\n' '3\n' 'hunk3\n' '4\n' '5\n' '6\n' + + 'x\n' * 10, + truncate=True) + sbox.simple_commit() + + expected_output = [ + 'C %s\n' % sbox.ospath('A/mu'), + '> applied hunk @@ -47,7 +47,7 @@ with offset 4\n', + '> applied hunk @@ -180,7 +180,7 @@ with offset 22\n', + '> rejected hunk @@ -66,7 +66,7 @@\n', + ] + svntest.main.summary_of_conflicts(text_conflicts=1) + expected_disk = svntest.main.greek_state.copy() + expected_disk.add({'A/mu.svnpatch.rej' : Item(contents= + "--- A/mu\n" + + "+++ A/mu\n" + + "@@ -66,7 +66,7 @@\n" + + " 1\n" + + " 2\n" + + " 3\n" + + "-rejected-hunk2-\n" + + "+rejected-hunk2-mod\n" + + " 4\n" + + " 5\n" + + " 6\n")}) + expected_disk.tweak('A/mu', contents= + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk1-mod\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk3\n' '4\n' '5\n' '6\n' + + 'x\n' * 30 + + '1\n' '2\n' '3\n' 'hunk3-mod\n' '4\n' '5\n' '6\n' + + 'x\n' * 10) + expected_status = svntest.actions.get_virginal_state(wc_dir, 1) + expected_status.tweak('A/mu', status='M ', wc_rev=2) + expected_skip = wc.State('', { }) + svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path), + expected_output, expected_disk, + expected_status, expected_skip) + + # Previous offset for hunk3 is +4, hunk3 matches at relative offsets + # of -19 and +20, prefer -19 gives final offset -15 + sbox.simple_append('A/mu', + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk1\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk3\n' '4\n' '5\n' '6\n' + + 'x\n' * 32 + + '1\n' '2\n' '3\n' 'hunk3\n' '4\n' '5\n' '6\n' + + 'x\n' * 10, + truncate=True) + sbox.simple_commit() + + expected_output = [ + 'C %s\n' % sbox.ospath('A/mu'), + '> applied hunk @@ -47,7 +47,7 @@ with offset 4\n', + '> applied hunk @@ -180,7 +180,7 @@ with offset -15\n', + '> rejected hunk @@ -66,7 +66,7 @@\n', + ] + svntest.main.summary_of_conflicts(text_conflicts=1) + expected_disk.tweak('A/mu', contents= + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk1-mod\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk3-mod\n' '4\n' '5\n' '6\n' + + 'x\n' * 32 + + '1\n' '2\n' '3\n' 'hunk3\n' '4\n' '5\n' '6\n' + + 'x\n' * 10) + expected_status = svntest.actions.get_virginal_state(wc_dir, 1) + expected_status.tweak('A/mu', status='M ', wc_rev=3) + expected_skip = wc.State('', { }) + svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path), + expected_output, expected_disk, + expected_status, expected_skip) + + # Previous offset for hunk3 is +4, hunk3 matches at relative offsets + # of -19 and +19, prefer -19 gives final offset -15 + sbox.simple_append('A/mu', + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk1\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk3\n' '4\n' '5\n' '6\n' + + 'x\n' * 31 + + '1\n' '2\n' '3\n' 'hunk3\n' '4\n' '5\n' '6\n' + + 'x\n' * 10, + truncate=True) + sbox.simple_commit() + + expected_output = [ + 'C %s\n' % sbox.ospath('A/mu'), + '> applied hunk @@ -47,7 +47,7 @@ with offset 4\n', + '> applied hunk @@ -180,7 +180,7 @@ with offset -15\n', + '> rejected hunk @@ -66,7 +66,7 @@\n', + ] + svntest.main.summary_of_conflicts(text_conflicts=1) + expected_disk.tweak('A/mu', contents= + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk1-mod\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk3-mod\n' '4\n' '5\n' '6\n' + + 'x\n' * 31 + + '1\n' '2\n' '3\n' 'hunk3\n' '4\n' '5\n' '6\n' + + 'x\n' * 10) + expected_status = svntest.actions.get_virginal_state(wc_dir, 1) + expected_status.tweak('A/mu', status='M ', wc_rev=4) + expected_skip = wc.State('', { }) + svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path), + expected_output, expected_disk, + expected_status, expected_skip) + + # Previous offset for hunk3 is +4, hunk3 matches at relative offsets + # of +173 and -173, prefer +173 gives final offset +177 + sbox.simple_append('A/mu', + 'x\n' * 10 + + '1\n' '2\n' '3\n' 'hunk3\n' '4\n' '5\n' '6\n' + + 'x\n' * 33 + + '1\n' '2\n' '3\n' 'hunk1\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n' + + 'x\n' * 242 + + '1\n' '2\n' '3\n' 'hunk3\n' '4\n' '5\n' '6\n' + + 'x\n' * 10, + truncate=True) + sbox.simple_commit() + + expected_output = [ + 'C %s\n' % sbox.ospath('A/mu'), + '> applied hunk @@ -47,7 +47,7 @@ with offset 4\n', + '> applied hunk @@ -180,7 +180,7 @@ with offset 177\n', + '> rejected hunk @@ -66,7 +66,7 @@\n', + ] + svntest.main.summary_of_conflicts(text_conflicts=1) + expected_disk.tweak('A/mu', contents= + 'x\n' * 10 + + '1\n' '2\n' '3\n' 'hunk3\n' '4\n' '5\n' '6\n' + + 'x\n' * 33 + + '1\n' '2\n' '3\n' 'hunk1-mod\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n' + + 'x\n' * 242 + + '1\n' '2\n' '3\n' 'hunk3-mod\n' '4\n' '5\n' '6\n' + + 'x\n' * 10) + expected_status = svntest.actions.get_virginal_state(wc_dir, 1) + expected_status.tweak('A/mu', status='M ', wc_rev=5) + expected_skip = wc.State('', { }) + svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path), + expected_output, expected_disk, + expected_status, expected_skip) + + # Previous offset for hunk3 is +4, hunk3 matches at relative offsets + # of +174 and -173, prefer -173 gives final offset -169 + sbox.simple_append('A/mu', + 'x\n' * 10 + + '1\n' '2\n' '3\n' 'hunk3\n' '4\n' '5\n' '6\n' + + 'x\n' * 33 + + '1\n' '2\n' '3\n' 'hunk1\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n' + + 'x\n' * 243 + + '1\n' '2\n' '3\n' 'hunk3\n' '4\n' '5\n' '6\n' + + 'x\n' * 10, + truncate=True) + sbox.simple_commit() + + expected_output = [ + 'C %s\n' % sbox.ospath('A/mu'), + '> applied hunk @@ -180,7 +180,7 @@ with offset -169\n', + '> applied hunk @@ -47,7 +47,7 @@ with offset 4\n', + '> rejected hunk @@ -66,7 +66,7 @@\n', + ] + svntest.main.summary_of_conflicts(text_conflicts=1) + expected_disk.tweak('A/mu', contents= + 'x\n' * 10 + + '1\n' '2\n' '3\n' 'hunk3-mod\n' '4\n' '5\n' '6\n' + + 'x\n' * 33 + + '1\n' '2\n' '3\n' 'hunk1-mod\n' '4\n' '5\n' '6\n' + + 'x\n' * 50 + + '1\n' '2\n' '3\n' 'hunk2\n' '4\n' '5\n' '6\n' + + 'x\n' * 243 + + '1\n' '2\n' '3\n' 'hunk3\n' '4\n' '5\n' '6\n' + + 'x\n' * 10) + expected_status = svntest.actions.get_virginal_state(wc_dir, 1) + expected_status.tweak('A/mu', status='M ', wc_rev=6) + expected_skip = wc.State('', { }) + svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path), + expected_output, expected_disk, + expected_status, expected_skip) + ######################################################################## #Run the tests @@ -5137,6 +5498,7 @@ test_list = [ None, patch_hunk_reorder, patch_hunk_overlap, patch_delete_modified, + patch_closest, ] if __name__ == '__main__':
Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/prop_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/prop_tests.py?rev=1655189&r1=1655188&r2=1655189&view=diff ============================================================================== --- subversion/branches/svn-auth-x509/subversion/tests/cmdline/prop_tests.py (original) +++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/prop_tests.py Tue Jan 27 23:27:44 2015 @@ -2619,7 +2619,6 @@ def peg_rev_base_working(sbox): sbox.ospath('iota') + '@BASE') @Issue(4415) -@XFail(svntest.main.is_ra_type_dav) def xml_unsafe_author(sbox): "svn:author with XML unsafe chars" @@ -2646,22 +2645,70 @@ def xml_unsafe_author(sbox): # mod_dav_svn sends svn:author (via PROPFIND for DAV) # Since r1553367 this works correctly on ra_serf, since we now request - # a single property value which somehow triggers different behavior + # a single property value which skips creating the creator-displayname property svntest.actions.run_and_verify_svn(None, ['foo\bbar'], [], 'propget', '--revprop', '-r', '1', 'svn:author', '--strict', wc_dir) + # Ensure a stable date + svntest.actions.run_and_verify_svn(None, None, [], + 'propset', '--revprop', '-r', '1', + 'svn:date', '2015-01-01T00:00:00.0Z', wc_dir) + # But a proplist of this property value still fails via DAV. - expected_output = [ + expected_output = svntest.verify.UnorderedOutput([ 'Unversioned properties on revision 1:\n', ' svn:author\n', + ' foo\bbar\n', ' svn:date\n', - ' svn:log\n' - ] + ' 2015-01-01T00:00:00.0Z\n', + ' svn:log\n', + ' Log message for revision 1.\n' + ]) svntest.actions.run_and_verify_svn(None, expected_output, [], - 'proplist', '--revprop', '-r', '1', + 'proplist', '--revprop', '-r', '1', '-v', wc_dir) +@Issue(4415) +def xml_unsafe_author2(sbox): + "svn:author with XML unsafe chars 2" + + sbox.build(create_wc = False) + repo_url = sbox.repo_url + + svntest.actions.enable_revprop_changes(sbox.repo_dir) + + # client sends svn:author (via PROPPATCH for DAV) + svntest.actions.run_and_verify_svn(None, None, [], + 'propset', '--revprop', '-r', '1', + 'svn:author', 'foo\bbar', repo_url) + + # Ensure a stable date + svntest.actions.run_and_verify_svn(None, None, [], + 'propset', '--revprop', '-r', '1', + 'svn:date', '2000-01-01T12:00:00.0Z', + repo_url) + + if svntest.main.is_ra_type_dav(): + # This receives the filtered author (but that is better than an Xml fail) + expected_author = 'foobar' + else: + expected_author = 'foo\bbar' + + expected_output = svntest.verify.UnorderedOutput([ + ' 1 %-8s Jan 01 2000 ./\n' % expected_author, + ' 1 %-8s Jan 01 2000 A/\n' % expected_author, + ' 1 %-8s 25 Jan 01 2000 iota\n' % expected_author + ]) + svntest.actions.run_and_verify_svn(None, expected_output, [], + 'ls', '-v', repo_url) + + expected_info = [{ + 'Repository Root' : sbox.repo_url, + 'Last Changed Author' : expected_author, + }] + svntest.actions.run_and_verify_info(expected_info, repo_url) + def dir_prop_conflict_details(sbox): "verify dir property conflict details" @@ -2814,6 +2861,7 @@ test_list = [ None, almost_known_prop_names, peg_rev_base_working, xml_unsafe_author, + xml_unsafe_author2, dir_prop_conflict_details, iprops_list_abspath, wc_propop_on_url, Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/svnrdump_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/svnrdump_tests.py?rev=1655189&r1=1655188&r2=1655189&view=diff ============================================================================== --- subversion/branches/svn-auth-x509/subversion/tests/cmdline/svnrdump_tests.py (original) +++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/svnrdump_tests.py Tue Jan 27 23:27:44 2015 @@ -825,60 +825,78 @@ def load_mergeinfo_contains_r0(sbox): # Regression test for issue 4551 "svnrdump load commits wrong properties, # or fails, on a non-deltas dumpfile". In this test, the copy source does # not exist and the failure mode is to error out. -@XFail() @Issue(4551) def load_non_deltas_copy_with_props(sbox): "load non-deltas copy with props" sbox.build() - # Set props on a file and on a dir and on a child of the dir to be copied + # Case (1): Copies that do not replace anything: the copy target path + # at (new rev - 1) does not exist + + # Set properties on each node to be copied sbox.simple_propset('p', 'v', 'A/mu', 'A/B', 'A/B/E') + sbox.simple_propset('q', 'v', 'A/mu', 'A/B', 'A/B/E') sbox.simple_commit() sbox.simple_update() # avoid mixed-rev - # Case (1): Copy file/dir, not replacing anything; the copy target path - # at (new rev - 1) does not exist + # Do the copies sbox.simple_copy('A/mu@2', 'A/mu_COPY') sbox.simple_copy('A/B@2', 'A/B_COPY') - # On the copy, delete a prop - sbox.simple_propdel('p', 'A/mu_COPY', 'A/B_COPY', 'A/B_COPY/E') + # Also add new nodes inside the copied dir, to test more code paths + sbox.simple_copy('A/B/E@2', 'A/B_COPY/copied') + sbox.simple_mkdir('A/B_COPY/added') + sbox.simple_copy('A/B/E@2', 'A/B_COPY/added/copied') + # On each copied node, delete a prop + sbox.simple_propdel('p', 'A/mu_COPY', 'A/B_COPY', 'A/B_COPY/E', + 'A/B_COPY/copied', 'A/B_COPY/added/copied') sbox.simple_commit() # Dump with 'svnadmin' (non-deltas mode) dumpfile = svntest.actions.run_and_verify_dump(sbox.repo_dir, deltas=False) - # Load with 'svnrdump' + # Load with 'svnrdump'. This used to throw an error: + # svnrdump: E160013: File not found: revision 2, path '/A/B_COPY' new_repo_dir, new_repo_url = sbox.add_repo_path('new_repo') svntest.main.create_repos(new_repo_dir) svntest.actions.enable_revprop_changes(new_repo_dir) svntest.actions.run_and_verify_svnrdump(dumpfile, svntest.verify.AnyOutput, [], 0, 'load', new_repo_url) - # For regression test purposes, all we require is that the 'load' - # doesn't throw an error + + # Check that property 'p' really was deleted on each copied node + for tgt_path in ['A/mu_COPY', 'A/B_COPY', 'A/B_COPY/E', + 'A/B_COPY/copied', 'A/B_COPY/added/copied']: + tgt_url = new_repo_url + '/' + tgt_path + _, out, _ = svntest.main.run_svn(None, 'proplist', tgt_url) + expected = ["Properties on '%s':" % (tgt_url,), + 'q'] + actual = map(str.strip, out) + svntest.verify.compare_and_display_lines(None, 'PROPS', expected, actual) # Regression test for issue 4551 "svnrdump load commits wrong properties, # or fails, on a non-deltas dumpfile". In this test, the copy source does # exist and the failure mode is to fail to delete a property. -@XFail() @Issue(4551) def load_non_deltas_replace_copy_with_props(sbox): "load non-deltas replace© with props" sbox.build() - # Set props on a file and on a dir - sbox.simple_propset('p', 'v', 'A/mu', 'A/B') + # Case (2): Copies that replace something: the copy target path + # at (new rev - 1) exists and has no property named 'p' + + # Set props on the copy source nodes (a file, a dir, a child of the dir) + sbox.simple_propset('p', 'v', 'A/mu', 'A/B', 'A/B/E') + sbox.simple_propset('q', 'v', 'A/mu', 'A/B', 'A/B/E') sbox.simple_commit() sbox.simple_update() # avoid mixed-rev - # Case (2): Copy file/dir, replacing something; the copy target path - # at (new rev - 1) exists and has no property named 'p' + # Do the copies, replacing something sbox.simple_rm('A/D/gamma', 'A/C') sbox.simple_copy('A/mu@2', 'A/D/gamma') sbox.simple_copy('A/B@2', 'A/C') - # On the copy, delete a prop that isn't present on the replaced node - sbox.simple_propdel('p', 'A/D/gamma', 'A/C') + # On the copy, delete a prop that wasn't present on the node that it replaced + sbox.simple_propdel('p', 'A/D/gamma', 'A/C', 'A/C/E') sbox.simple_commit() @@ -894,11 +912,82 @@ def load_non_deltas_replace_copy_with_pr [], 0, 'load', new_repo_url) # Check that property 'p' really was deleted on each copied node - for tgt_path in ['A/D/gamma', 'A/C']: - _, out, _ = svntest.main.run_svn(None, 'proplist', - new_repo_url + '/' + tgt_path) - expected = [] - actual = out[1:] + # This used to fail, finding that property 'p' was still present + for tgt_path in ['A/D/gamma', 'A/C', 'A/C/E']: + tgt_url = new_repo_url + '/' + tgt_path + _, out, _ = svntest.main.run_svn(None, 'proplist', tgt_url) + expected = ["Properties on '%s':" % (tgt_url,), + 'q'] + actual = map(str.strip, out) + svntest.verify.compare_and_display_lines(None, 'PROPS', expected, actual) + +# Regression test for issue #4552 "svnrdump writes duplicate headers for a +# replace-with-copy". 'svnrdump dump' wrote the Node-path and Node-kind +# headers twice for the 'delete' record of a replace-with-copy. +@Issue(4552) +def dump_replace_with_copy(sbox): + "dump replace with copy" + sbox.build() + + # Copy file/dir, replacing something + sbox.simple_rm('A/D/gamma', 'A/C') + sbox.simple_copy('A/mu@1', 'A/D/gamma') + sbox.simple_copy('A/B@1', 'A/C') + sbox.simple_commit() + + # Dump with 'svnrdump' + dumpfile = svntest.actions.run_and_verify_svnrdump( + None, svntest.verify.AnyOutput, [], 0, + 'dump', '--quiet', '--incremental', '-r2', + sbox.repo_url) + + # Check the 'delete' record headers: expect this parse to fail if headers + # are duplicated + svntest.verify.DumpParser(dumpfile).parse() + +# Regression test for issue 4551 "svnrdump load commits wrong properties, +# or fails, on a non-deltas dumpfile". In this test, a node's props are +# modified, and the failure mode is that RA-serf would end up deleting +# properties that should remain on the node. +@Issue(4551) +def load_non_deltas_with_props(sbox): + "load non-deltas with props" + sbox.build() + + # Case (3): A node's props are modified, and at least one of its previous + # props remains after the modification. svnrdump made two prop mod method + # calls for the same property (delete, then set). RA-serf's commit editor + # didn't expect this and performed the deletes after the non-deletes, and + # so ended up deleting a property that should not be deleted. + + # Set properties on each node to be modified + sbox.simple_propset('p', 'v', 'A/mu') + sbox.simple_propset('q', 'v', 'A/mu', 'A/B') + sbox.simple_commit() + + # Do the modifications: a different kind of mod on each node + sbox.simple_propdel('p', 'A/mu') + sbox.simple_propset('q', 'v2', 'A/B') + sbox.simple_commit() + + # Dump with 'svnadmin' (non-deltas mode) + dumpfile = svntest.actions.run_and_verify_dump(sbox.repo_dir, deltas=False) + + # Load with 'svnrdump' + new_repo_dir, new_repo_url = sbox.add_repo_path('new_repo') + svntest.main.create_repos(new_repo_dir) + svntest.actions.enable_revprop_changes(new_repo_dir) + svntest.actions.run_and_verify_svnrdump(dumpfile, + svntest.verify.AnyOutput, + [], 0, 'load', new_repo_url) + + # Check that property 'q' remains on each modified node + for tgt_path in ['A/mu', 'A/B']: + tgt_url = new_repo_url + '/' + tgt_path + _, out, _ = svntest.main.run_svn(None, 'proplist', tgt_url) + expected = ["Properties on '%s':" % (tgt_url,), + 'q'] + actual = map(str.strip, out) svntest.verify.compare_and_display_lines(None, 'PROPS', expected, actual) ######################################################################## @@ -960,6 +1049,8 @@ test_list = [ None, load_mergeinfo_contains_r0, load_non_deltas_copy_with_props, load_non_deltas_replace_copy_with_props, + dump_replace_with_copy, + load_non_deltas_with_props, ] if __name__ == '__main__': Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/svntest/verify.py URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/svntest/verify.py?rev=1655189&r1=1655188&r2=1655189&view=diff ============================================================================== --- subversion/branches/svn-auth-x509/subversion/tests/cmdline/svntest/verify.py (original) +++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/svntest/verify.py Tue Jan 27 23:27:44 2015 @@ -491,6 +491,22 @@ class DumpParser: self.current += 1 return True + def parse_header(self, header): + regex = '([^:]*): (.*)$' + m = re.match(regex, self.lines[self.current]) + if not m: + raise SVNDumpParseError("expected a header at line %d, but found:\n%s" + % (self.current, self.lines[self.current])) + self.current += 1 + return m.groups() + + def parse_headers(self): + headers = [] + while self.lines[self.current] != '\n': + key, val = self.parse_header(self) + headers.append((key, val)) + return headers + def parse_format(self): return self.parse_line('SVN-fs-dump-format-version: ([0-9]+)$') @@ -590,17 +606,43 @@ class DumpParser: def parse_one_node(self): node = {} + + # optional 'kind' and required 'action' must be next node['kind'] = self.parse_kind() action = self.parse_action() - node['copyfrom_rev'] = self.parse_copyfrom_rev() - node['copyfrom_path'] = self.parse_copyfrom_path() - node['copy_md5'] = self.parse_copy_md5() - node['copy_sha1'] = self.parse_copy_sha1() - node['prop_length'] = self.parse_prop_length(required=False) - node['text_length'] = self.parse_text_length() - node['text_md5'] = self.parse_text_md5() - node['text_sha1'] = self.parse_text_sha1() - node['content_length'] = self.parse_content_length(required=False) + + # read any remaining headers + headers_list = self.parse_headers() + headers = dict(headers_list) + + # Content-length must be last, if present + if 'Content-length' in headers and headers_list[-1][0] != 'Content-length': + raise SVNDumpParseError("'Content-length' header is not last, " + "in header block ending at line %d" + % (self.current,)) + + # parse the remaining optional headers and store in specific keys in NODE + for key, header, regex in [ + ('copyfrom_rev', 'Node-copyfrom-rev', '([0-9]+)$'), + ('copyfrom_path', 'Node-copyfrom-path', '(.*)$'), + ('copy_md5', 'Text-copy-source-md5', '([0-9a-z]+)$'), + ('copy_sha1', 'Text-copy-source-sha1','([0-9a-z]+)$'), + ('prop_length', 'Prop-content-length', '([0-9]+)$'), + ('text_length', 'Text-content-length', '([0-9]+)$'), + ('text_md5', 'Text-content-md5', '([0-9a-z]+)$'), + ('text_sha1', 'Text-content-sha1', '([0-9a-z]+)$'), + ('content_length', 'Content-length', '([0-9]+)$'), + ]: + if not header in headers: + node[key] = None + continue + m = re.match(regex, headers[header]) + if not m: + raise SVNDumpParseError("expected '%s' at line %d\n%s" + % (regex, self.current, + self.lines[self.current])) + node[key] = m.group(1) + self.parse_blank() if node['prop_length']: node['props'] = self.get_props() Modified: subversion/branches/svn-auth-x509/subversion/tests/libsvn_diff/parse-diff-test.c URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/libsvn_diff/parse-diff-test.c?rev=1655189&r1=1655188&r2=1655189&view=diff ============================================================================== --- subversion/branches/svn-auth-x509/subversion/tests/libsvn_diff/parse-diff-test.c (original) +++ subversion/branches/svn-auth-x509/subversion/tests/libsvn_diff/parse-diff-test.c Tue Jan 27 23:27:44 2015 @@ -667,7 +667,7 @@ test_parse_property_diff(apr_pool_t *poo prop_patch = apr_hash_get(patch->prop_patches, "prop_add", APR_HASH_KEY_STRING); - SVN_TEST_ASSERT(!strcmp("prop_add", prop_patch->name)); + SVN_TEST_STRING_ASSERT(prop_patch->name, "prop_add"); SVN_TEST_ASSERT(prop_patch->operation == svn_diff_op_added); hunks = prop_patch->hunks; Modified: subversion/branches/svn-auth-x509/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c?rev=1655189&r1=1655188&r2=1655189&view=diff ============================================================================== --- subversion/branches/svn-auth-x509/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c (original) +++ subversion/branches/svn-auth-x509/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c Tue Jan 27 23:27:44 2015 @@ -25,8 +25,11 @@ #include <apr_pools.h> #include "../svn_test.h" +#include "../../libsvn_fs/fs-loader.h" #include "../../libsvn_fs_fs/fs.h" #include "../../libsvn_fs_fs/fs_fs.h" +#include "../../libsvn_fs_fs/low_level.h" +#include "../../libsvn_fs_fs/util.h" #include "svn_hash.h" #include "svn_pools.h" @@ -1243,6 +1246,132 @@ id_parser_test(const svn_test_opts_t *op #undef REPO_NAME +/* ------------------------------------------------------------------------ */ + +#define REPO_NAME "test-repo-plain_0_length" + +static svn_error_t * +receive_index(const svn_fs_fs__p2l_entry_t *entry, + void *baton, + apr_pool_t *scratch_pool) +{ + apr_array_header_t *entries = baton; + APR_ARRAY_PUSH(entries, svn_fs_fs__p2l_entry_t *) + = apr_pmemdup(entries->pool, entry, sizeof(*entry)); + + return SVN_NO_ERROR; +} + +static apr_size_t +stringbuf_find(svn_stringbuf_t *rev_contents, + const char *substring) +{ + apr_size_t i; + apr_size_t len = strlen(substring); + + for (i = 0; i < rev_contents->len - len + 1; ++i) + if (!memcmp(rev_contents->data + i, substring, len)) + return i; + + return APR_SIZE_MAX; +} + +static svn_error_t * +plain_0_length(const svn_test_opts_t *opts, + apr_pool_t *pool) +{ + svn_fs_t *fs; + fs_fs_data_t *ffd; + svn_fs_txn_t *txn; + svn_fs_root_t *root; + svn_revnum_t rev; + const char *rev_path; + svn_stringbuf_t *rev_contents; + apr_hash_t *fs_config; + svn_filesize_t file_length; + apr_size_t offset; + + if (strcmp(opts->fs_type, "fsfs") != 0) + return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL, NULL); + + /* Create a repo that does not deltify properties and does not share reps + on its own - makes it easier to do that later by hand. */ + SVN_ERR(svn_test__create_fs(&fs, REPO_NAME, opts, pool)); + ffd = fs->fsap_data; + ffd->deltify_properties = FALSE; + ffd->rep_sharing_allowed = FALSE; + + /* Create one file node with matching contents and property reps. */ + SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, pool)); + SVN_ERR(svn_fs_txn_root(&root, txn, pool)); + SVN_ERR(svn_fs_make_file(root, "foo", pool)); + SVN_ERR(svn_test__set_file_contents(root, "foo", "END\n", pool)); + SVN_ERR(svn_fs_change_node_prop(root, "foo", "x", NULL, pool)); + SVN_ERR(svn_fs_commit_txn(NULL, &rev, txn, pool)); + + /* Redirect text rep to props rep. */ + rev_path = svn_fs_fs__path_rev_absolute(fs, rev, pool); + SVN_ERR(svn_stringbuf_from_file2(&rev_contents, rev_path, pool)); + + offset = stringbuf_find(rev_contents, "id: "); + if (offset != APR_SIZE_MAX) + { + node_revision_t *noderev; + svn_stringbuf_t *noderev_str; + + /* Read the noderev. */ + svn_stream_t *stream = svn_stream_from_stringbuf(rev_contents, pool); + SVN_ERR(svn_stream_skip(stream, offset)); + SVN_ERR(svn_fs_fs__read_noderev(&noderev, stream, pool, pool)); + SVN_ERR(svn_stream_close(stream)); + + /* Tweak the DATA_REP. */ + noderev->data_rep->revision = noderev->prop_rep->revision; + noderev->data_rep->item_index = noderev->prop_rep->item_index; + noderev->data_rep->size = noderev->prop_rep->size; + noderev->data_rep->expanded_size = 0; + + /* Serialize it back. */ + noderev_str = svn_stringbuf_create_empty(pool); + stream = svn_stream_from_stringbuf(noderev_str, pool); + SVN_ERR(svn_fs_fs__write_noderev(stream, noderev, ffd->format, + svn_fs_fs__fs_supports_mergeinfo(fs), + pool)); + SVN_ERR(svn_stream_close(stream)); + + /* Patch the revision contents */ + memcpy(rev_contents->data + offset, noderev_str->data, noderev_str->len); + } + + SVN_ERR(svn_io_write_atomic(rev_path, rev_contents->data, + rev_contents->len, NULL, pool)); + + if (svn_fs_fs__use_log_addressing(fs)) + { + /* Refresh index data (checksums). */ + apr_array_header_t *entries = apr_array_make(pool, 4, sizeof(void *)); + SVN_ERR(svn_fs_fs__dump_index(fs, rev, receive_index, entries, + NULL, NULL, pool)); + SVN_ERR(svn_fs_fs__load_index(fs, rev, entries, pool)); + } + + /* Create an independent FS instances with separate caches etc. */ + fs_config = apr_hash_make(pool); + svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_CACHE_NS, + svn_uuid_generate(pool)); + SVN_ERR(svn_fs_open2(&fs, REPO_NAME, fs_config, pool, pool)); + + /* Now, check that we get the correct file length. */ + SVN_ERR(svn_fs_revision_root(&root, fs, rev, pool)); + SVN_ERR(svn_fs_file_length(&file_length, root, "foo", pool)); + + SVN_TEST_ASSERT(file_length == 4); + + return SVN_NO_ERROR; +} + +#undef REPO_NAME + /* The test table. */ @@ -1285,6 +1414,8 @@ static struct svn_test_descriptor_t test "change revprops with enabled and disabled caching"), SVN_TEST_OPTS_PASS(id_parser_test, "id parser test"), + SVN_TEST_OPTS_PASS(plain_0_length, + "file with 0 expanded-length, issue #4554"), SVN_TEST_NULL }; Modified: subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/auth-test.c URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/auth-test.c?rev=1655189&r1=1655188&r2=1655189&view=diff ============================================================================== --- subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/auth-test.c (original) +++ subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/auth-test.c Tue Jan 27 23:27:44 2015 @@ -220,8 +220,8 @@ cleanup_callback(svn_boolean_t *delete_c { svn_auth_baton_t *b = walk_baton; - SVN_TEST_ASSERT(strcmp(cred_kind, SVN_AUTH_CRED_SIMPLE) == 0); - SVN_TEST_ASSERT(strcmp(realmstring, "<http://my.host> My realm") == 0); + SVN_TEST_STRING_ASSERT(cred_kind, SVN_AUTH_CRED_SIMPLE); + SVN_TEST_STRING_ASSERT(realmstring, "<http://my.host> My realm"); SVN_ERR(svn_auth_forget_credentials(b, cred_kind, realmstring, scratch_pool)); @@ -272,7 +272,7 @@ test_auth_clear(apr_pool_t *pool) pool)); creds = credentials; - SVN_TEST_ASSERT(strcmp(creds->username, "jrandom") == 0); + SVN_TEST_STRING_ASSERT(creds->username, "jrandom"); SVN_TEST_ASSERT(creds->may_save); /* And tell that they are ok and can be saved */ @@ -292,7 +292,7 @@ test_auth_clear(apr_pool_t *pool) SVN_TEST_ASSERT(credentials); creds = credentials; - SVN_TEST_ASSERT(strcmp(creds->username, "jrandom") == 0); + SVN_TEST_STRING_ASSERT(creds->username, "jrandom"); SVN_TEST_ASSERT(creds->may_save); /* Use our walker function to delete credentials (and forget them Modified: subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/dirent_uri-test.c URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=1655189&r1=1655188&r2=1655189&view=diff ============================================================================== --- subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/dirent_uri-test.c (original) +++ subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/dirent_uri-test.c Tue Jan 27 23:27:44 2015 @@ -809,6 +809,9 @@ static const testcase_canonicalize_t uri { "http://hst/foo/../bar","http://hst/foo/../bar" }, { "http://hst/", "http://hst" }, { "http:///", "http://" }, + { "http:///example.com/", "http:///example.com" }, + { "http:////example.com/", "http:///example.com" }, + { "http://///////example.com/", "http:///example.com" }, { "https://", "https://" }, { "file:///", "file://" }, { "file://", "file://" }, Modified: subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/io-test.c URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/io-test.c?rev=1655189&r1=1655188&r2=1655189&view=diff ============================================================================== --- subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/io-test.c (original) +++ subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/io-test.c Tue Jan 27 23:27:44 2015 @@ -680,6 +680,63 @@ aligned_seek_test(apr_pool_t *pool) return SVN_NO_ERROR; } +static svn_error_t * +ignore_enoent(apr_pool_t *pool) +{ + const char *tmp_dir, *path; + const svn_io_dirent2_t *dirent_p; + apr_file_t *file; + + /* Create an empty directory. */ + SVN_ERR(svn_dirent_get_absolute(&tmp_dir, "ignore_enoent", pool)); + SVN_ERR(svn_io_remove_dir2(tmp_dir, TRUE, NULL, NULL, pool)); + SVN_ERR(svn_io_make_dir_recursively(tmp_dir, pool)); + svn_test_add_dir_cleanup(tmp_dir); + + /* Path does not exist. */ + path = svn_dirent_join(tmp_dir, "not-present", pool); + SVN_ERR(svn_io_remove_dir2(path, TRUE, NULL, NULL, pool)); + SVN_ERR(svn_io_remove_file2(path, TRUE, pool)); + SVN_ERR(svn_io_set_file_read_only(path, TRUE, pool)); + SVN_ERR(svn_io_set_file_read_write(path, TRUE, pool)); + SVN_ERR(svn_io_set_file_executable(path, TRUE, TRUE, pool)); + SVN_ERR(svn_io_set_file_executable(path, FALSE, TRUE, pool)); + SVN_ERR(svn_io_stat_dirent2(&dirent_p, path, TRUE, TRUE, pool, pool)); + SVN_ERR(svn_io_stat_dirent2(&dirent_p, path, FALSE, TRUE, pool, pool)); + + /* Neither path nor parent exists. */ + path = svn_dirent_join(path, "not-present", pool); + SVN_ERR(svn_io_remove_dir2(path, TRUE, NULL, NULL, pool)); + SVN_ERR(svn_io_remove_file2(path, TRUE, pool)); + SVN_ERR(svn_io_set_file_read_only(path, TRUE, pool)); + SVN_ERR(svn_io_set_file_read_write(path, TRUE, pool)); + SVN_ERR(svn_io_set_file_executable(path, TRUE, TRUE, pool)); + SVN_ERR(svn_io_set_file_executable(path, FALSE, TRUE, pool)); + SVN_ERR(svn_io_stat_dirent2(&dirent_p, path, TRUE, TRUE, pool, pool)); + SVN_ERR(svn_io_stat_dirent2(&dirent_p, path, FALSE, TRUE, pool, pool)); + + /* File does exist. */ + path = svn_dirent_join(tmp_dir, "present", pool); + SVN_ERR(svn_io_file_open(&file, path, + APR_WRITE | APR_CREATE | APR_TRUNCATE, + APR_OS_DEFAULT, + pool)); + SVN_ERR(svn_io_file_close(file, pool)); + + /* Path does not exist as child of file. */ + path = svn_dirent_join(path, "not-present", pool); + SVN_ERR(svn_io_remove_dir2(path, TRUE, NULL, NULL, pool)); + SVN_ERR(svn_io_remove_file2(path, TRUE, pool)); + SVN_ERR(svn_io_set_file_read_only(path, TRUE, pool)); + SVN_ERR(svn_io_set_file_read_write(path, TRUE, pool)); + SVN_ERR(svn_io_set_file_executable(path, TRUE, TRUE, pool)); + SVN_ERR(svn_io_set_file_executable(path, FALSE, TRUE, pool)); + SVN_ERR(svn_io_stat_dirent2(&dirent_p, path, TRUE, TRUE, pool, pool)); + SVN_ERR(svn_io_stat_dirent2(&dirent_p, path, FALSE, TRUE, pool, pool)); + + return SVN_NO_ERROR; +} + /* The test table. */ @@ -700,6 +757,8 @@ static struct svn_test_descriptor_t test "svn_io_read_length_line() shouldn't loop"), SVN_TEST_PASS2(aligned_seek_test, "test aligned seek"), + SVN_TEST_PASS2(ignore_enoent, + "test ignore-enoent"), SVN_TEST_NULL }; Modified: subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/mergeinfo-test.c URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/mergeinfo-test.c?rev=1655189&r1=1655188&r2=1655189&view=diff ============================================================================== --- subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/mergeinfo-test.c (original) +++ subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/mergeinfo-test.c Tue Jan 27 23:27:44 2015 @@ -104,7 +104,7 @@ verify_mergeinfo_parse(const char *input /* Were we expecting any more ranges? */ if (j < MAX_NBR_RANGES - 1 - && !expected_ranges[j].end == 0) + && expected_ranges[j].end != 0) return svn_error_createf(SVN_ERR_TEST_FAILED, NULL, "svn_mergeinfo_parse (%s) failed to " "produce the expected number of ranges", Modified: subversion/branches/svn-auth-x509/subversion/tests/libsvn_wc/conflict-data-test.c URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/libsvn_wc/conflict-data-test.c?rev=1655189&r1=1655188&r2=1655189&view=diff ============================================================================== --- subversion/branches/svn-auth-x509/subversion/tests/libsvn_wc/conflict-data-test.c (original) +++ subversion/branches/svn-auth-x509/subversion/tests/libsvn_wc/conflict-data-test.c Tue Jan 27 23:27:44 2015 @@ -621,8 +621,8 @@ test_serialize_tree_conflict(const svn_t SVN_TEST_ASSERT(reason == svn_wc_conflict_reason_moved_away); SVN_TEST_ASSERT(action == svn_wc_conflict_action_delete); - SVN_TEST_ASSERT(!strcmp(moved_away_op_root_abspath, - sbox_wc_path(&sbox, "A/B"))); + SVN_TEST_STRING_ASSERT(moved_away_op_root_abspath, + sbox_wc_path(&sbox, "A/B")); } return SVN_NO_ERROR; Modified: subversion/branches/svn-auth-x509/subversion/tests/libsvn_wc/op-depth-test.c URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/libsvn_wc/op-depth-test.c?rev=1655189&r1=1655188&r2=1655189&view=diff ============================================================================== --- subversion/branches/svn-auth-x509/subversion/tests/libsvn_wc/op-depth-test.c (original) +++ subversion/branches/svn-auth-x509/subversion/tests/libsvn_wc/op-depth-test.c Tue Jan 27 23:27:44 2015 @@ -5793,7 +5793,7 @@ check_tree_conflict_repos_path(svn_test_ SVN_TEST_ASSERT(version != NULL); - SVN_TEST_ASSERT(!strcmp(version->path_in_repos, repos_path1)); + SVN_TEST_STRING_ASSERT(version->path_in_repos, repos_path1); } if (repos_path2) @@ -5803,7 +5803,7 @@ check_tree_conflict_repos_path(svn_test_ SVN_TEST_ASSERT(version != NULL); - SVN_TEST_ASSERT(!strcmp(version->path_in_repos, repos_path2)); + SVN_TEST_STRING_ASSERT(version->path_in_repos, repos_path2); } return SVN_NO_ERROR; @@ -6808,10 +6808,25 @@ finite_move_update_bump(const svn_test_o SVN_ERR(sbox_wc_move(&b, "P/Q", "Q2")); SVN_ERR(sbox_wc_update_depth(&b, "A/B", 2, svn_depth_files, FALSE)); SVN_ERR(sbox_wc_update_depth(&b, "P/Q", 2, svn_depth_files, FALSE)); - SVN_ERR(check_tree_conflict_repos_path(&b, "A/B", NULL, NULL)); + { + conflict_info_t conflicts[] = { + {"A/B", FALSE, FALSE, TRUE}, + {"P/Q", FALSE, FALSE, TRUE}, + {0} + }; + SVN_ERR(check_db_conflicts(&b, "", conflicts)); + } + + SVN_ERR(check_tree_conflict_repos_path(&b, "A/B", "A/B", "A/B")); + SVN_ERR(check_tree_conflict_repos_path(&b, "P/Q", "P/Q", "P/Q")); err = sbox_wc_resolve(&b, "A/B", svn_depth_empty, svn_wc_conflict_choose_mine_conflict); SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE); + + /* sbox_wc_resolve() obtains a lock on the target path, so now it + will apply the change on the target */ + SVN_ERR(sbox_wc_resolve(&b, "P/Q", svn_depth_empty, + svn_wc_conflict_choose_mine_conflict)); { nodes_row_t nodes[] = { {0, "", "normal", 1, ""}, @@ -6840,10 +6855,21 @@ finite_move_update_bump(const svn_test_o SVN_ERR(sbox_wc_move(&b, "P", "P2")); SVN_ERR(sbox_wc_update_depth(&b, "A/B", 2, svn_depth_immediates, FALSE)); SVN_ERR(sbox_wc_update_depth(&b, "P", 2, svn_depth_immediates, FALSE)); - SVN_ERR(check_tree_conflict_repos_path(&b, "P", NULL, NULL)); + { + conflict_info_t conflicts[] = { + {"A/B", FALSE, FALSE, TRUE}, + {"P", FALSE, FALSE, TRUE}, + {0} + }; + SVN_ERR(check_db_conflicts(&b, "", conflicts)); + } + SVN_ERR(check_tree_conflict_repos_path(&b, "P", "P", "P")); + SVN_ERR(check_tree_conflict_repos_path(&b, "A/B", "A/B", "A/B")); err = sbox_wc_resolve(&b, "P", svn_depth_empty, svn_wc_conflict_choose_mine_conflict); SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE); + SVN_ERR(sbox_wc_resolve(&b, "A/B", svn_depth_empty, + svn_wc_conflict_choose_mine_conflict)); { nodes_row_t nodes[] = { {0, "", "normal", 1, ""}, @@ -6874,10 +6900,21 @@ finite_move_update_bump(const svn_test_o SVN_ERR(sbox_wc_move(&b, "P/Q", "Q2")); SVN_ERR(sbox_wc_update_depth(&b, "A/B/C", 2, svn_depth_empty, FALSE)); SVN_ERR(sbox_wc_update_depth(&b, "P/Q", 2, svn_depth_empty, FALSE)); - SVN_ERR(check_tree_conflict_repos_path(&b, "P/Q", NULL, NULL)); + { + conflict_info_t conflicts[] = { + {"A/B/C", FALSE, FALSE, TRUE}, + {"P/Q", FALSE, FALSE, TRUE}, + {0} + }; + SVN_ERR(check_db_conflicts(&b, "", conflicts)); + } + SVN_ERR(check_tree_conflict_repos_path(&b, "A/B/C", "A/B/C", "A/B/C")); + SVN_ERR(check_tree_conflict_repos_path(&b, "P/Q", "P/Q", "P/Q")); err = sbox_wc_resolve(&b, "P/Q", svn_depth_empty, svn_wc_conflict_choose_mine_conflict); SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE); + SVN_ERR(sbox_wc_resolve(&b, "A/B/C", svn_depth_empty, + svn_wc_conflict_choose_mine_conflict)); { nodes_row_t nodes[] = { {0, "", "normal", 1, ""}, @@ -10058,7 +10095,7 @@ static struct svn_test_descriptor_t test "commit_moved_descendant"), SVN_TEST_OPTS_XFAIL(commit_moved_away_descendant, "commit_moved_away_descendant"), - SVN_TEST_OPTS_XFAIL(finite_move_update_bump, + SVN_TEST_OPTS_PASS(finite_move_update_bump, "finite_move_update_bump"), SVN_TEST_OPTS_PASS(move_away_delete_update, "move_away_delete_update"), Modified: subversion/branches/svn-auth-x509/tools/buildbot/slaves/svn-sparc-solaris/svnbuild.sh URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/tools/buildbot/slaves/svn-sparc-solaris/svnbuild.sh?rev=1655189&r1=1655188&r2=1655189&view=diff ============================================================================== --- subversion/branches/svn-auth-x509/tools/buildbot/slaves/svn-sparc-solaris/svnbuild.sh (original) +++ subversion/branches/svn-auth-x509/tools/buildbot/slaves/svn-sparc-solaris/svnbuild.sh Tue Jan 27 23:27:44 2015 @@ -41,7 +41,6 @@ echo "============ configure" --with-serf=/export/home/wandisco/buildbot/install \ --with-apxs=/export/home/wandisco/buildbot/install/bin/apxs \ --with-sqlite=/export/home/wandisco/buildbot/sqlite-amalgamation-3071501/sqlite3.c \ - --enable-optimize \ --disable-shared \ $OPTIMIZE_OPTION \ || exit $? Modified: subversion/branches/svn-auth-x509/tools/buildbot/slaves/svn-sparc-solaris/svncheck.sh URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/tools/buildbot/slaves/svn-sparc-solaris/svncheck.sh?rev=1655189&r1=1655188&r2=1655189&view=diff ============================================================================== --- subversion/branches/svn-auth-x509/tools/buildbot/slaves/svn-sparc-solaris/svncheck.sh (original) +++ subversion/branches/svn-auth-x509/tools/buildbot/slaves/svn-sparc-solaris/svncheck.sh Tue Jan 27 23:27:44 2015 @@ -24,6 +24,10 @@ SVN_VER_MINOR=`awk '/define SVN_VER_MINO cd ../obj +# Use GNU iconv since the system one does not work well enough +LD_PRELOAD_64=/export/home/wandisco/buildbot/install/lib/preloadable_libiconv.so +export LD_PRELOAD_64 + if [ $SVN_VER_MINOR -eq 9 ]; then echo "============ make svnserveautocheck" make svnserveautocheck CLEANUP=1 PARALLEL=30 THREADED=1 @@ -32,31 +36,4 @@ else make check CLEANUP=1 PARALLEL=30 THREADED=1 fi -# 'make check' will FAIL due to lack of UTF-8 conversion, so whitelist -# those known failures. -known="^FAIL: (" -known="${known} subst_translate-test 1: test svn_subst_translate_string2" -known="${known}|" -known="${known} subst_translate-test 2: test svn_subst_translate_string2" -known="${known}|" -known="${known} utf-test 3: test svn_utf_cstring_to_utf8_ex2" -known="${known}|" -known="${known} utf-test 4: test svn_utf_cstring_from_utf8_ex2" -known="${known}|" -known="${known} prop_tests.py 22: test prop. handle invalid property names" -known="${known}|" -known="${known} prop_tests.py 41: svn:author with XML unsafe chars" -known="${known}|" -known="${known} svnsync_tests.py 24: copy and reencode non-UTF-8 svn:. props" -known="${known})" - -# tests.log must exist -test -f tests.log || exit 1 - -# No FAIL other than the known ones. -egrep -v "$known" tests.log | grep '^FAIL' && exit 1 - -# Over 1,000 PASS. -grep '^PASS' tests.log | wc -l | grep [1-9][0-9][0-9][0-9] >/dev/null || echo $? - exit 0
