You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2018/11/07 12:30:11 UTC

svn commit: r1846002 [38/44] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ build/generator/util/ build/win32/ contrib/client-side/ contrib/client-side/svn_load_dirs/ contr...

Modified: subversion/branches/ra-git/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/upgrade_tests.py?rev=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/upgrade_tests.py Wed Nov  7 12:30:06 2018
@@ -392,7 +392,8 @@ def xml_entries_relocate(path, from_url,
   entries = os.path.join(path, adm_name, 'entries')
   txt = open(entries).read().replace('url="' + from_url, 'url="' + to_url)
   os.chmod(entries, svntest.main.S_ALL_RWX)
-  open(entries, 'w').write(txt)
+  with open(entries, 'w') as f:
+    f.write(txt)
 
   for dirent in os.listdir(path):
     item_path = os.path.join(path, dirent)
@@ -410,7 +411,8 @@ def simple_entries_replace(path, from_ur
   entries = os.path.join(path, adm_name, 'entries')
   txt = open(entries).read().replace(from_url, to_url)
   os.chmod(entries, svntest.main.S_ALL_RWX)
-  open(entries, 'wb').write(txt.encode())
+  with open(entries, 'wb') as f:
+    f.write(txt.encode())
 
   for dirent in os.listdir(path):
     item_path = os.path.join(path, dirent)
@@ -761,61 +763,6 @@ def dirs_only_upgrade(sbox):
       })
   run_and_verify_status_no_server(sbox.wc_dir, expected_status)
 
-def read_tree_conflict_data(sbox, path):
-  dot_svn = svntest.main.get_admin_name()
-  db = svntest.sqlite3.connect(os.path.join(sbox.wc_dir, dot_svn, 'wc.db'))
-  for row in db.execute("select tree_conflict_data from actual_node "
-                        "where tree_conflict_data is not null "
-                        "and local_relpath = '%s'" % path):
-    return
-  raise svntest.Failure("conflict expected for '%s'" % path)
-
-def no_actual_node(sbox, path):
-  dot_svn = svntest.main.get_admin_name()
-  db = svntest.sqlite3.connect(os.path.join(sbox.wc_dir, dot_svn, 'wc.db'))
-  for row in db.execute("select 1 from actual_node "
-                        "where local_relpath = '%s'" % path):
-    raise svntest.Failure("no actual node expected for '%s'" % path)
-
-def upgrade_tree_conflict_data(sbox):
-  "upgrade tree conflict data (f20->f21)"
-
-  wc_dir = sbox.wc_dir
-  replace_sbox_with_tarfile(sbox, 'upgrade_tc.tar.bz2')
-
-  # Check and see if we can still read our tree conflicts
-  expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
-  expected_status.tweak('A/D/G/pi', status='D ', treeconflict='C')
-  expected_status.tweak('A/D/G/tau', status='! ', treeconflict='C',
-                        wc_rev=None)
-  expected_status.tweak('A/D/G/rho', status='A ', copied='+',
-                        treeconflict='C', wc_rev='-')
-
-  # Look inside pre-upgrade database
-  read_tree_conflict_data(sbox, 'A/D/G')
-  no_actual_node(sbox, 'A/D/G/pi')
-  no_actual_node(sbox, 'A/D/G/rho')
-  no_actual_node(sbox, 'A/D/G/tau')
-
-  # While the upgrade from f20 to f21 will work the upgrade from f22
-  # to f23 will not, since working nodes are present.
-  exit_code, output, errput = svntest.main.run_svn('format 22', 'upgrade',
-                                                    wc_dir)
-
-  if not exit_code:
-    run_and_verify_status_no_server(wc_dir, expected_status)
-  else:
-    if not svntest.verify.RegexOutput('.*format 22 with WORKING nodes.*',
-                                      match_all=False).matches(errput):
-      raise svntest.Failure()
-
-  # Look insde post-upgrade database
-  read_tree_conflict_data(sbox, 'A/D/G/pi')
-  read_tree_conflict_data(sbox, 'A/D/G/rho')
-  read_tree_conflict_data(sbox, 'A/D/G/tau')
-  # no_actual_node(sbox, 'A/D/G')  ### not removed but should be?
-
-
 @Issue(3898)
 def delete_in_copy_upgrade(sbox):
   "upgrade a delete within a copy"
@@ -972,27 +919,6 @@ def tree_replace2(sbox):
     })
   run_and_verify_status_no_server(sbox.wc_dir, expected_status)
 
-def upgrade_from_format_28(sbox):
-  """upgrade from format 28: rename pristines"""
-
-  # Start with a format-28 WC that is a clean checkout of the Greek tree.
-  replace_sbox_with_tarfile(sbox, 'format_28.tar.bz2')
-
-  # Get the old and new pristine file paths for file 'iota'.
-  checksum = '2c0aa9014a0cd07f01795a333d82485ef6d083e2'
-  old_pristine_path = os.path.join(sbox.wc_dir, svntest.main.get_admin_name(),
-                                   'pristine', checksum[0:2], checksum)
-  new_pristine_path = old_pristine_path + '.svn-base'
-
-  assert os.path.exists(old_pristine_path)
-  assert not os.path.exists(new_pristine_path)
-
-  # Upgrade the WC
-  svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
-
-  assert not os.path.exists(old_pristine_path)
-  assert os.path.exists(new_pristine_path)
-
 @Issue(3901)
 def depth_exclude(sbox):
   "upgrade 1.6.x wc that has depth=exclude"
@@ -1606,13 +1532,11 @@ test_list = [ None,
               missing_dirs2,
               delete_and_keep_local,
               dirs_only_upgrade,
-              upgrade_tree_conflict_data,
               delete_in_copy_upgrade,
               replaced_files,
               upgrade_with_scheduled_change,
               tree_replace1,
               tree_replace2,
-              upgrade_from_format_28,
               depth_exclude,
               depth_exclude_2,
               add_add_del_del_tc,