You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2012/07/05 23:44:16 UTC
svn commit: r1357950 - in /subversion/trunk/subversion: libsvn_wc/adm_ops.c
libsvn_wc/update_editor.c libsvn_wc/wc_db.c libsvn_wc/wc_db.h
tests/libsvn_wc/op-depth-test.c
Author: rhuijben
Date: Thu Jul 5 21:44:15 2012
New Revision: 1357950
URL: http://svn.apache.org/viewvc?rev=1357950&view=rev
Log:
Following up on r1357929, also add conflict and work_items to
svn_wc__db_op_delete(). This allows reinstalling the tree_conflict
again in the update_editor for when it has just been deleted.
Avoid setting up and removing the notification table if no
notifications are required, such as from the update editor.
* subversion/libsvn_wc/adm_ops.c
(svn_wc__delete_internal): Update caller.
* subversion/libsvn_wc/update_editor.c
(delete_entry): Update caller.
(add_directory): Update caller. Pass conflict.
* subversion/libsvn_wc/wc_db.c
(op_delete_baton_t): Add variables.
(delete_node): Allow setting work_items and conflict. Make notify
handling optional.
(svn_wc__db_op_delete): Reorder arguments. Optimize non-notify case
Allow setting work_items and conflict.
* subversion/libsvn_wc/wc_db.h
(svn_wc__db_op_delete): Reorder arguments as suggested by TODO. Add standard
arguments.
* subversion/tests/libsvn_wc/op-depth-test.c
(do_delete): Update caller.
Modified:
subversion/trunk/subversion/libsvn_wc/adm_ops.c
subversion/trunk/subversion/libsvn_wc/update_editor.c
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1357950&r1=1357949&r2=1357950&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Thu Jul 5 21:44:15 2012
@@ -840,8 +840,9 @@ svn_wc__delete_internal(svn_wc_context_t
scratch_pool, scratch_pool));
SVN_ERR(svn_wc__db_op_delete(db, local_abspath, moved_to_abspath,
- notify_func, notify_baton,
+ NULL, NULL,
cancel_func, cancel_baton,
+ notify_func, notify_baton,
pool));
if (!keep_local && conflicted && conflicts != NULL)
Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1357950&r1=1357949&r2=1357950&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Thu Jul 5 21:44:15 2012
@@ -1872,8 +1872,9 @@ delete_entry(const char *path,
* by deleting the node from the moved-away subtree. */
/* ### This should probably use a work queue. */
SVN_ERR(svn_wc__db_op_delete(eb->db, moved_to_abspath, NULL,
- NULL, NULL, /* notify below */
+ NULL, NULL,
eb->cancel_func, eb->cancel_baton,
+ NULL, NULL, /* notify below */
scratch_pool));
if (kind == svn_kind_dir)
SVN_ERR(svn_io_remove_dir2(moved_to_abspath, TRUE,
@@ -2255,8 +2256,9 @@ add_directory(const char *path,
if (db->shadowed && db->obstruction_found)
{
SVN_ERR(svn_wc__db_op_delete(eb->db, db->local_abspath, NULL,
- NULL, NULL /* notification */,
+ tree_conflict, NULL,
eb->cancel_func, eb->cancel_baton,
+ NULL, NULL /* notification */,
pool));
}
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1357950&r1=1357949&r2=1357950&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Jul 5 21:44:15 2012
@@ -6758,6 +6758,9 @@ delete_update_movedto(svn_wc__db_wcroot_
struct op_delete_baton_t {
int delete_depth; /* op-depth for root of delete */
const char *moved_to_relpath; /* NULL if delete is not part of a move */
+ svn_skel_t *conflict;
+ svn_skel_t *work_items;
+ svn_boolean_t notify;
};
/* This structure is used while rewriting move information for nodes.
@@ -7040,11 +7043,14 @@ delete_node(void *baton,
}
/* ### Put actual-only nodes into the list? */
- SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
- STMT_INSERT_DELETE_LIST));
- SVN_ERR(svn_sqlite__bindf(stmt, "isd",
- wcroot->wc_id, local_relpath, select_depth));
- SVN_ERR(svn_sqlite__step_done(stmt));
+ if (b->notify)
+ {
+ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+ STMT_INSERT_DELETE_LIST));
+ SVN_ERR(svn_sqlite__bindf(stmt, "isd",
+ wcroot->wc_id, local_relpath, select_depth));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+ }
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_DELETE_NODES_ABOVE_DEPTH_RECURSIVE));
@@ -7105,6 +7111,10 @@ delete_node(void *baton,
}
}
+ SVN_ERR(add_work_items(wcroot->sdb, b->work_items, scratch_pool));
+ if (b->conflict)
+ SVN_ERR(mark_conflict(wcroot, local_relpath, b->conflict, scratch_pool));
+
return SVN_NO_ERROR;
}
@@ -7146,6 +7156,9 @@ op_delete_many_txn(void *baton,
svn_pool_clear(iterpool);
odb.delete_depth = relpath_depth(target_relpath);
odb.moved_to_relpath = NULL;
+ odb.conflict = NULL;
+ odb.work_items = NULL;
+ odb.notify = TRUE;
SVN_ERR(delete_node(&odb, wcroot, target_relpath, iterpool));
}
svn_pool_destroy(iterpool);
@@ -7210,10 +7223,12 @@ svn_error_t *
svn_wc__db_op_delete(svn_wc__db_t *db,
const char *local_abspath,
const char *moved_to_abspath,
- svn_wc_notify_func2_t notify_func,
- void *notify_baton,
+ svn_skel_t *conflict,
+ svn_skel_t *work_items,
svn_cancel_func_t cancel_func,
void *cancel_baton,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
apr_pool_t *scratch_pool)
{
svn_wc__db_wcroot_t *wcroot;
@@ -7252,19 +7267,35 @@ svn_wc__db_op_delete(svn_wc__db_t *db,
odb.delete_depth = relpath_depth(local_relpath);
odb.moved_to_relpath = moved_to_relpath;
+ odb.conflict = conflict;
+ odb.work_items = work_items;
+
+ if (notify_func)
+ {
+ /* Perform the deletion operation (transactionally), perform any
+ notifications necessary, and then clean out our temporary tables. */
+ odb.notify = TRUE;
+ SVN_ERR(with_finalization(wcroot, local_relpath,
+ op_delete_txn, &odb,
+ do_delete_notify, NULL,
+ cancel_func, cancel_baton,
+ notify_func, notify_baton,
+ STMT_FINALIZE_DELETE,
+ scratch_pool));
+ }
+ else
+ {
+ /* Avoid the trigger work */
+ odb.notify = FALSE;
+ SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath,
+ delete_node, &odb,
+ scratch_pool));
+ }
SVN_ERR(flush_entries(wcroot, local_abspath, svn_depth_infinity,
scratch_pool));
- /* Perform the deletion operation (transactionally), perform any
- notifications necessary, and then clean out our temporary tables. */
- return svn_error_trace(with_finalization(wcroot, local_relpath,
- op_delete_txn, &odb,
- do_delete_notify, NULL,
- cancel_func, cancel_baton,
- notify_func, notify_baton,
- STMT_FINALIZE_DELETE,
- scratch_pool));
+ return SVN_NO_ERROR;
}
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1357950&r1=1357949&r2=1357950&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Thu Jul 5 21:44:15 2012
@@ -1456,11 +1456,12 @@ svn_error_t *
svn_wc__db_op_delete(svn_wc__db_t *db,
const char *local_abspath,
const char *moved_to_abspath,
- /* ### flip to CANCEL, then NOTIFY. precedent. */
- svn_wc_notify_func2_t notify_func,
- void *notify_baton,
+ svn_skel_t *conflict,
+ svn_skel_t *work_items,
svn_cancel_func_t cancel_func,
void *cancel_baton,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
apr_pool_t *scratch_pool);
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=1357950&r1=1357949&r2=1357950&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Thu Jul 5 21:44:15 2012
@@ -2844,8 +2844,9 @@ do_delete(svn_test__sandbox_t *b,
SVN_ERR(check_db_rows(b, "", before));
SVN_ERR(check_db_actual(b, actual_before));
SVN_ERR(svn_wc__db_op_delete(b->wc_ctx->db, local_abspath, NULL,
- NULL, NULL /* notification */,
+ NULL /* conflict */, NULL /* work_item */,
NULL, NULL /* cancellation */,
+ NULL, NULL /* notification */,
b->pool));
SVN_ERR(check_db_rows(b, "", after));
SVN_ERR(check_db_actual(b, actual_after));