Author: rhuijben
Date: Tue Feb 24 19:37:04 2015
New Revision: 1662089
URL: http://svn.apache.org/r1662089
Log:
Allow depth limited reverts of nodes that have excluded or not present
children, and avoid db query for things that will never exist.
(A delete-delete tree conflict that isn't placed on an existing node
can't have descendants)
* subversion/libsvn_wc/wc-queries.sql
(STMT_SELECT_GE_OP_DEPTH_CHILDREN): Check for children that are there.
(STMT_ACTUAL_HAS_CHILDREN): Remove unused statement.
* subversion/libsvn_wc/wc_db.c
(op_revert_txn): Remove unneeded query.
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=1662089&r1=1662088&r2=1662089&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:37:04 2015
@@ -344,7 +344,8 @@ 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 != MAP_BASE_DELETED))
+ AND (op_depth > ?3 OR (op_depth = ?3
+ AND presence IN (MAP_NORMAL, MAP_DELETED)))
UNION ALL
SELECT 1 FROM ACTUAL_NODE a
WHERE wc_id = ?1 AND parent_relpath = ?2
@@ -1127,11 +1128,6 @@ 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=1662089&r1=1662088&r2=1662089&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:37:04 2015
@@ -6821,20 +6821,7 @@ op_revert_txn(void *baton,
SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
if (affected_rows)
{
- /* 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));
+ /* An actual only node can't have descendants so we're done */
return SVN_NO_ERROR;
}