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

[PATCH][merge-tracking]Testcase to exhibit the defect in mergeinfo retrieval from the grand parent

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-10-27 15:08:58 CEST

Hi All,
Find the attached patch and log.

The patch I had attached to the list with the subject
'[PATCH][merge-tracking]get_merge_info_for_path eliding fails when
ancestor has mergeinfo or null mergeinfo.(Take2)' on 19-10-2006 should
fix this.

Till it gets committed I want this testcase to have XFail.

With regards
Kamesh Jayachandran

[[[
Test case to showcase the failure of mergeinfo retrieval on a path
which has elided mergeinfo and its immedeate parent path too having a elided
mergeinfo while grandparent of path having the direct mergeinfo.

* subversion/tests/cmdline/merge_tests.py
  (mergeinfo_retrieval_from_grand_parent):
   New function.
  (tests_list):
   included the above test as XFail.

Patch by: Kamesh Jayachandran <kamesh@collab.net>
]]]

Index: subversion/tests/cmdline/merge_tests.py
===================================================================
--- subversion/tests/cmdline/merge_tests.py (revision 22136)
+++ subversion/tests/cmdline/merge_tests.py (working copy)
@@ -3891,6 +3891,167 @@
                                        expected_backup_status,
                                        expected_backup_skip)
 
+def mergeinfo_retrieval_from_grand_parent(sbox):
+ "mergeinfo retrieval from grand parent"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ A_path = os.path.join(wc_dir, 'A')
+ A_B_path = os.path.join(A_path, 'B')
+ A_B_E_path = os.path.join(A_B_path, 'E')
+ A_B_F_path = os.path.join(A_B_path, 'F')
+ svntest.main.run_svn(None, "mv", A_B_E_path, A_B_F_path)
+ # commit the move, creating revision 2.
+ expected_output = wc.State(wc_dir, {
+ 'A/B/E' : Item(verb='Deleting'),
+ 'A/B/F/E' : Item(verb='Adding')
+ })
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.add({
+ 'A/B/F/E' : Item(status=' ', wc_rev=2),
+ 'A/B/F/E/alpha' : Item(status=' ', wc_rev=2),
+ 'A/B/F/E/beta' : Item(status=' ', wc_rev=2),
+ })
+ expected_status.remove('A/B/E',
+ 'A/B/E/alpha',
+ 'A/B/E/beta')
+
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ expected_status, None,
+ None, None, None, None, wc_dir)
+
+ svntest.actions.run_and_verify_svn(None, None, [], 'update', wc_dir)
+
+ copy_of_B_path = os.path.join(A_path, 'copy_of_B')
+
+ svntest.main.run_svn(None, "cp", A_B_path, copy_of_B_path)
+
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/copy_of_B' : Item(verb='Adding'),
+ })
+ expected_status.tweak(wc_rev=2)
+ expected_status.add({
+ 'A/copy_of_B' : Item(status=' ', wc_rev=3),
+ 'A/copy_of_B/F' : Item(status=' ', wc_rev=3),
+ 'A/copy_of_B/F/E' : Item(status=' ', wc_rev=3),
+ 'A/copy_of_B/F/E/alpha': Item(status=' ', wc_rev=3),
+ 'A/copy_of_B/F/E/beta' : Item(status=' ', wc_rev=3),
+ 'A/copy_of_B/lambda' : Item(status=' ', wc_rev=3),
+ })
+ # commit the copy_of_B, creating revision 3.
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ expected_status, None,
+ None, None, None, None, wc_dir)
+ alpha_path = os.path.join(A_B_F_path, 'E', 'alpha')
+ new_content_to_alpha = 'new content to alpha\n'
+ fp = open(alpha_path, 'w')
+ fp.write(new_content_to_alpha)
+ fp.close()
+
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/B/F/E/alpha' : Item(verb='Sending'),
+ })
+
+ expected_status.tweak('A/B/F/E/alpha', wc_rev=4)
+ # commit the modification, creating revision 4.
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ expected_status, None,
+ None, None, None, None, wc_dir)
+ # Search for the comment entitled "The Merge Kluge" elsewhere in
+ # this file, to understand why we shorten and chdir() below.
+ short_copy_of_B_path = shorten_path_kludge(copy_of_B_path)
+
+ # Merge changes from r3:4 of /A/B into our /A/copy_of_B
+ expected_output = wc.State(short_copy_of_B_path, {
+ 'F/E/alpha' : Item(status='U '),
+ })
+ expected_status = wc.State(short_copy_of_B_path, {
+ '' : Item(status=' M', wc_rev=3),
+ 'F/E' : Item(status=' ', wc_rev=3),
+ 'F/E/alpha' : Item(status='M ', wc_rev=3),
+ 'F/E/beta' : Item(status=' ', wc_rev=3),
+ 'lambda' : Item(status=' ', wc_rev=3),
+ 'F' : Item(status=' ', wc_rev=3),
+ })
+
+ expected_disk = wc.State('', {
+ '' : Item(props={SVN_PROP_MERGE_INFO : '/A/B:4'}),
+ 'F/E' : Item(),
+ 'F/E/alpha' : Item(new_content_to_alpha),
+ 'F/E/beta' : Item("This is the file 'beta'.\n"),
+ 'F' : Item(),
+ 'lambda' : Item("This is the file 'lambda'.\n")
+ })
+ expected_skip = wc.State(short_copy_of_B_path, { })
+ saved_cwd = os.getcwd()
+ try:
+ os.chdir(svntest.main.work_dir)
+ svntest.actions.run_and_verify_merge(short_copy_of_B_path, '3', '4',
+ svntest.main.current_repo_url + \
+ '/A/B',
+ expected_output,
+ expected_disk,
+ expected_status,
+ expected_skip,
+ None,
+ None,
+ None,
+ None,
+ None, 1)
+ finally:
+ os.chdir(saved_cwd)
+
+ expected_output = svntest.wc.State(copy_of_B_path, {
+ '' : Item(verb='Sending'),
+ 'F/E/alpha' : Item(verb='Sending'),
+ })
+ #commit the merge, creating revision 5
+ svntest.actions.run_and_verify_commit(short_copy_of_B_path, expected_output,
+ None, None,
+ None, None, None, None, wc_dir)
+ copy_of_B_F_E_path = os.path.join(copy_of_B_path, 'F', 'E')
+ #without update following merge would result in updating the
+ #mergeinfo prop alone as the wc_rev of /A/copy_of_B/F is 3
+ #hence ancestor /A/copy_of_B for rev 3 give no mergeinfo
+ #resulting in repeated merge.
+ svntest.actions.run_and_verify_svn(None, None, [], 'update', wc_dir)
+ # Search for the comment entitled "The Merge Kluge" elsewhere in
+ # this file, to understand why we shorten and chdir() below.
+ short_copy_of_B_F_E_path = shorten_path_kludge(copy_of_B_F_E_path)
+ # Merge changes from r3:4 of /A/B/F into our /A/copy_of_B/F
+ expected_output = wc.State(copy_of_B_F_E_path, { })
+
+ expected_status = wc.State(short_copy_of_B_F_E_path, {
+ '' : Item(status=' ', wc_rev=5),
+ 'alpha' : Item(status=' ', wc_rev=5),
+ 'beta' : Item(status=' ', wc_rev=5),
+ })
+
+ expected_disk = wc.State('', {
+ 'alpha' : Item(new_content_to_alpha),
+ 'beta' : Item("This is the file 'beta'.\n"),
+ })
+
+ expected_skip = wc.State(short_copy_of_B_F_E_path, { })
+ saved_cwd = os.getcwd()
+ try:
+ os.chdir(svntest.main.work_dir)
+ svntest.actions.run_and_verify_merge(short_copy_of_B_F_E_path, '3', '4',
+ svntest.main.current_repo_url + \
+ '/A/B/F/E',
+ expected_output,
+ expected_disk,
+ expected_status,
+ expected_skip,
+ None,
+ None,
+ None,
+ None,
+ None, 1)
+ finally:
+ os.chdir(saved_cwd)
+
 ########################################################################
 # Run the tests
 
@@ -3935,6 +4096,7 @@
               merge_add_over_versioned_file_conflicts,
               merge_conflict_markers_matching_eol,
               XFail(merge_eolstyle_handling),
+ XFail(mergeinfo_retrieval_from_grand_parent),
              ]
 
 if __name__ == '__main__':

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Oct 27 15:09:26 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.