Checkout
Bert Huijben
committed
on 05 Jul 12
Transform the base-remove workqueue operation into an atomic wc_db operation
that dynamically creates multiple workqueue operations that tra… Show more
Transform the base-remove workqueue operation into an atomic wc_db operation

that dynamically creates multiple workqueue operations that transform the

local working copy later.

This removes the last place in the workqueue that may change the NODE

presence/status during its operations. (Except for legacy and upgrade).

This patch removes several ugly corner cases around actual only nodes in

the original implementation of the db function.

* subversion/libsvn_wc/externals.c

 (svn_wc__external_remove): Update caller. Run workqueue instead of manually

   removing a file.

* subversion/libsvn_wc/update_editor.c

 (delete_entry): Handle all changes via a single call to

   svn_wc__db_base_remove, instead of applying multiple small operations.

* subversion/libsvn_wc/wc-queries.sql

 (STMT_SELECT_BASE_PRESENT,

  STMT_DELETE_ACTUAL_FOR_BASE_RECURSIVE,

  STMT_DELETE_WORKING_BASE_DELETE,

  STMT_DELETE_WORKING_RECURSIVE,

  STMT_DELETE_BASE_RECURSIVE): New queries.

* subversion/libsvn_wc/wc_db.c

 (base_get_info): Add prototype.

 (base_remove_baton): Add new arguments.

 (db_base_remove): Implement as recursive operation via several new Sqlite

   statements.

 (svn_wc__db_base_remove): Pass arguments via baton.

 (svn_wc__db_base_remove): Update caller.

* subversion/libsvn_wc/wc_db.h

 (svn_wc__db_base_remove): Update prototype and documentation.

* subversion/libsvn_wc/workqueue.c

 (names): Add OP_DIRECTORY_REMOVE. Sort legacy items at the bottom.

 (remove_base_node): Remove function.

 (run_base_remove): Just call svn_wc__db_base_remove.

 (svn_wc__wq_build_base_remove): Remove function.

 (run_dir_remove,

  svn_wc__wq_build_dir_remove): New function.

  (dispatch_table): Add OP_DIRECTORY_REMOVE. Sort legacy items at the bottom.

* subversion/libsvn_wc/workqueue.h

 (svn_wc__wq_build_dir_remove): New function.

 (svn_wc__wq_build_base_remove): Remove function.

* subversion/tests/libsvn_wc/op-depth-test.c

 (includes): Add workqueue.h.

 (base_dir_insert_remove): Run workqueue to avoid an error on closing

   the db.

Show less