You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2011/05/17 18:38:59 UTC

svn commit: r1104387 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c tests/cmdline/revert_tests.py

Author: gstein
Date: Tue May 17 16:38:59 2011
New Revision: 1104387

URL: http://svn.apache.org/viewvc?rev=1104387&view=rev
Log:
Revert r1104308. This "fix" breaks op-depth-test.c, presumably due to a
query such as STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE which
avoids deleting an ACTUAL_NODE row because the row is still in
NODES_CURRENT (whereas, before, the NODES was updated first).

I'll figure out the right solution, and try again...
* subversion/tests/cmdline/revert_tests.py: put XFail back

* subversion/libsvn_wc/wc_db.c:
  (...): revert changes

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/tests/cmdline/revert_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1104387&r1=1104386&r2=1104387&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue May 17 16:38:59 2011
@@ -5430,21 +5430,6 @@ op_revert_txn(void *baton,
   op_depth = svn_sqlite__column_int64(stmt, 0);
   SVN_ERR(svn_sqlite__reset(stmt));
 
-  /* Handle ACTUAL_NODE first. We want any changes to NODES, which fire
-     triggers to update 'revert_list', to take precedence over these
-     changes to ACTUAL_NODE.  */
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                  STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
-  SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
-  if (!affected_rows)
-    {
-      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST));
-      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
-      SVN_ERR(svn_sqlite__step_done(stmt));
-    }
-
   if (op_depth > 0 && op_depth == relpath_depth(local_relpath))
     {
       /* Can't do non-recursive revert if children exist */
@@ -5484,6 +5469,18 @@ op_revert_txn(void *baton,
       SVN_ERR(svn_sqlite__step_done(stmt));
     }
 
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                  STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+  if (!affected_rows)
+    {
+      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                    STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
+      SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+    }
+
   return SVN_NO_ERROR;
 }
 
@@ -5542,9 +5539,12 @@ op_revert_recursive_txn(void *baton,
   if (!op_depth)
     op_depth = 1; /* Don't delete BASE nodes */
 
-  /* Handle ACTUAL_NODE first. We want any changes to NODES, which fire
-     triggers to update 'revert_list', to take precedence over these
-     changes to ACTUAL_NODE.  */
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                    STMT_DELETE_NODES_RECURSIVE));
+  SVN_ERR(svn_sqlite__bindf(stmt, "isi", wcroot->wc_id,
+                            local_relpath, op_depth));
+  SVN_ERR(svn_sqlite__step_done(stmt));
+
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                         STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE));
   SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id,
@@ -5557,12 +5557,6 @@ op_revert_recursive_txn(void *baton,
                             local_relpath, like_arg));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_DELETE_NODES_RECURSIVE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "isi", wcroot->wc_id,
-                            local_relpath, op_depth));
-  SVN_ERR(svn_sqlite__step_done(stmt));
-
   /* ### This removes the locks, but what about the access batons? */
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_DELETE_WC_LOCK_ORPHAN_RECURSIVE));

Modified: subversion/trunk/subversion/tests/cmdline/revert_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/revert_tests.py?rev=1104387&r1=1104386&r2=1104387&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/revert_tests.py Tue May 17 16:38:59 2011
@@ -1261,7 +1261,7 @@ def revert_nested_add_depth_immediates(s
   expected_status.remove('A/X', 'A/X/Y')
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
-
+@XFail()
 @Issue(3859)
 def revert_empty_actual(sbox):
   "revert with superfluous actual node"