[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Move .svn/lock files into the sdb

From: Hyrum K. Wright <hyrum_at_hyrumwright.org>
Date: Wed, 30 Sep 2009 17:08:33 -0400

Greg, et. al.,
The attached patch is an attempt to move the .svn/lock files into a
separate table in .svn/wc.db. The reason to do this is so that we can
use the sdb to manage the locked status of a directory, particularly
as we start using svn_wc__entry_modify2(), which currently does *not*
do a write check on the access baton. Eventually, I plan to add a
member to pdh->wcroot which moves the in-memory state from the access
baton to wc_db.

Whether or not we'll need these locks in the long term is still an
open question (I hope we don't), but we still need them for the time
being, particularly as we move from access batons. Even if this table
eventually goes away, I think it better for wc_db to be managing this
state than the access baton, hence this patch.

This patch passes all tests locally for me. I'm not committing it
just yet because I want to make sure the approach is valid, and that
I've correctly plugged into the upgrade code in bumping the format to

Comments appreciated.


Bump the wc_db format to 14, moving the physical locks files into an
sqlite table.

* subversion/tests/libsvn_wc/db-test.c
   (data_loading_sql): Add the format 14 sql.
   (test_upgrading_to_f13): Rename to...
   (test_upgrading_to_f14): ...this, since we have to upgrade through
f13 to
     get to f14, we don't lose any test coverage here.
   (test_funcs): Update test name.

* subversion/tests/cmdline/upgrade_tests.py
   (get_current_format): Update with the now-current f14.

* subversion/tests/cmdline/svntest/actions.py
   (lock_admin_dir): Apply the lock into the sdb, rather than dropping
a lock

* subversion/libsvn_wc/wc.h
   (SVN_WC__VERSION): Bump to 14.

* subversion/libsvn_wc/lock.c
   (create_lock): Remove.
   (adm_access_alloc): Call the wc_db lock functions, rather than
     a physical lock.
   (close_single, svn_wc__adm_write_check): Same.
   (svn_wc_locked): Create a context, and use it to call into wc_db to
     inquire about locked status.

* subversion/libsvn_wc/wc-queries.sql

* subversion/libsvn_wc/wc-metadata.sql:
   Introduce new format 14 stuff, and keep the old format 14 stuff as

* subversion/libsvn_wc/wc_db.c
   (upgrade_sql): Add the format 14 upgrade sql.
   (svn_wc__db_wclock_set, svn_wc__db_wclocked,
svn_wc__db_wclock_remove): New.

* subversion/libsvn_wc/wc_db.h
   (svn_wc__db_wclock_set, svn_wc__db_wclocked,
svn_wc__db_wclock_remove): New.

* subversion/libsvn_wc/upgrade.c
   (create_physical_lock): New.
   (upgrade_to_wcng): Instead of using access batons to steal the
write lock,
     just do it outselves.
   (migrate_locks): Move existing locks into the wc.db.
   (bump15_baton): Renamed from this...
   (bump14_baton): ...to this.
   (bump_database_to_15): Renamed from this...
   (bump_database_to_14): ...to this.
   (bump_to_15): Renamed from this...
   (bump_to_14): ...to this.
   (svn_wc__upgrade_sdb): Add a section for bumping to the new format



Received on 2009-09-30 23:08:52 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.