subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1076313 - in /subversion/trunk/subversion: libsvn_wc/wc-queries.sql libsvn_wc/wc_db.c tests/libsvn_wc/op-depth-test.c
Date Wed, 02 Mar 2011 18:01:00 GMT
Author: philip
Date: Wed Mar  2 18:00:59 2011
New Revision: 1076313

URL: http://svn.apache.org/viewvc?rev=1076313&view=rev
Log:
Make new non-recursive revert leave changelists.

* subversion/libsvn_wc/wc_db.c
  (op_revert_txn): Clear rather than remove actual nodes with
   changelist if they are still files.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST): New.

* subversion/tests/libsvn_wc/op-depth-test.c
  (test_funcs): Mark test_op_revert_changelist PASS.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc-queries.sql
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1076313&r1=1076312&r2=1076313&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Wed Mar  2 18:00:59 2011
@@ -356,6 +356,13 @@ DELETE FROM actual_node
 WHERE wc_id = ?1 AND local_relpath = ?2
       AND tree_conflict_data IS NULL;
 
+-- STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST
+DELETE FROM actual_node
+WHERE wc_id = ?1 AND local_relpath = ?2
+      AND (changelist IS NULL
+           OR 'file' NOT IN (SELECT kind FROM nodes_current
+                             WHERE wc_id  = ?1 AND local_relpath = ?2))
+
 -- STMT_DELETE_CHILD_NODES_RECURSIVE
 DELETE FROM nodes
 WHERE wc_id = ?1 AND local_relpath LIKE ?2 ESCAPE '#' AND op_depth = ?3

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1076313&r1=1076312&r2=1076313&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed Mar  2 18:00:59 2011
@@ -3603,12 +3603,6 @@ op_revert_txn(void *baton, svn_sqlite__d
          combined? */
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
-                                    STMT_DELETE_ACTUAL_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", b->wcroot->wc_id,
-                            b->local_relpath));
-  SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
                                     STMT_SELECT_NODE_INFO));
   SVN_ERR(svn_sqlite__bindf(stmt, "is", b->wcroot->wc_id,
                             b->local_relpath));
@@ -3616,6 +3610,12 @@ op_revert_txn(void *baton, svn_sqlite__d
   if (!have_row)
     {
       SVN_ERR(svn_sqlite__reset(stmt));
+
+      SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
+                                        STMT_DELETE_ACTUAL_NODE));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", b->wcroot->wc_id,
+                                b->local_relpath));
+      SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
       if (affected_rows)
         {
           /* Can't do non-recursive actual-only revert if actual-only
@@ -3688,6 +3688,20 @@ op_revert_txn(void *baton, svn_sqlite__d
       SVN_ERR(svn_sqlite__step_done(stmt));
     }
 
+  SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
+                                  STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", b->wcroot->wc_id,
+                            b->local_relpath));
+  SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+  if (!affected_rows)
+    {
+      SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
+                                    STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", b->wcroot->wc_id,
+                                b->local_relpath));
+      SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+    }
+
   return SVN_NO_ERROR;
 }
 

Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=1076313&r1=1076312&r2=1076313&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Wed Mar  2 18:00:59 2011
@@ -2638,7 +2638,7 @@ struct svn_test_descriptor_t test_funcs[
                        "test_del_replace_not_present"),
     SVN_TEST_OPTS_PASS(test_op_revert,
                        "test_op_revert"),
-    SVN_TEST_OPTS_WIMP(test_op_revert_changelist,
-                       "test_op_revert_changelist", "needs changelist support"),
+    SVN_TEST_OPTS_PASS(test_op_revert_changelist,
+                       "test_op_revert_changelist"),
     SVN_TEST_NULL
   };



Mime
View raw message