Ping...
Has anybody had a chance to review this patch? If not, I'll go ahead an
add it to the issue tracker in a few days.
-Hyrum
Kamesh Jayachandran wrote:
> Hi All,
> Find the attached patch and log.
>
> With regards
> Kamesh Jayachandran
>
>
>
>
> ------------------------------------------------------------------------
>
> Index: subversion/tests/cmdline/merge_tests.py
> ===================================================================
> --- subversion/tests/cmdline/merge_tests.py (revision 23227)
> +++ subversion/tests/cmdline/merge_tests.py (working copy)
> @@ -4381,6 +4381,274 @@
> finally:
> os.chdir(saved_cwd)
>
> +def modify_and_commit_source_merge_the_resulting_rev_to_dst(sbox,
> + fs_src_path,
> + fs_dst_path,
> + canon_src_path,
> + contents,
> + cur_rev):
> + # Edit src and commit it, creating revision cur_rev+1.
> + wc_dir = sbox.wc_dir
> + new_rev = cur_rev + 1
> + svntest.main.file_write(fs_src_path, contents)
> +
> + expected_output = svntest.wc.State(fs_src_path, {
> + '': Item(verb='Sending'),
> + })
> +
> + expected_status = wc.State(fs_src_path,
> + { '': Item(wc_rev=new_rev, status=' ')})
> +
> + svntest.actions.run_and_verify_commit(fs_src_path, expected_output,
> + expected_status, None,
> + None, None, None, None, fs_src_path)
> +
> + # Update the WC to new_rev so that it would be easier to expect everyone
> + # to be at new_rev.
> + svntest.actions.run_and_verify_svn(None, None, [], 'update', wc_dir)
> +
> + # Merge new_rev of fs_src_path to fs_dst_path
> +
> + # Search for the comment entitled "The Merge Kluge" elsewhere in
> + # this file, to understand why we shorten and chdir() below.
> + short_fs_dst_path = shorten_path_kludge(fs_dst_path)
> + expected_status = wc.State(fs_dst_path,
> + { '': Item(wc_rev=new_rev, status='MM')})
> +
> + saved_cwd = os.getcwd()
> + try:
> + os.chdir(svntest.main.work_dir)
> + svntest.actions.run_and_verify_svn(None,
> + ['U ' + short_fs_dst_path + '\n'],
> + [],
> + 'merge', '-c', str(new_rev),
> + sbox.repo_url + '/' + canon_src_path,
> + short_fs_dst_path)
> + finally:
> + os.chdir(saved_cwd)
> +
> + svntest.actions.run_and_verify_status(fs_dst_path, expected_status)
> +
> + return new_rev
> +
> +def subtrees_with_merge_info_should_be_excluded_in_depth_first_order(sbox):
> + "exclude subtrees with mergeinfo in DF order"
> +
> + #copy /A/D to /A/copy-of-D it results in RONE
> + #create children at different hierarchies having some merge-info
> + #to test the set_path calls on a reporter in a non-depth-first order.
> + #Childrens considered
> + #/A/copy-of-D/G/pi
> + #/A/copy-of-D/G/rho
> + #/A/copy-of-D/G/tau
> + #/A/copy-of-D/G
> + #/A/copy-of-D/gamma
> + #/A/copy-of-D/H/chi
> + #/A/copy-of-D/H/omega
> + #/A/copy-of-D/H/psi
> + #/A/copy-of-D/H would have the mergeinfo.
> + #We run merges on individual files listed above.
> + #We create /A/D/umlaut directly over URL it results in rev RTWO
> + #When we merge /A/D with rRONE+1:RTWO it should merge smoothly
> +
> + sbox.build()
> + wc_dir = sbox.wc_dir
> +
> + A_path = os.path.join(wc_dir, 'A')
> +
> + A_D_path = os.path.join(A_path, 'D')
> + copy_of_A_D_path = os.path.join(A_path, 'copy-of-D')
> +
> + A_D_gamma_path = os.path.join(A_D_path, 'gamma')
> + copy_of_A_D_gamma_path = os.path.join(copy_of_A_D_path, 'gamma')
> +
> + A_D_G_path = os.path.join(A_D_path, 'G')
> + copy_of_A_D_G_path = os.path.join(copy_of_A_D_path, 'G')
> +
> + A_D_G_pi_path = os.path.join(A_D_G_path, 'pi')
> + copy_of_A_D_G_pi_path = os.path.join(copy_of_A_D_G_path, 'pi')
> +
> + A_D_G_rho_path = os.path.join(A_D_G_path, 'rho')
> + copy_of_A_D_G_rho_path = os.path.join(copy_of_A_D_G_path, 'rho')
> +
> + A_D_G_tau_path = os.path.join(A_D_G_path, 'tau')
> + copy_of_A_D_G_tau_path = os.path.join(copy_of_A_D_G_path, 'tau')
> +
> + A_D_H_path = os.path.join(A_D_path, 'H')
> + copy_of_A_D_H_path = os.path.join(copy_of_A_D_path, 'H')
> +
> + A_D_H_chi_path = os.path.join(A_D_H_path, 'chi')
> + copy_of_A_D_H_chi_path = os.path.join(copy_of_A_D_H_path, 'chi')
> +
> + A_D_H_omega_path = os.path.join(A_D_H_path, 'omega')
> + copy_of_A_D_H_omega_path = os.path.join(copy_of_A_D_H_path, 'omega')
> +
> + A_D_H_psi_path = os.path.join(A_D_H_path, 'psi')
> + copy_of_A_D_H_psi_path = os.path.join(copy_of_A_D_H_path, 'psi')
> +
> + svntest.main.run_svn(None, "cp", A_D_path, copy_of_A_D_path)
> +
> + expected_output = svntest.wc.State(wc_dir, {
> + 'A/copy-of-D' : Item(verb='Adding'),
> + })
> + expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
> + expected_status.add({
> + 'A/copy-of-D' : Item(status=' ', wc_rev=2),
> + 'A/copy-of-D/G' : Item(status=' ', wc_rev=2),
> + 'A/copy-of-D/G/pi' : Item(status=' ', wc_rev=2),
> + 'A/copy-of-D/G/rho' : Item(status=' ', wc_rev=2),
> + 'A/copy-of-D/G/tau' : Item(status=' ', wc_rev=2),
> + 'A/copy-of-D/H' : Item(status=' ', wc_rev=2),
> + 'A/copy-of-D/H/chi' : Item(status=' ', wc_rev=2),
> + 'A/copy-of-D/H/omega' : Item(status=' ', wc_rev=2),
> + 'A/copy-of-D/H/psi' : Item(status=' ', wc_rev=2),
> + 'A/copy-of-D/gamma' : Item(status=' ', wc_rev=2),
> + })
> + svntest.actions.run_and_verify_commit(wc_dir, expected_output,
> + expected_status, None,
> + None, None, None, None, wc_dir)
> +
> + # Edit A/D/G/pi and commit it, creating revision new_rev.
> + new_content_for_pi = 'new content to pi\n'
> + new_rev = modify_and_commit_source_merge_the_resulting_rev_to_dst(sbox,
> + A_D_G_pi_path,
> + copy_of_A_D_G_pi_path,
> + 'A/D/G/pi',
> + new_content_for_pi,
> + 2)
> +
> + # Edit A/D/G/rho and commit it, creating revision new_rev.
> + new_content_for_rho = 'new content to rho\n'
> + new_rev = modify_and_commit_source_merge_the_resulting_rev_to_dst(sbox,
> + A_D_G_rho_path,
> + copy_of_A_D_G_rho_path,
> + 'A/D/G/rho',
> + new_content_for_rho,
> + new_rev)
> +
> + # Edit A/D/G/tau and commit it, creating revision new_rev.
> + new_content_for_tau = 'new content to tau\n'
> + new_rev = modify_and_commit_source_merge_the_resulting_rev_to_dst(sbox,
> + A_D_G_tau_path,
> + copy_of_A_D_G_tau_path,
> + 'A/D/G/tau',
> + new_content_for_tau,
> + new_rev)
> +
> + # Edit A/D/H/chi and commit it, creating revision new_rev.
> + new_content_for_chi = 'new content to chi\n'
> + new_rev = modify_and_commit_source_merge_the_resulting_rev_to_dst(sbox,
> + A_D_H_chi_path,
> + copy_of_A_D_H_chi_path,
> + 'A/D/H/chi',
> + new_content_for_chi,
> + new_rev)
> +
> + # Edit A/D/H/omega and commit it, creating revision new_rev.
> + new_content_for_omega = 'new content to omega\n'
> + new_rev = modify_and_commit_source_merge_the_resulting_rev_to_dst(sbox,
> + A_D_H_omega_path,
> + copy_of_A_D_H_omega_path,
> + 'A/D/H/omega',
> + new_content_for_omega,
> + new_rev)
> +
> + # Edit A/D/H/psi and commit it, creating revision new_rev.
> + new_content_for_psi = 'new content to psi\n'
> + new_rev = modify_and_commit_source_merge_the_resulting_rev_to_dst(sbox,
> + A_D_H_psi_path,
> + copy_of_A_D_H_psi_path,
> + 'A/D/H/psi',
> + new_content_for_psi,
> + new_rev)
> +
> + # Edit A/D/gamma and commit it, creating revision new_rev.
> + new_content_for_gamma = 'new content to gamma\n'
> + new_rev = modify_and_commit_source_merge_the_resulting_rev_to_dst(sbox,
> + A_D_gamma_path,
> + copy_of_A_D_gamma_path,
> + 'A/D/gamma',
> + new_content_for_gamma,
> + new_rev)
> + copy_of_A_D_wc_rev = new_rev
> + svntest.actions.run_and_verify_svn(None,
> + ['\n',
> + 'Committed revision ' + str(new_rev+1) + '.\n'],
> + [],
> + 'mkdir', sbox.repo_url + '/A/D/umlaut',
> + '-m', "log msg")
> + rev_to_merge_to_copy_of_D = new_rev + 1
> +
> + # Search for the comment entitled "The Merge Kluge" elsewhere in
> + # this file, to understand why we shorten and chdir() below.
> + short_copy_of_A_D_path = shorten_path_kludge(copy_of_A_D_path)
> +
> + expected_output = wc.State(short_copy_of_A_D_path, {
> + 'umlaut' : Item(status='A '),
> + 'G/pi' : Item(status='G '),
> + 'G/rho' : Item(status='G '),
> + 'G/tau' : Item(status='G '),
> + 'H/chi' : Item(status='G '),
> + 'H/omega' : Item(status='G '),
> + 'H/psi' : Item(status='G '),
> + 'gamma' : Item(status='G '),
> + })
> +
> + expected_status = wc.State(short_copy_of_A_D_path, {
> + '' : Item(status=' M', wc_rev=copy_of_A_D_wc_rev),
> + 'G' : Item(status=' ', wc_rev=copy_of_A_D_wc_rev),
> + 'G/pi' : Item(status='MM', wc_rev=copy_of_A_D_wc_rev),
> + 'G/rho' : Item(status='MM', wc_rev=copy_of_A_D_wc_rev),
> + 'G/tau' : Item(status='MM', wc_rev=copy_of_A_D_wc_rev),
> + 'H' : Item(status=' ', wc_rev=copy_of_A_D_wc_rev),
> + 'H/chi' : Item(status='MM', wc_rev=copy_of_A_D_wc_rev),
> + 'H/omega' : Item(status='MM', wc_rev=copy_of_A_D_wc_rev),
> + 'H/psi' : Item(status='MM', wc_rev=copy_of_A_D_wc_rev),
> + 'gamma' : Item(status='MM', wc_rev=copy_of_A_D_wc_rev),
> + 'umlaut' : Item(status='A ', wc_rev=copy_of_A_D_wc_rev),
> + })
> +
> + svn_merged_rev_val = "3-" + str(rev_to_merge_to_copy_of_D)
> + expected_disk = wc.State('', {
> + '' : Item(props={SVN_PROP_MERGE_INFO : '/A/D:' + svn_merged_rev_val}),
> + 'G' : Item(),
> + 'G/pi' : Item(new_content_for_pi,
> + props={SVN_PROP_MERGE_INFO : '/A/D/G/pi:' + svn_merged_rev_val}),
> + 'G/rho' : Item(new_content_for_rho,
> + props={SVN_PROP_MERGE_INFO : '/A/D/G/rho:' + svn_merged_rev_val}),
> + 'G/tau' : Item(new_content_for_tau,
> + props={SVN_PROP_MERGE_INFO : '/A/D/G/tau:' + svn_merged_rev_val}),
> + 'H' : Item(),
> + 'H/chi' : Item(new_content_for_chi,
> + props={SVN_PROP_MERGE_INFO : '/A/D/H/chi:' + svn_merged_rev_val}),
> + 'H/omega' : Item(new_content_for_omega,
> + props={SVN_PROP_MERGE_INFO : '/A/D/H/omega:' + svn_merged_rev_val}),
> + 'H/psi' : Item(new_content_for_psi,
> + props={SVN_PROP_MERGE_INFO : '/A/D/H/psi:' + svn_merged_rev_val}),
> + 'gamma' : Item(new_content_for_psi,
> + props={SVN_PROP_MERGE_INFO : '/A/D/gamma:' + svn_merged_rev_val}),
> + 'umlaut' : Item(),
> + })
> + expected_skip = wc.State(short_copy_of_A_D_path, { })
> + saved_cwd = os.getcwd()
> + try:
> + os.chdir(svntest.main.work_dir)
> + svntest.actions.run_and_verify_merge(short_copy_of_A_D_path,
> + 2,
> + str(rev_to_merge_to_copy_of_D),
> + sbox.repo_url + '/A/D',
> + expected_output,
> + expected_disk,
> + expected_status,
> + expected_skip,
> + None,
> + None,
> + None,
> + None,
> + None, 1)
> + finally:
> + os.chdir(saved_cwd)
> +
> ########################################################################
> # Run the tests
>
> @@ -4428,6 +4696,7 @@
> XFail(merge_eolstyle_handling),
> avoid_repeated_merge_using_inherited_merge_info,
> avoid_repeated_merge_on_subtree_with_merge_info,
> + XFail(subtrees_with_merge_info_should_be_excluded_in_depth_first_order),
> ]
>
> if __name__ == '__main__':
>
>
> ------------------------------------------------------------------------
>
> [[[
>
> * subversion/tests/cmdline/merge_tests.py
> (modify_and_commit_source_merge_the_resulting_rev_to_dst,
> subtrees_with_merge_info_should_be_excluded_in_depth_first_order): New function
> (test_list): include the new testcase as XFail.
>
> Patch by: kameshj
> Found by: plundblad
> ]]]
Received on Mon Feb 12 23:27:41 2007