subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1879959 - /subversion/trunk/subversion/tests/cmdline/merge_tests.py
Date Thu, 16 Jul 2020 14:40:27 GMT
Author: julianfoad
Date: Thu Jul 16 14:40:27 2020
New Revision: 1879959

URL: http://svn.apache.org/viewvc?rev=1879959&view=rev
Log:
In recent merge tests, verify the merge result as well as success.

For issue #4859 "Merge removing a folder with non-inheritable mergeinfo ->
E155023: can't set properties: invalid status for updating properties".

* subversion/tests/cmdline/merge_tests.py
  (merge_deleted_folder_with_mergeinfo,
   merge_deleted_folder_with_mergeinfo_2): Verify the merge result.

Modified:
    subversion/trunk/subversion/tests/cmdline/merge_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_tests.py?rev=1879959&r1=1879958&r2=1879959&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_tests.py Thu Jul 16 14:40:27 2020
@@ -18508,6 +18508,10 @@ def merge_deleted_folder_with_mergeinfo(
 
   sbox.build()
 
+  was_cwd = os.getcwd()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
+
   # Some non-inheritable mergeinfo
   sbox.simple_propset('svn:mergeinfo', '/A/C:1*', 'A/D')
   sbox.simple_commit() # r2
@@ -18523,8 +18527,32 @@ def merge_deleted_folder_with_mergeinfo(
   sbox.simple_update()
 
   # A merge that removes that folder
-  svntest.actions.run_and_verify_svn(None, [],
-                                     'merge', '-c4', '^/branch_A', sbox.ospath('A'))
+  # (merge revision 4 only from 'branch_A' to 'A')
+  expected_output = wc.State(sbox.ospath(''), {
+    'A/D'    : Item(status='D '),
+    })
+  expected_mergeinfo_output = wc.State(sbox.ospath(''), {
+    'A'      : Item(status=' U'),
+    })
+  expected_status = svntest.actions.get_virginal_state(sbox.ospath('A'), 4).subtree('A')
+  expected_status.add({ '': Item(status=' M', wc_rev=4) })
+  expected_status.tweak_some(
+    lambda path, item: [True] if path.split('/')[0] == 'D' else [],
+    status='D ')
+  svntest.actions.run_and_verify_merge(sbox.ospath('A'), 3, 4,
+                                       '^/branch_A', None,
+                                       expected_output,
+                                       expected_mergeinfo_output,
+                                       None,
+                                       None,
+                                       expected_status,
+                                       wc.State('', {}),
+                                       [],
+                                       check_props=False,
+                                       dry_run=False  # as dry run is broken
+                                       )
+
+  os.chdir(was_cwd)
 
 # Issue #4859: Merge removing a folder with non-inheritable mergeinfo ->
 # E155023: can't set properties: invalid status for updating properties
@@ -18539,6 +18567,10 @@ def merge_deleted_folder_with_mergeinfo_
 
   sbox.build()
 
+  was_cwd = os.getcwd()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
+
   # Some non-inheritable mergeinfo
   sbox.simple_propset('svn:mergeinfo', '/A/C:1*', 'A/D')
   sbox.simple_commit() # r2
@@ -18571,9 +18603,42 @@ def merge_deleted_folder_with_mergeinfo_
   sbox.simple_update()
 
   # A merge that removes that folder
-  svntest.actions.run_and_verify_svn(None, [],
-                                     'merge', '^/branch_A', sbox.ospath('A'))
-  ### TODO: verify that mergeinfo is set/changed on A/D, A/D/G, A/D/G2.
+  expected_output = wc.State(sbox.ospath(''), {
+    'A/D'    : Item(status='A ', prev_status='D '),
+    'A/D/G'  : Item(status='A '),
+    'A/D/G2' : Item(status='A '),
+    })
+  # verify that mergeinfo is set/changed on A/D, A/D/G, A/D/G2.
+  #expected_mergeinfo_output = wc.State(sbox.ospath(''), {
+  #  'A'      : Item(status=' U'),
+  #  'A/D'    : Item(status=' G'),
+  #  'A/D/G'  : Item(status=' G'),  # varies, G or U: see issue #4862
+  #  'A/D/G2' : Item(status=' G'),  # varies, G or U: see issue #4862
+  #  })
+  expected_status = svntest.actions.get_virginal_state(sbox.ospath('A'), 7).subtree('A')
+  expected_status.tweak_some(
+    lambda path, item: [True] if path.split('/')[0] == 'D' else [],
+    status='D ')
+  expected_status.add({
+    ''     : Item(status=' M', wc_rev=7),
+    'D'    : Item(status='RM', copied='+', wc_rev='-'),
+    'D/G'  : Item(status=' M', copied='+', wc_rev='-'),
+    'D/G2' : Item(status=' M', copied='+', wc_rev='-'),
+    })
+  svntest.actions.run_and_verify_merge(sbox.ospath('A'), None, None,
+                                       '^/branch_A', None,
+                                       expected_output,
+                                       None, #expected_mergeinfo_output
+                                       None,
+                                       None,
+                                       expected_status,
+                                       wc.State('', {}),
+                                       [],
+                                       check_props=False,
+                                       dry_run=False  # as dry run is broken
+                                       )
+
+  os.chdir(was_cwd)
 
 ########################################################################
 # Run the tests



Mime
View raw message