Index: subversion/tests/cmdline/update_tests.py =================================================================== --- subversion/tests/cmdline/update_tests.py (revision 27453) +++ subversion/tests/cmdline/update_tests.py (working copy) @@ -3687,7 +3687,116 @@ svntest.tree.detect_conflict_files, extra_files) +#---------------------------------------------------------------------- +# Helper for tree-conflict tests +def setup_simple_tree_conflicts(G, G2): + j = os.path.join + run = svntest.actions.run_and_verify_svn + # Modify pi, move rho, move tau in wc 1 and commit + svntest.main.file_append( j(G1, 'pi'), "Change to 'G/pi'.\n") + run(None, None, [], 'mv', j(G1, 'rho'), j(G1, 'rhino')) + run(None, None, [], 'mv', j(G1, 'tau'), j(G1, 'tapir')) + run(None, None, [], 'ci', '-m', 'changes in wc 1', G1) + + # Move pi, modify rho, move tau in wc 2 + run(None, None, [], 'mv', j(G2, 'pi'), j(G2, 'pig')) + svntest.main.file_append( j(G2, 'rho'), "Change to 'G/rho'.\n") + run(None, None, [], 'mv', j(G2, 'tau'), j(G2, 'tiger')) + +def tree_conflicts_in_updated_files_current(sbox): + "tree conflicts in updated files current" + + # CURRENT svn behavior for simple update tree conflicts. + # Covers use cases 1-3 in notes/tree-conflicts/use-cases.txt. + + sbox.build() + wc_dir = sbox.wc_dir + + # Make working copy 2 + wc_dir_2 = sbox.add_wc_path('2') + svntest.actions.duplicate_dir(wc_dir, wc_dir_2) + G = os.path.join(wc_dir, 'A', 'D', 'G') + G2 = os.path.join(wc_dir_2, 'A', 'D', 'G') + + setup_simple_tree_conflicts(G, G2) + + # Update in wc 2 + expected_output = wc.State(G2, { + 'pi' : Item(status='U '), + 'rho' : Item(status='D '), + 'rhino' : Item(status='A '), + 'tau' : Item(status='D '), + 'tapir' : Item(status='A '), + }) + expected_disk = wc.State('', { + 'pi' : Item("This is the file 'pi'.\nChange to 'G/pi'.\n"), + 'pig' : Item("This is the file 'pi'.\n"), + 'rho' : Item("This is the file 'rho'.\nChange to 'G/rho'.\n"), + 'rhino' : Item("This is the file 'rho'.\n"), + 'tapir' : Item("This is the file 'tau'.\n"), + 'tiger' : Item("This is the file 'tau'.\n"), + }) + expected_status = wc.State(G2, { + '' : Item(status=' ', wc_rev=2), + 'pi' : Item(status='D ', wc_rev=2), + 'pig' : Item(status='A ', wc_rev='-', copied='+'), + 'rhino' : Item(status=' ', wc_rev=2), + 'tapir' : Item(status=' ', wc_rev=2), + 'tiger' : Item(status='A ', wc_rev='-', copied='+'), + }) + svntest.actions.run_and_verify_update(G2, + expected_output, + expected_disk, + expected_status) + +#---------------------------------------------------------------------- + +def tree_conflicts_in_updated_files(sbox): + "tree conflicts in updated files" + + # PROPOSED svn behavior for simple tree conflicts. + # Covers use cases 1-3 in notes/tree-conflicts/use-cases.txt. + + sbox.build() + wc_dir = sbox.wc_dir + + # Make working copy 2 + wc_dir_2 = sbox.add_wc_path('2') + svntest.actions.duplicate_dir(wc_dir, wc_dir_2) + G = os.path.join(wc_dir, 'A', 'D', 'G') + G2 = os.path.join(wc_dir_2, 'A', 'D', 'G') + + setup_simple_tree_conflicts(G, G2) + + # Update in wc 2 + expected_output = wc.State(G2, { + 'pig' : Item(status='U '), + 'rho' : Item(status='D '), + 'rhino' : Item(status='A '), + 'tau' : Item(status='D '), + 'tapir' : Item(status='A '), + }) + expected_disk = wc.State('', { + 'pig' : Item("This is the file 'pi'.\nChange to 'G/pi'.\n"), + 'rhino' : Item("This is the file 'rho'.\nChange to 'G/rho'.\n"), + 'tapir' : Item("This is the file 'tau'.\n"), + 'tiger' : Item("This is the file 'tau'.\n"), + }) + expected_status = wc.State(G2, { + '' : Item(status=' ', wc_rev=2), + 'pi' : Item(status='D ', wc_rev=2), + 'pig' : Item(status='A ', wc_rev='-', copied='+'), + 'rhino' : Item(status=' ', wc_rev=2), + 'tapir' : Item(status=' ', wc_rev=2), + 'tiger' : Item(status='A ', wc_rev='-', copied='+'), + }) + svntest.actions.run_and_verify_update(G2, + expected_output, + expected_disk, + expected_status) + + ####################################################################### # Run the tests