Index: subversion/tests/cmdline/update_tests.py =================================================================== --- subversion/tests/cmdline/update_tests.py (revision 20467) +++ subversion/tests/cmdline/update_tests.py (working copy) @@ -1674,6 +1674,12 @@ expected_output, expected_wc) +# This test validates three scenario's: +# 1: when update creates a conflict on a file, make sure the file and files +# r, r and .mine are in the eol-style defined for that file. +# 2: if part of that update is a propchange of svn:eol-style, make sure the +# new eol-style is used for all files +# 3: if svn:eol-style is changed locally, use the new eol-style for all files. def conflict_markers_matching_eol(sbox): "conflict markers should match the file's eol style" @@ -1688,7 +1694,7 @@ else: crlf = '\r\n' - # Checkout a second working copy of + # Checkout a second working copy wc_backup = sbox.add_wc_path('backup') svntest.actions.run_and_verify_svn(None, None, [], 'checkout', sbox.repo_url, wc_backup) @@ -1701,13 +1707,13 @@ path_backup = os.path.join(wc_backup, 'A', 'mu') - # do the test for each eol-style - for eol, eolchar in zip(['CRLF', 'CR', 'native', 'LF'], - [crlf, '\015', '\n', '\012']): - # add a new file with the eol-style property set. - open(mu_path, 'wb').write("This is the file 'mu'."+ eolchar) - svntest.main.run_svn(None, 'propset', 'svn:eol-style', eol, mu_path) - + # Do the test for each eol-style. First try scenario 1, don't set the + # svn:eol-style property. + for eol, eolchar in zip([None, 'CRLF', 'CR', 'native', 'LF'], + ['\012', crlf, '\015', '\n', '\012']): + open(mu_path, 'wb').write("This is the changed file 'mu'."+ eolchar) + print 'eol: ' + str(eol) + expected_disk.add({ 'A/mu' : Item("This is the file 'mu'." + eolchar) }) @@ -1727,9 +1733,15 @@ base_rev = cur_rev svntest.main.run_svn(None, 'update', wc_backup) - + + # set the eol-style property (to test scenario 2). + if eol: + svntest.main.run_svn(None, 'propset', 'svn:eol-style', eol, mu_path) + svntest.main.run_svn(None, 'commit', '-m', 'set property', wc_dir) + # Make a local mod to mu - svntest.main.file_append(mu_path, 'Original appended text for mu' + eolchar) + svntest.main.file_append(mu_path, 'Original appended text for mu' + + eolchar) # Commit the original change and note the 'theirs' revision number svntest.main.run_svn(None, 'commit', '-m', 'test log', wc_dir) @@ -1741,8 +1753,13 @@ 'Conflicting appended text for mu' + eolchar) # Create expected output tree for an update of the wc_backup. + + if eol: # if we set the svn:eol-style property, status will be U as well. + exp_status = 'CU' + else: + exp_status = 'C ' expected_backup_output = svntest.wc.State(wc_backup, { - 'A/mu' : Item(status='C '), + 'A/mu' : Item(status=exp_status), }) # Create expected disk tree for the update. @@ -1750,7 +1767,7 @@ # verify content of resulting conflicted file expected_backup_disk.add({ - 'A/mu' : Item(contents= "This is the file 'mu'." + eolchar + + 'A/mu' : Item(contents= "This is the changed file 'mu'." + eolchar + "<<<<<<< .mine" + eolchar + "Conflicting appended text for mu" + eolchar + "=======" + eolchar + @@ -1759,18 +1776,18 @@ }) # verify content of base(left) file expected_backup_disk.add({ - 'A/mu.r' + str(base_rev ) : Item(contents= "This is the file 'mu'." + + 'A/mu.r' + str(base_rev ) : Item(contents= "This is the changed file 'mu'." + eolchar) }) # verify content of theirs(right) file expected_backup_disk.add({ - 'A/mu.r' + str(theirs_rev ) : Item(contents= "This is the file 'mu'." + + 'A/mu.r' + str(theirs_rev ) : Item(contents= "This is the changed file 'mu'." + eolchar + "Original appended text for mu" + eolchar) }) # verify content of mine file expected_backup_disk.add({ - 'A/mu.mine' : Item(contents= "This is the file 'mu'." + + 'A/mu.mine' : Item(contents= "This is the changed file 'mu'." + eolchar + "Conflicting appended text for mu" + eolchar) })