Return-Path: Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: (qmail 58603 invoked from network); 3 Mar 2011 18:18:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Mar 2011 18:18:28 -0000 Received: (qmail 58361 invoked by uid 500); 3 Mar 2011 18:18:28 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 58341 invoked by uid 500); 3 Mar 2011 18:18:28 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 58334 invoked by uid 99); 3 Mar 2011 18:18:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 18:18:28 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 18:18:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DE79F23888EC; Thu, 3 Mar 2011 18:18:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1076715 - in /subversion/trunk/subversion: libsvn_wc/wc-queries.sql libsvn_wc/wc_db.c tests/libsvn_wc/op-depth-test.c Date: Thu, 03 Mar 2011 18:18:06 -0000 To: commits@subversion.apache.org From: philip@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110303181806.DE79F23888EC@eris.apache.org> Author: philip Date: Thu Mar 3 18:18:06 2011 New Revision: 1076715 URL: http://svn.apache.org/viewvc?rev=1076715&view=rev Log: Make new recursive revert leave changelists. * subversion/libsvn_wc/wc_db.c (op_revert_recursive_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): Tweak select to match recursive case. (STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE, STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE): New. * subversion/tests/libsvn_wc/op-depth-test.c (test_op_revert_changelist): Add recursive cases. 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=1076715&r1=1076714&r2=1076715&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original) +++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Thu Mar 3 18:18:06 2011 @@ -360,8 +360,19 @@ WHERE wc_id = ?1 AND local_relpath = ?2 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)) + OR local_relpath NOT IN (SELECT local_relpath FROM nodes_current + WHERE wc_id = ?1 AND local_relpath = ?2 + AND kind = 'file')); + +-- STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE +DELETE FROM actual_node +WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#') + AND (changelist IS NULL + OR local_relpath NOT IN (SELECT local_relpath FROM nodes_current + WHERE wc_id = ?1 + AND (local_relpath = ?2 + OR local_relpath LIKE ?3 ESCAPE '#') + AND kind = 'file')); -- STMT_DELETE_CHILD_NODES_RECURSIVE DELETE FROM nodes @@ -382,6 +393,20 @@ SET properties = NULL, right_checksum = NULL WHERE wc_id = ?1 and local_relpath = ?2; +-- STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE +UPDATE actual_node +SET properties = NULL, + text_mod = NULL, + tree_conflict_data = NULL, + conflict_old = NULL, + conflict_new = NULL, + conflict_working = NULL, + prop_reject = NULL, + older_checksum = NULL, + left_checksum = NULL, + right_checksum = NULL +WHERE wc_id = ?1 and local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#'; + -- STMT_CLEAR_ACTUAL_NODE_LEAVING_CONFLICT UPDATE actual_node SET properties = NULL, Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1076715&r1=1076714&r2=1076715&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/wc_db.c (original) +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Mar 3 18:18:06 2011 @@ -3726,24 +3726,25 @@ op_revert_recursive_txn(void *baton, svn_boolean_t have_row; apr_int64_t op_depth; int affected_rows; + const char *like_arg = construct_like_arg(local_relpath, scratch_pool); /* ### Similar structure to op_revert_txn, should they be combined? */ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, - STMT_DELETE_ACTUAL_NODE_RECURSIVE)); - SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id, - local_relpath, - construct_like_arg(local_relpath, scratch_pool))); - SVN_ERR(svn_sqlite__step(&affected_rows, stmt)); - - SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_SELECT_NODE_INFO)); SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath)); SVN_ERR(svn_sqlite__step(&have_row, stmt)); if (!have_row) { SVN_ERR(svn_sqlite__reset(stmt)); + + SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, + STMT_DELETE_ACTUAL_NODE_RECURSIVE)); + SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id, + local_relpath, like_arg)); + SVN_ERR(svn_sqlite__step(&affected_rows, stmt)); + if (affected_rows) return SVN_NO_ERROR; /* actual-only revert */ @@ -3771,9 +3772,19 @@ op_revert_recursive_txn(void *baton, SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_DELETE_NODES_RECURSIVE)); SVN_ERR(svn_sqlite__bindf(stmt, "issi", wcroot->wc_id, - local_relpath, - construct_like_arg(local_relpath, scratch_pool), - op_depth)); + local_relpath, like_arg, 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, + local_relpath, like_arg)); + SVN_ERR(svn_sqlite__step_done(stmt)); + + SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, + STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE)); + SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id, + local_relpath, like_arg)); SVN_ERR(svn_sqlite__step_done(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=1076715&r1=1076714&r2=1076715&view=diff ============================================================================== --- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original) +++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Thu Mar 3 18:18:06 2011 @@ -2552,6 +2552,10 @@ test_op_revert_changelist(const svn_test }; SVN_ERR(revert(&b, "A/f", svn_depth_empty, before, after, before_actual, after_actual)); + SVN_ERR(revert(&b, "A/f", svn_depth_infinity, + before, after, before_actual, after_actual)); + SVN_ERR(revert(&b, "", svn_depth_infinity, + before, after, before_actual, after_actual)); } { @@ -2574,6 +2578,10 @@ test_op_revert_changelist(const svn_test }; SVN_ERR(revert(&b, "A/f", svn_depth_empty, before, after, common_actual, common_actual)); + SVN_ERR(revert(&b, "A/f", svn_depth_infinity, + before, after, common_actual, common_actual)); + SVN_ERR(revert(&b, "", svn_depth_infinity, + before, after, common_actual, common_actual)); } { @@ -2595,6 +2603,10 @@ test_op_revert_changelist(const svn_test }; SVN_ERR(revert(&b, "A/f", svn_depth_empty, before, after, common_actual, common_actual)); + SVN_ERR(revert(&b, "A/f", svn_depth_infinity, + before, after, common_actual, common_actual)); + SVN_ERR(revert(&b, "", svn_depth_infinity, + before, after, common_actual, common_actual)); } return SVN_NO_ERROR;