Michael Rytting


r1195873 | stsp | 2011-11-01 03:46:25 -0500 (Tue, 01 Nov 2011)

Allow deletion of multiple, potentially non-nested, targets from a working
copy within a single sqlite transaction. Should improve performance of
'svn rm dir/*', especially on NFS.

For now, this change only adds new APIs based on existing single-target APIs.
The new APIs lack support for moves. This avoids having to update all callers
of existing APIs, as well as making a backport to 1.7 easier.
Later, we could merge the single-target APIs with these new ones.

No public APIs have been changed.

Reported by: Michael Rytting

* subversion/include/private/svn_wc_private.h
  (svn_wc__delete_many): Declare.

* subversion/libsvn_wc/adm_ops.c
  (svn_wc__delete_many): New. Based on svn_wc__delete_internal().

* subversion/libsvn_wc/wc_db.c
  (op_delete_txn): Move most code in this function ...
  (delete_node): ... to here. The difference being that delete_node() does
   not clear the delete-list from the DB, so it can be called multiple
   times to delete a number of nodes.
  (op_delete_many_txn, op_delete_many_baton_t): New. Creates a new delete-list
   in the DB and then calls delete_node() for each deletion target.
  (svn_wc__db_op_delete_many): New. This function asserts that all
   deletion-targets share a common working copy root, locks the entire
   working copy, and calls op_delete_many_txn() within an sqlite transaction.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_op_delete_many): Delcare.

* subversion/libsvn_client/delete.c
  (svn_client__wc_delete_many): New.
  (delete_with_write_lock_baton): Change the PATH member to a TARGETS list.
  (delete_with_write_lock_func): Adjust per above change.
  (svn_client_delete4): Instead of looping over the target list and calling
   the delete_with_write_lock_func() for each, group targets by wcroots
   and pass the entire target list for each wcroot down to lower layers.

* subversion/libsvn_client/client.h
  (svn_client__wc_delete_many): Declare.