Checkout
rhuijben
committed
on 13 Jul 10
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 reco… Show more
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/adm_ops.c

 (svn_wc_add4): Update caller.

* subversion/libsvn_wc/lock.c

 (pool_cleanup_locked): Update caller.

 (adm_access_alloc): Update caller.

 (close_single): Update caller.

 (svn_wc_adm_locked): Update caller.

 (svn_wc__write_check): Update caller.

 (svn_wc_locked2): Update caller.

 (svn_wc__acquire_write_lock): Update caller.

 (svn_wc__release_write_lock): Update caller and handle errors

   on unlocking when we don't have a lock to keep current behavior.

* subversion/libsvn_wc/log.c

 (cleanup_internal): Obtain lock with steal_lock mode, instead of ignoring

   the error.

* subversion/libsvn_wc/upgrade.c

 (upgrade_to_wcng): Update caller.

* 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.

Show less