Julian Foad <julianf...@btopenworld.com> writes: > Paul Burba wrote: >> On Mon, Jan 25, 2010 at 2:17 AM, Noorul Islam K M <noo...@collab.net> wrote: >> > + # Move new added file to another one and commit. >> > + second_path = os.path.join(new_path, 'second') >> > + rav_svn(None, None, [], 'move', first_path, second_path) >> > + rav_svn(None, None, ["Committed revision 4.\n"], 'ci', '-m', >> ^^^^^^^^^^^^^^^^^^^^^^^^^ >> >> The expected_stderr is "", not "Committed revision 4.\n". The >> expected_stdout is something like: >> >> [[[ >> Adding svn-test-work\working_copies\copy_tests-77\A\New >> Adding svn-test-work\working_copies\copy_tests-77\A\New\second >> >> Committed revision 4. >> ]]] >> >> So you can either pass None as expected_stdout (in which case it isn't >> checked at all), pass a single string regex describing the above >> output, or use svntest.actions.run_and_verify_commit(). > > Oops, sorry, I already committed it in r902841. I'll change that or at > least add a comment. >
Thank you, for changing it. >> Also, would you mind taking a stab at expanding the test to cover >> Alan's original problem? Specifically that a second working copy, >> when updated, gets both the move destination *and* the source added. > > Or a separate test - either way would be really helpful. > Please find attached the test case patch for the actual scenario that Alan explains in his mail. This patch is created against r899215 because trunk has different behavior during commit. [[[ Log: New XFail test case for reverse merge, move and update second working copy scenario. The second working copy update gets both the move destination and the source added. This issue needs to be fixed for the test case to pass. See the email thread <http://svn.haxx.se/dev/archive-2009-12/0347.shtml>. * subversion/tests/cmdline/copy_tests.py (reverse_merge_move_update_wc2): New function. (test_list): Added test. Found by: alan.spencer Suggested by: julianfoad Patch by: Noorul Islam K M <noorul{_AT_}collab.net> ]]] Thanks and Regards Noorul
Index: copy_tests.py =================================================================== --- copy_tests.py (revision 903188) +++ copy_tests.py (working copy) @@ -4091,7 +4091,58 @@ expected_disk, expected_status) +def reverse_merge_move_update_wc2(sbox): + """reverse merge move update second working copy""" + # Alias for svntest.actions.run_and_verify_svn + rav_svn = svntest.actions.run_and_verify_svn + + wc_dir = sbox.wc_dir + a_dir = os.path.join(wc_dir, 'A') + a_repo_url = sbox.repo_url + '/A' + sbox.build() + + # Create another working copy path and checkout. + wc2_dir = sbox.add_wc_path('2') + rav_svn(None, None, [], 'co', sbox.repo_url, wc2_dir) + + # Update working directory and ensure that we are at revision 1. + rav_svn(None, ["At revision 1.\n"], [], 'up', wc_dir) + + # Add new folder and file, later commit + new_path = os.path.join(a_dir, 'New') + os.mkdir(new_path) + first_path = os.path.join(new_path, 'first') + svntest.main.file_append(first_path, 'appended first text') + svntest.main.run_svn(None, "add", new_path) + rav_svn(None, None, [], 'ci', wc_dir, '-m', 'Add new folder %s' % new_path) + rav_svn(None, ["At revision 2.\n"], [], 'up', wc_dir) + + # Reverse merge to revert previous changes and commit + rav_svn(None, None, [], 'merge', '-c', '-2', a_repo_url, a_dir) + rav_svn(None, None, [], 'ci', '-m', 'Reverting svn merge -c -2.', a_dir) + rav_svn(None, ["At revision 3.\n"], [], 'up', wc_dir) + + # Reverse merge again to undo last revert. + rav_svn(None, None, [], 'merge', '-c', '-3', a_repo_url, a_dir) + + # Move new added file to another one and commit. + second_path = os.path.join(new_path, 'second') + rav_svn(None, None, [], 'move', first_path, second_path) + rav_svn(None, "Adding.*New|Adding.*first||Committed revision 4.", [], + 'ci', '-m', + 'Revert svn merge. svn mv %s %s.' % (first_path, second_path), a_dir) + + # Update second working copy. + expected_output = svntest.wc.State(wc2_dir, { + 'A/New' : Item(status='A '), + 'A/New/second' : Item(status='A '), + }) + svntest.actions.run_and_verify_update(wc2_dir, + expected_output, + None, + None) + ######################################################################## # Run the tests @@ -4174,6 +4225,7 @@ find_copyfrom_information_upstairs, path_move_and_copy_between_wcs_2475, path_copy_in_repo_2475, + XFail(reverse_merge_move_update_wc2), ] if __name__ == '__main__':