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

Re: redundant "conflicts"

From: Marcus Comstedt <marcus_at_mc.pp.se>
Date: 2002-01-24 18:43:30 CET

Karl Fogel <kfogel@newton.ch.collab.net> writes:

> Sure -- was it the regression test that established that the change
> didn't work? Sounds like it would be useful to have...

Not that this couldn't have been established just as well without the
test, but yes it was actually the test that did it. :-)

Ok, this probably will need some serious reviewing as it's my first
Subversion regression test, but here goes (invocation of the
particular test commented out since the code hasn't yet reached the
point from whence to regress)...

Index: ./subversion/tests/clients/cmdline/update_tests.py
===================================================================
--- ./subversion/tests/clients/cmdline/update_tests.py
+++ ./subversion/tests/clients/cmdline/update_tests.py Thu Jan 24 18:40:41 2002
@@ -475,6 +475,70 @@
                                                '-r', '0')
 
 
+#----------------------------------------------------------------------
+
+def update_ignores_applied(sbox):
+ "ensure update ignores patches that have already been applied by hand"
+
+ if sbox.build():
+ return 1
+
+ wc_dir = sbox.wc_dir
+
+ # Make a file consisting of thee major parts, with a spelling
+ # error in each.
+ kappa_A1 = "This is the file 'cappa'."+"\n"*8
+ kappa_B1 = "It is devided into three parts by many LFs"+"\n"*8
+ kappa_C1 = "so that eash part can become a 'hunk'.\n"
+ kappa_path = os.path.join(wc_dir, 'kappa')
+ fp = open(kappa_path, 'w')
+ fp.write(kappa_A1+kappa_B1+kappa_C1)
+ fp.close()
+
+ # Add it to the repository as rev 2
+ svntest.main.run_svn(None, 'add', kappa_path)
+ svntest.main.run_svn(None, 'commit', kappa_path)
+
+ # Prepare fixes for all the spelling errors
+ kappa_A2 = kappa_A1[:18]+"k"+kappa_A1[19:]
+ kappa_B2 = kappa_B1[:7]+"i"+kappa_B1[8:]
+ kappa_C2 = kappa_C1[:10]+"c"+kappa_C1[11:]
+
+ # Apply fixes A and B, and commit (becomes rev 3)
+ fp = open(kappa_path, 'w')
+ fp.write(kappa_A2+kappa_B2+kappa_C1)
+ fp.close()
+ svntest.main.run_svn(None, 'commit', kappa_path)
+
+ # Now, revert the file to rev 2 and apply fixes B and C!
+ svntest.main.run_svn(None, 'update', '-r2', kappa_path)
+ fp = open(kappa_path, 'w')
+ fp.write(kappa_A1+kappa_B2+kappa_C2)
+ fp.close()
+
+ # Updating should now give us a merged file with all the three
+ # fixes and no conflicts
+ output_list = [ [kappa_path, None, {}, {'status' : 'G '}] ]
+ expected_output_tree = svntest.tree.build_generic_tree(output_list)
+ disk_list = svntest.main.copy_greek_tree()
+ disk_list.append(['kappa', kappa_A2+kappa_B2+kappa_C2, {}, {}])
+ expected_disk_tree = svntest.tree.build_generic_tree(disk_list)
+
+ # The expected status is that the file is modified from rev 3
+ status_list = svntest.actions.get_virginal_status_list(wc_dir, '3')
+ status_list.append([kappa_path, None, {},
+ {'status' : 'M ',
+ 'wc_rev' : '3',
+ 'repos_rev' : '3'}])
+ expected_status_tree = svntest.tree.build_generic_tree(status_list)
+
+ # Do it
+ return svntest.actions.run_and_verify_update(wc_dir,
+ expected_output_tree,
+ expected_disk_tree,
+ expected_status_tree)
+
+
 ########################################################################
 # Run the tests
 
@@ -484,6 +548,7 @@
               update_binary_file,
               update_binary_file_2,
               update_ignores_added,
+ # update_ignores_applied,
               update_to_rev_zero,
               # update_missing,
              ]

  // Marcus

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:59 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.