You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2010/12/09 20:18:15 UTC

svn commit: r1044095 - /subversion/trunk/subversion/tests/cmdline/upgrade_tests.py

Author: philip
Date: Thu Dec  9 19:18:14 2010
New Revision: 1044095

URL: http://svn.apache.org/viewvc?rev=1044095&view=rev
Log:
The format 23 upgrade cannot handle the working copy used to
test the format 21 upgrade.

* subversion/tests/cmdline/upgrade_tests.py
  (read_tree_conflict_data, no_actual_node): New.
  (upgrade_tree_conflict_data): Don't use status if auto-upgrade
   fails, do a crude database rows/columns check.

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

Modified: subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/upgrade_tests.py?rev=1044095&r1=1044094&r2=1044095&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/upgrade_tests.py Thu Dec  9 19:18:14 2010
@@ -672,7 +672,22 @@ 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)"
 
@@ -688,7 +703,31 @@ def upgrade_tree_conflict_data(sbox):
   expected_status.tweak('A/D/G/rho', status='A ', copied='+',
                         treeconflict='C', wc_rev='-')
 
-  run_and_verify_status_no_server(wc_dir, expected_status)
+  # 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, so the
+  # auto-upgrade will fail.  If this happens we cannot use the
+  # Subversion libraries to query the working copy.
+  exit_code, output, errput = svntest.main.run_svn('format 22', 'st', 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?
+
 
 def delete_in_copy_upgrade(sbox):
   "upgrade a delete within a copy"