Update the wc-db api for wclocks to have a single set of functions for obtaining and releasing locks instead of a separate function for recording and for knowing that we own the lock. Also add an initial implementation for the lock behavior for when we switch to a single database.
* subversion/libsvn_wc/wc-queries.sql (STMT_FIND_WC_LOCK): New query to obtain existing locks below a new recursive lock.
* subversion/libsvn_wc/wc_db.c (relpath_op_depth): New helper function. (svn_wc__db_temp_forget_directory): Ignore error conditions to keep current (mostly broken) behavior. (wclock_obtain_baton): New struct. (wclock_steal): New helper function. (wclock_obtain_cb): New transaction helper function. (svn_wc__db_wclock_set): Renamed to ... (svn_wc__db_wclock_obtain): ... this. Use a transaction to verify current recursive locks and obtain a new lock. (Mostly unused in per directory db layout). (svn_wc__db_wclock_remove): Renamed to ... (svn_wc__db_wclock_release): ... this. Verify lock ownership and add support for single db operations. (svn_wc__db_temp_mark_locked): Remove function. (svn_wc__db_temp_own_lock): Rename to ... (svn_wc__db_wclock_owns_lock): ... this and allow checking for checking a root and/or multiple levels.
* subversion/libsvn_wc/wc_db.h (svn_wc__db_wclock_set): Rename to ... (svn_wc__db_wclock_obtain): ... this and document levels_to_lock. (svn_wc__db_wclocked): Add documentation. (svn_wc__db_wclock_remove): Rename to ... (svn_wc__db_wclock_release): ... this. (svn_wc__db_wclock_owns_lock): New function. (svn_wc__db_temp_mark_locked): Remove function. (svn_wc__db_temp_own_lock): Remove function.
* subversion/libsvn_wc/wc_db_pdh.c (determine_obstructed_file): #undef when using single_db. (svn_wc__db_pdh_create_wcroot): Initialize new lock store if single db. (svn_wc__db_pdh_parse_local_abspath): Disable obstruction check on single db.
* subversion/libsvn_wc/wc_db_private.h (svn_wc__db_wclock_t): New struct. (svn_wc__db_wcroot_t): Name struct (for debugging and svn diff -x -p) Add array of owned locks. (svn_wc__db_pdh_t): Remove obstructed_file and locked for single db.
* subversion/libsvn_wc/lock.c (adm_access_alloc): Following up on r958908, only allow creating an access baton for a locked directory if there is no existing access baton for that directory attached to the db.