Checkout Tools
  • last updated 4 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
PDHs are dead, long live the WCROOT!

* subversion/libsvn_wc/wc_db_pdh.c:

Renamed to...

* subversion/libsvn_wc/wc_db_wcroot.c

...this.

  1. … 1 more file in changeset.
Update the wc-ng stat caching code to use the well-established stringbuf,

rather than reinventing said wheel.

* subversion/libsvn_wc/wc_db_pdh.c

(get_path_kind): Use the stringbuf to store the cached values.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_t): Use a stringbuf instead of a string/size combination.

  1. … 1 more file in changeset.
* subversion/libsvn_wc/wc_db_pdh.c

(get_path_kind): Update comment in followup to r1079089.

Put the wcroot path cache into the svn_wc__db_t object, rather than

function-static variables. This also allows us to use the db->state_pool

for allocations.

* subversion/libsvn_wc/wc_db_pdh.c

(get_path_kind): Use the members of the cache instead of static values.

(svn_wc__db_open): Note that we don't need to further initialize the

cache values.

* subversion/libsvn_wc/wc_db_private.h

(parse_cache): New member which contains the cache values.

  1. … 1 more file in changeset.
Follow-up to r1078914:

* subversion/libsvn_wc/wc_db_pdh.c

(get_path_kind): Fix a theoretical heap overflow with "" abspaths.

* subversion/libsvn_wc/wc_db_pdh.c

(get_path_kind): Fix a potential off-by-one error.

Found by: danielsh

Reduce the number of stat()s in wc-ng by implementing a very simple LRU cache.

This could probably be improved upon, and I welcome such improvements, but

even with this implementation, we get a ~10% decrease in test run times (on

a non-ram-disk test platform).

In addition, we get a 82.7% cache hit rate when running basic_tests.py, and

a 82.0% hit rate throughout the entire test suite.

* subversion/libsvn_wc/wc_db_pdh.c

(get_path_kind): New.

(svn_wc__db_wcroot_parse_local_abaspath): Use the caching function to get

node kinds.

Fix a memory problem identified by valgrind.

* subversion/libsvn_wc/wc_db_pdh.c

(svn_wc__db_drop_root): Use key corresponding to hash iterator.

Finish the PDH removal.

And no... I'm not going to bother renaming the file.

[ Note from the future: hwright's OCD got the best of him in r1081774. ]

* subversion/libsvn_wc/wc_db_pdh.c:

(pdh_parse_local_abspath): rename to svn_wc__db_wcroot_parse_local_abspath

and remove the other one (the param signature is the same). update all

the comments in the function. rename CHILD_ABSPATH to SCAN_ABSPATH for

clarity.

Next step: finish removal of db_pdh_t since nobody was using >local_abspath.

* subversion/libsvn_wc/wc_db_pdh.c:

(db_pdh_t): removed

(pdh_parse_local_abspath): return a wcroot_t rather than a pdh_t. in all

areas that stashed a wcroot into the returned PDH, just return that

wcroot instead. change references of (*pdh)->wcroot, too.

(svn_wc__db_wcroot_parse_local_abspath): just pass along the wcroot_t

instead of the pdh_t stuff.

Some simple transforms in the path parsing function to lay the path for

the next round of changes.

* subversion/libsvn_wc/wc_db_pdh.c:

(pdh_parse_local_abspath): rename WCROOT to PROBE_WCROOT. in the first

blocks of the function, if PDH is found/created, then immediately

return (this simplifies testing *PDH later). construct

LOCAL_DIR_ABSPATH to be the directory that is/contains LOCAL_ABSPATH,

and use it throughout the function.

Fix a pool lifetime issue introduced in r1076098.

* subversion/libsvn_wc/wc_db_pdh.c:

(pdh_parse_local_abspath): dup the hash key for dir_data into the proper

pool.

* subversion/libsvn_wc/wc_db_pdh.c

(pdh_parse_local_abspath): Followup to r1076093 by further allocating bits of

the PDH in the result pool, rather than the db->state_pool.

Make the PDH datastructure private to the only file in which it is used.

* subversion/libsvn_wc/wc_db_pdh.c

(db_pdh_t): Copied here from wc_db_private.h.

(compute_relpath, svn_wc__db_wcroot_parse_local_abspath): Update references.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_pdh_t): Remove.

  1. … 1 more file in changeset.
Another step in removing the use of the PDH: instead of mapping paths to PDHs

in our cache, map them to WCROOTs. PDHs are still used in a couple of places,

but eliminating them will now be easier. (This also has the happy consequence

of not allocating PDHs in the db->state_pool, thus reducing the long-running

memory footprint slightly.)

* subversion/libsvn_wc/wc_db_pdh.c

(svn_wc__db_close): Don't use a PDH, fetch the WCROOT from the cache.

(pdh_parse_local_abspath): Construct and cache WCROOTs.

(svn_wc__db_drop_root): Use WCROOTs instead of PDHs.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_t): Update docs.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_init): Put the WCROOT in the cache, rather than than a PDH.

(svn_wc__db_temp_forget_directory): Operate in terms of WCROOTs, not PDHs.

(svn_wc__db_temp_get_all_access): Same.

  1. … 2 more files in changeset.
* subversion/libsvn_wc/wc_db_pdh.c

(svn_wc__db_close): Similar to r1076018, use improved hash accessor functions.

Continuing the PDH removal work...

svn_wc__db_pdh_parse_local_abspath has no external callers, so make it

static to the PDH module.

* subversion/libsvn_wc/wc_db_pdh.c:

(svn_wc__db_pdh_parse_local_abspath): rename to ...

(pdh_parse_local_abspath): ... this

(svn_wc__db_wcroot_parse_local_abspath): update caller

* subversion/libsvn_wc/wc_db_private.h:

(svn_wc__db_pdh_parse_local_abspath): removed

  1. … 1 more file in changeset.
Remove dead code.

* subversion/libsvn_wc/wc_db_pdh.c

(svn_wc__db_pdh_get_or_create): Remove.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_pdh_get_or_create): Remove.

  1. … 1 more file in changeset.
Remove the implicit path (grabbed from the PDH) in favor of a WCROOT and

an explicit path when computing the rel path.

* subversion/libsvn_wc/wc_db_pdh.c

(compute_relpath): Take WCROOT/abspath args.

(svn_wc__db_pdh_parse_local_abspath): Update callers.

Reduce the scope of a helper function.

* subversion/libsvn_wc/wc_db_pdh.c

(svn_wc__db_pdh_compute_relpath): Rename from this...

(compute_relpath): ...to this.

(svn_wc__db_pdh_parse_local_abspath): Update caller.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_pdh_compute_relpath): Remove.

  1. … 1 more file in changeset.
Remove parent pointer in the PDH, since we no longer use it.

* subversion/libsvn_wc/wc_db_pdh.c

(svn_wc__db_pdh_parse_local_abspath): Don't bother setting the pdh->parent

member.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_pdh_t): Remove parent member.

  1. … 1 more file in changeset.
Remove a now-unused function.

* subversion/libsvn_wc/wc_db_pdh.c

(svn_wc__db_pdh_navigate_to_parent): Remove.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_pdh_navigate_to_parent): Remove.

  1. … 1 more file in changeset.
Move the adm_access caching from the PDH structs into the WCROOT. This is one

more step in making the WCROOT the central datastructure, rather than the PDH.

* subversion/libsvn_wc/wc_db_pdh.c

(svn_wc__db_pdh_create_wcroot): Initialize the access_cache member.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_wcroot_t): Add an access_cache member.

(svn_wc__db_pdh_t): Remove the adm_access member.

* subversion/libsvn_wc/wc_db.c

(flush_entries): Flush the entries from the wcroot, not the pdh.

(svn_wc__db_temp_get_access): Get the baton from the wcroot cache.

(svn_wc__db_temp_set_access): Set the baton in the wcroot cache.

(svn_wc__db_temp_close_access): Remove the baton from the wcroot cache.

(svn_wc__db_temp_clear_access): Same.

(svn_wc__db_temp_get_all_access): Use the wcroot access cache, instead of

the PDH member.

Inadvertantly commited with this revision was:

* notes/client-configuration:

Add some (incomplete) thoughts about client config.

  1. … 3 more files in changeset.
Replace all uses of VERIFY_USABLE_PDH with VERIFY_USABLE_WCROOT ('cause that's

what we're really verifying, after all).

* subversion/libsvn_wc/wc_db_pdh.c:

As above.

* subversion/libsvn_wc/wc_db.c:

Same.

* subversion/libsvn_wc/wc_db_pristine.c:

Same.

* subversion/libsvn_wc/wc_db_private.h

(VERIFY_USABLE_PDH): Remove.

  1. … 3 more files in changeset.
Allow wc_db APIs to request only a wcroot, instead of a full pdh. Since the

introduction of single-db, many of the various APIs don't need a full PDH,

just access to the wcroot (which may then be the same between many directories).

(This change doesn't actually make the fetching to wcroot more efficient,

but it does make it possible to do so later on.)

* subversion/libsvn_wc/wc_db_pdh.c

(svn_wc__db_wcroot_parse_local_abspath): New.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_wcroot_parse_local_abspath): New.

(VERIFY_USABLE_WCROOT): New.

* subversion/libsvn_wc/wc_db.c

(get_statement_for_path): Use the new function to retrieve only a wcroot.

  1. … 2 more files in changeset.
Constify the svn_config_t * parameter in svn_wc_context_create() and

deeper in the stack.

* subversion/include/svn_wc.h,

* subversion/libsvn_wc/context.c

(svn_wc_context_create):

Constify the svn_config_t * argument.

* subversion/libsvn_wc/wc_db_pdh.c

(svn_wc__db_open)

Constify the svn_config_t * argument.

* subversion/libsvn_wc/wc_db_private.h

(struct svn_wc__db_t):

Constify the svn_config_t * data member.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_open):

Constify the svn_config_t * argument.

  1. … 4 more files in changeset.
Remove obsolete multi-db code.

* subversion/libsvn_wc/wc_db_pdh.c

(determine_obstructed_file): Remove.

(svn_wc__db_pdh_create_wcroot): Remove conditional multi-db code.

(svn_wc__db_pdh_parse_local_abspath): Remove unneeded obstruction code,

remove conditional multi-db code.

Start making url-to-wc copy work in single-db.

* subversion/libsvn_wc/adm_ops.c

(svn_wc_add4): Add single-db implementation of join-by-rewriting.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_drop_root): New.

* subversion/libsvn_wc/wc_db_pdh.c

(svn_wc__db_drop_root): New.

* subversion/include/svn_wc.h

(svn_wc_copy3): Add metadata_only parameter.

* subversion/libsvn_wc/copy.c

(copy_versioned_file, copy_versioned_dir, svn_wc_copy3): Add metadata_only

processing. A subsequent commit (r980409) makes large whitespace changes.

* subversion/libsvn_wc/deprecated.c

(svn_wc_copy2): Adjust call to svn_wc_copy3.

* subversion/libsvn_client/copy.c

(do_wc_to_wc_copies_with_write_lock, do_wc_to_wc_moves_with_lock): Adjust

call to svn_wc_copy3.

  1. … 6 more files in changeset.
Following up on r95551, fix the is wcroot detection to don't rely on a

cached value in the pdh that wasn't designed to keep track of relatedness.

(The value is cached correctly if you only use navigate_to_parent, but

other pdh functions used it in the old way of just storing the pdh of

the dirent parent).

* subversion/libsvn_wc/wc_db.c

(VERIFY_USABLE_PDH): Move to wc_db_private.h

(navigate_to_parent): Move the navigate to parent part to

the new svn_wc__db_pdh_navigate_to parent and always perform

the related verification if requested (instead of the bail

on cached value).

(svn_wc__db_scan_deletion): Disable verification as this fails some

tests now.

* subversion/libsvn_wc/wc_db_pdh.c

(svn_wc__db_pdh_navigate_to_parent): New function, based on the old

navigate_to_parent.

* subversion/libsvn_wc/wc_db_private.h

(svn_wc__db_pdh_navigate_to_parent): New function.

(VERIFY_USABLE_PDH): Moved here from wc_db.c

  1. … 2 more files in changeset.
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.

  1. … 8 more files in changeset.