[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Update loses merge info - test case added

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2007-07-05 13:22:27 CEST

Thanks Senthil.

Committed in r25652.

With regards
Kamesh Jayachandran
Senthil Kumaran S wrote:
> Hi,
>
> I am attaching the patch for adding a test case which proves the
> following defect:
>
> When a working copy receives a fresh svn:mergeinfo property due to
> update,
> and working copy has some local mergeinfo(yet to be added), local
> mergeinfo
> is left unchanged.
>
> --
> Senthil Kumaran S
> http://www.stylesen.org
>
> ------------------------------------------------------------------------
>
> Index: trunk/subversion/tests/cmdline/merge_tests.py
> ===================================================================
> --- trunk/subversion/tests/cmdline/merge_tests.py (revision 25648)
> +++ trunk/subversion/tests/cmdline/merge_tests.py (working copy)
> @@ -6747,6 +6747,117 @@
> '/A/D/H/omega:1\n'],
> [], 'pl', '-vR', omega_path)
>
> +def update_loses_mergeinfo(sbox):
> + "update does not merge mergeinfo"
> +
> + """
> + When a working copy receives a fresh svn:mergeinfo property due to update,
> + and working copy has some local mergeinfo(yet to be added), local mergeinfo
> + is left unchanged.
> + """
> +
> + sbox.build()
> + wc_dir = sbox.wc_dir
> + A_C_wc_dir = wc_dir + '/A/C'
> + A_B_url = sbox.repo_url + '/A/B'
> + A_B_J_url = sbox.repo_url + '/A/B/J'
> + A_B_K_url = sbox.repo_url + '/A/B/K'
> + svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 2.\n'],
> + [], 'mkdir', '-m', 'rev 2', A_B_J_url)
> + svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 3.\n'],
> + [], 'mkdir', '-m', 'rev 3', A_B_K_url)
> +
> + other_wc = sbox.add_wc_path('other')
> + svntest.actions.duplicate_dir(wc_dir, other_wc)
> +
> + short_A_C_wc_dir = shorten_path_kludge(A_C_wc_dir)
> + expected_output = wc.State(short_A_C_wc_dir, {'J' : Item(status='A ')})
> + expected_disk = wc.State('', {
> + 'J' : Item(),
> + '' : Item(props={SVN_PROP_MERGE_INFO : '/A/B:2'}),
> + })
> + expected_status = wc.State(short_A_C_wc_dir,
> + { '' : Item(wc_rev=1, status=' M'),
> + 'J' : Item(status='A ',
> + wc_rev='-', copied='+')
> + }
> + )
> + expected_skip = wc.State('', { })
> + saved_cwd = os.getcwd()
> + os.chdir(svntest.main.work_dir)
> + svntest.actions.run_and_verify_merge(short_A_C_wc_dir, '1', '2',
> + A_B_url,
> + expected_output,
> + expected_disk,
> + expected_status,
> + expected_skip,
> + check_props=1)
> + os.chdir(saved_cwd)
> + expected_output = wc.State(A_C_wc_dir, {
> + '' : Item(verb='Sending'),
> + 'J' : Item(verb='Adding')
> + })
> + expected_status = wc.State(A_C_wc_dir,
> + { '' : Item(status=' ', wc_rev=4),
> + 'J' : Item(status=' ', wc_rev=4)
> + }
> + )
> + svntest.actions.run_and_verify_commit(A_C_wc_dir,
> + expected_output,
> + expected_status,
> + None,
> + None, None, None, None,
> + A_C_wc_dir)
> +
> + other_A_C_wc_dir = other_wc + '/A/C'
> + short_other_A_C_wc_dir = shorten_path_kludge(other_A_C_wc_dir)
> + expected_output = wc.State(short_other_A_C_wc_dir, {'K' : Item(status='A ')})
> + expected_disk = wc.State('', {
> + 'K' : Item(),
> + '' : Item(props={SVN_PROP_MERGE_INFO : '/A/B:3'}),
> + })
> + expected_status = wc.State(short_other_A_C_wc_dir,
> + { '' : Item(wc_rev=1, status=' M'),
> + 'K' : Item(status='A ',
> + wc_rev='-', copied='+')
> + }
> + )
> + expected_skip = wc.State('', { })
> + saved_cwd = os.getcwd()
> + os.chdir(svntest.main.work_dir)
> + svntest.actions.run_and_verify_merge(short_other_A_C_wc_dir, '2', '3',
> + A_B_url,
> + expected_output,
> + expected_disk,
> + expected_status,
> + expected_skip,
> + check_props=1)
> + os.chdir(saved_cwd)
> + expected_output = wc.State(other_A_C_wc_dir,
> + {'J' : Item(status='A '),
> + '' : Item(status=' G')
> + }
> + )
> + expected_disk = wc.State('', {
> + '' : Item(props={SVN_PROP_MERGE_INFO : '/A/B:2-3'}),
> + 'J' : Item(),
> + 'K' : Item(),
> + })
> + expected_status = wc.State(other_A_C_wc_dir,
> + { '' : Item(wc_rev=4, status=' M'),
> + 'J' : Item(status=' ', wc_rev='4'),
> + 'K' : Item(status='A ',
> + wc_rev='-', copied='+')
> + }
> + )
> + svntest.actions.run_and_verify_update(other_A_C_wc_dir,
> + expected_output,
> + expected_disk,
> + expected_status,
> + check_props=1)
> +
> +
> +
> ########################################################################
> # Run the tests
>
> @@ -6810,6 +6921,7 @@
> diff_repos_does_not_update_mergeinfo,
> avoid_reflected_revs,
> Skip(mergeinfo_and_skipped_paths, svntest.main.is_ra_type_file),
> + XFail(update_loses_mergeinfo),
> ]
>
> if __name__ == '__main__':
>
> ------------------------------------------------------------------------
>
> [[[
> Testcase to prove the following defect.
>
> When a working copy receives a fresh svn:mergeinfo property due to update,
> and working copy has some local mergeinfo(yet to be added), local mergeinfo
> is left unchanged.
>
> * subversion/tests/cmdline/merge_tests.py
> (update_loses_mergeinfo): New function.
> (test_list): Add 'update_loses_mergeinfo' to test_list
>
> Patch by: Senthil Kumaran <senthil@collab.net>
> kameshj
> ]]]
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jul 5 13:22:12 2007

This is an archived mail posted to the Subversion Dev mailing list.