subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1662090 - in /subversion/branches/1.9.x-update-tc-detection/subversion/libsvn_wc: wc-queries.sql wc_db.c
Date Tue, 24 Feb 2015 19:47:30 GMT
Author: rhuijben
Date: Tue Feb 24 19:47:29 2015
New Revision: 1662090

URL: http://svn.apache.org/r1662090
Log:
On the 1.9.x-update-tc-detection branch: revert r1662089

Modified:
    subversion/branches/1.9.x-update-tc-detection/subversion/libsvn_wc/wc-queries.sql
    subversion/branches/1.9.x-update-tc-detection/subversion/libsvn_wc/wc_db.c

Modified: subversion/branches/1.9.x-update-tc-detection/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-update-tc-detection/subversion/libsvn_wc/wc-queries.sql?rev=1662090&r1=1662089&r2=1662090&view=diff
==============================================================================
--- subversion/branches/1.9.x-update-tc-detection/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/1.9.x-update-tc-detection/subversion/libsvn_wc/wc-queries.sql Tue
Feb 24 19:47:29 2015
@@ -344,8 +344,7 @@ ORDER BY local_relpath
 -- STMT_SELECT_GE_OP_DEPTH_CHILDREN
 SELECT 1 FROM nodes
 WHERE wc_id = ?1 AND parent_relpath = ?2
-  AND (op_depth > ?3 OR (op_depth = ?3
-                         AND presence IN (MAP_NORMAL, MAP_DELETED)))
+  AND (op_depth > ?3 OR (op_depth = ?3 AND presence != MAP_BASE_DELETED))
 UNION ALL
 SELECT 1 FROM ACTUAL_NODE a
 WHERE wc_id = ?1 AND parent_relpath = ?2
@@ -1128,6 +1127,11 @@ WHERE wc_id = ?1 AND local_relpath = ?2
 UPDATE nodes SET repos_id = ?3, repos_path = ?4
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
 
+-- STMT_ACTUAL_HAS_CHILDREN
+SELECT 1 FROM actual_node
+WHERE wc_id = ?1 AND parent_relpath = ?2
+LIMIT 1
+
 -- STMT_INSERT_EXTERNAL
 INSERT OR REPLACE INTO externals (
     wc_id, local_relpath, parent_relpath, presence, kind, def_local_relpath,

Modified: subversion/branches/1.9.x-update-tc-detection/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-update-tc-detection/subversion/libsvn_wc/wc_db.c?rev=1662090&r1=1662089&r2=1662090&view=diff
==============================================================================
--- subversion/branches/1.9.x-update-tc-detection/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/1.9.x-update-tc-detection/subversion/libsvn_wc/wc_db.c Tue Feb 24
19:47:29 2015
@@ -6821,7 +6821,20 @@ op_revert_txn(void *baton,
       SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
       if (affected_rows)
         {
-          /* An actual only node can't have descendants so we're done */
+          /* Can't do non-recursive actual-only revert if actual-only
+             children exist. Raise an error to cancel the transaction.  */
+          SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                            STMT_ACTUAL_HAS_CHILDREN));
+          SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
+          SVN_ERR(svn_sqlite__step(&have_row, stmt));
+          SVN_ERR(svn_sqlite__reset(stmt));
+          if (have_row)
+            return svn_error_createf(SVN_ERR_WC_INVALID_OPERATION_DEPTH, NULL,
+                                     _("Can't revert '%s' without"
+                                       " reverting children"),
+                                     path_for_error_message(wcroot,
+                                                            local_relpath,
+                                                            scratch_pool));
           return SVN_NO_ERROR;
         }
 



Mime
View raw message