Checkout Tools
  • last updated 5 hours ago
Constraints: committers
Constraints: files
Constraints: dates

Changeset 951417 is being indexed.

Follow-up to r920424, don't conflate switched and disjoint WC paths.

r920424 was part of the ongoing wcng work to remove svn_wc_entry_t's, but

in doing so, it changed the behavior of svn_wc__path_switched() such that

disjoint but un-switched paths were erroneously reported as switched, see

* subversion/libsvn_wc/lock.c

(svn_wc__path_switched): Use svn_wc__check_wc_root() rather than

child_is_disjoint() to detect switched paths, returning to the

pre-r920424 behavior.

* subversion/libsvn_wc/lock.c

(add_to_shared): Avoid casting away 'const'.

Minor pool change to use an iterpool as a scratch.

* subversion/libsvn_wc/lock.c:

(svn_wc__release_write_lock): add a comment for clarity, and shift the

creation of the iterpool in order to use it as a scratch_pool for

another function call.

Remove a temporary API. This also allows reverting an added directory which is

the CWD.

* subversion/libsvn_wc/wc.h

(svn_wc__temp_get_relpath): Remove.

* subversion/libsvn_wc/adm_ops.c

(revert_entry): Don't use the API, and in the process, allow a revert of

an added directory if it is the CWD.

(revert_internal): Remove an unused path, and superflous call to the

temp API.

* subversion/libsvn_wc/update_editor.c

(make_editor): Use the anchor_abspath in place of the relpath, and remove

a call to the temp API.

* subversion/libsvn_wc/lock.c

(svn_wc__temp_get_relpath): Remove.

  1. … 3 more files in changeset.
Try to be a bit more clear on what conditions result in what output values

in a function. This also removes the need for a branch or two.

* subversion/libsvn_wc/lock.c

(svn_wc__adm_available): Simply assign the boolean value to the result

of a boolean operation.

Remove some private APIs that libsvn_client no longer requires.

* subversion/include/private/svn_wc_private.h:

* subversion/libsvn_wc/lock.c:

(svn_wc__adm_open_in_context, svn_wc__adm_probe_in_context,

svn_wc__adm_retrieve_from_content): removed

  1. … 1 more file in changeset.
Remove an access baton from an internal API, and use svn_error_return

where applicable.

* subversion/libsvn_wc/adm_files.h:

(svn_wc__adm_area_exists): take an ADM_ABSPATH rather than an access


* subversion/libsvn_wc/adm_files.c:

(svn_wc__adm_area_exists): take an ADM_ABSPATH and record the internals

(svn_wc__sync_text_base, svn_wc__get_revert_contents,

init_adm_tmp_area, svn_wc__adm_cleanup_tmp_area): use svn_error_return

(init_adm): take a REPOS_RELPATH rather than a full URL, and pass that

along to svn_wc__db_init()

(svn_wc__internal_ensure_adm): compute the REPOS_RELPATH here, and pass

it along to init_adm

(svn_wc_create_tmp_file2): switch to use DB to get a tempdir, to ensure

this function works after a switch to single-db.

* subversion/libsvn_wc/lock.c:

(pool_cleanup_locked, close_single): adjust params to adm_area_exists

  1. … 2 more files in changeset.
Now that libsvn_client does not use svn_wc_adm_access_t (YAY!), we can

completely deprecate the entire API.

Also ensured that all functions using the type are properly deprecated.

* subversion/include/svn_wc.h:

(svn_wc_adm_retrieve, svn_wc_adm_probe_retrieve, svn_wc_adm_close2,

svn_wc_adm_access_path, svn_wc_adm_access_pool): deprecate

(svn_wc_crawl_revisions4): fixed style of deprecation

(svn_wc_crawl_revisions3): add missing deprecation

(svn_wc_transmit_text_deltas3): add missing deprecation

* subversion/libsvn_wc/lock.c:

(...): add comments to some functions, noting they are deprecated. these

are not moved to deprecated.c, which is really reserved for just

wrappers around newer functions. we don't want to place "bulk" logic

into that file.

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

(svn_wc__adm_missing): Remove yet more unused cruft. Followup to r927176.

Remove an unneeded function.

* subversion/libsvn_wc/lock.c,


(svn_wc__adm_extend_lock_to_tree): Remove.

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

(svn_wc__adm_access_entries): Allow entry caching to be disabled.

* subversion/libsvn_wc/lock.c

(svn_wc__acquire_write_lock): Release all acquired locks.

Make acquire obtain all or no locks.

* subversion/libsvn_wc/lock.c

(svn_wc__acquire_write_lock): Release acquired locks if a pre-existing

lock is encountered during recursive locking.

* subversion/include/private/svn_wc_private.h

(svn_wc__acquire_write_lock): Tweak doc string.

* subversion/libsvn_client/commit.c

(svn_client_commit4): No need to release locks if acquire returns an error.

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

(svn_wc__release_write_lock): Only release locks held by the context.

* subversion/include/private/svn_wc_private.h

(svn_wc__release_write_lock): Tweak doc string.

  1. … 1 more file in changeset.
Make our standin apr hash retrieval functions private, and note that in both

the function name and header file.

* subversion/include/svn_types.h,


(svn_apr_hash_index_key): Renamed to...

(svn__apr_hash_index_key): ...this.

(svn_apr_hash_index_klen, svn__apr_hash_index_klen): Same.

(svn_apr_hash_index_val, svn__apr_hash_index_val): Same.

* subversion/libsvn_ra/ra_loader.c,











































Update callers throughout.

  1. … 44 more files in changeset.
Add empty doc strings to the 141 static functions in libsvn_wc that didn't

have one. Why? To make me feel worse. But really, to give a tiny extra

visual cue that might encourage any passing programmer to write something in

it. This distinguishes them from non-static functions, which don't have a

doc string at their definition because it's at their declaration. Did I

make an exception for functions whose purpose is "so obvious that they don't

need one"? No.

* subversion/libsvn_wc/adm_crawler.c,



















Add empty doc strings.

  1. … 18 more files in changeset.
* subversion/libsvn_wc/lock.c

Convert tabs to spaces. A follow-up to r920424.

Remove some svn_wc_entry_t using code.

* subversion/include/private/svn_wc_private.h

(svn_wc__path_switched): Remove SVN_ERR_ENTRY_MISSING_URL from doc

string, the caller wasn't taking advantage of it.

(svn_wc__adm_open_anchor_in_context): Delete.

* subversion/libsvn_wc/wc.h

(svn_wc__internal_path_switched): Delete.

* subversion/libsvn_wc/util.c

(svn_wc__internal_path_switched): Delete.

(svn_wc__path_switched): Move to lock.c.

* subversion/libsvn_wc/lock.c

(child_is_disjoint): Check for SVN_ERR_WC_NOT_DIRECTORY.

(svn_wc__adm_open_anchor_in_context): Delete.

(svn_wc__path_switched): Copied from util.c, just call child_is_disjoint.

  1. … 3 more files in changeset.
Remove access batons from checkout/update/switch.

* subversion/include/private/svn_wc_private.h

(svn_wc__acquire_write_lock, svn_wc__release_write_lock): Tweak doc strings.

* subversion/libsvn_wc/lock.c

(svn_wc__acquire_write_lock): More complete anchor calculation.

(svn_wc__release_write_lock): Don't remove lock if work queue item exists.

* subversion/libsvn_wc/update_editor.c

(struct edit_baton): Remove adm_access, add close_edit_complete.

(cleanup_dir_baton): Remove locks if not close_edit_complete.

(prep_directory): Acquire lock rather than access baton.

(schedule_existing_item_for_re_add): Remove comment, locks are recursive.

(close_directory): Kill cleanup handler.

(merge_file): Adjust file external checks for possible entry cache bug.

(close_edit): Set close_edit_complete.

(make_editor): Remove access batons.

* subversion/libsvn_wc/log.c

(log_do_delete_entry): Remove call to extend access baton.

* subversion/libsvn_client/deprecated.c

(svn_client_switch): Don't pass NULL for access baton.

* subversion/libsvn_client/client.h

(svn_client__switch_internal, svn_client__handle_externals): Remove

adm_access parameter.

* subversion/libsvn_client/switch.c

(switch_internal): New, copied from svn_client__switch_internal. Add

local_abspath and anchor_abspath parameters, remove access baton code.

(svn_client__switch_internal): Gutted. Remove adm_access parameter. Now

just a wrapper to acquire and release locks.

(svn_client_switch2): Don't pass NULL for access baton.

* subversion/libsvn_client/update.c

(update_internal): New, copied from svn_client__update_internal. Add

local_abspath and anchor_abspath parameters, remove access baton code.

(svn_client__update_internal): Gutted. Now just a wrapper to acquire

and release locks.

* subversion/libsvn_client/externals.c

(struct handle_external_item_change_baton): Remove adm_access.

(switch_dir_external): Don't pass NULL for access baton.

(switch_file_external): Remove adm_access parameter. Remove access batons,

acquire lock instead. Avoid SVN_ERR and goto cleanup instead.

(handle_external_item_change): Don't pass access baton.

(struct handle_externals_desc_change_baton): Remove adm_access.

(handle_externals_desc_change): Remove access baton code.

(svn_client__handle_externals): Remove adm_access parameter.

* subversion/tests/cmdline/

(test_list): Remove XFail from update_1_5.

  1. … 9 more files in changeset.
Update some comments, following up r879274 which renamed an error code.

(But don't update the doc strings of deprecated functions.)

* subversion/libsvn_client/export.c (open_root_internal),

subversion/libsvn_client/update.c (svn_client_update3),

subversion/libsvn_wc/lock.c (do_open),

subversion/libsvn_wc/wc_db.h (svn_wc__db_base_get_children):


in comments.

  1. … 3 more files in changeset.
Don't use multiple function calls as parameters when the order of

evaluation matters.

This causes 1, 4, 5 and 6 to fail. I believe this is

a bug in the patch code since reversing the order (which from a

locking point of view is silly) makes the tests work. The failing

tests claim to require a lock but only work without a lock.

* subversion/libsvn_wc/lock.c

(svn_wc__call_with_write_lock): Ensure func is evaluated

before svn_wc__release_write_lock.

Add a safe API for using write locks on a working copy,

i.e. locks acquired via svn_wc__acquire_write_lock() and

released via svn_wc__release_write_lock().

Quoting Philip Martin from

because he explained the problem very well:

In 1.6 wc locks were associated with access batons and when an access

baton was opened a pool cleanup handler was installed to ensure that

the baton was closed. The pool cleanup handler would remove any lock

associated with the access baton provided there were no log files in

the directory. Code was typically:

svn_wc_adm_access_t *adm_access;

SVN_ERR(svn_wc_adm_open3(&adm_access, ... pool));

SVN_ERR(svn_wc_foo(adm_access, ... pool));


If svn_wc_foo completes without error then svn_wc_adm_close is called

which removes the locks unconditionally. If svn_wc_foo returns an

error then svn_wc_adm_close doesn't get called, and when the pool is

finally cleared the pool cleanup handler will leave or remove the lock

depending on whether cleanup is required.

End of qoute.

Quoting Greg Stein from #svn-dev:

<gstein> unlocking via pool cleanup blows

<gstein> "is the database still open? can I manipulate stuff in it?"

<gstein> is only the first and worst of the questions when you try

to do shit like that in the cleanup

End of qoute.

Instead of releasing wc-ng write locks during pool cleanup,

we provide a function which invokes a callback while holding a

wc lock and releases the lock after the callback returns.

We do not anticipate many users of this type of lock, so use of

this API should be limited to few occurrences within libsvn_client.

This API is private for now, as we may still decide to change it.

Suggested by: gstein


* subversion/include/private/svn_wc_private.h

(svn_wc__with_write_lock_func_t): New callback type.

(svn_wc__call_with_write_lock): Declare.

* subversion/libsvn_wc/lock.c

(svn_wc__call_with_write_lock): New.

  1. … 1 more file in changeset.
Ensure that per-directory locks are only taken in the correct directory.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_wclock_set): Assert that the lock is for the directory itself.

* subversion/libsvn_wc/lock.c

(svn_wc__acquire_write_lock): Only try to lock if the directory is a

working copy.

* subversion/libsvn_client/add.c

(svn_client_add4): Take lock after adding parents (as was the case in 1.6).

(add_parent_dirs): Add comment.

* subversion/tests/cmdline/

(basic_mkdir_wc_with_parents): Mark as PASS.

  1. … 3 more files in changeset.
When writing working copy locks from legacy sources, always use

depth-immediate (no implicit locks).

* subversion/libsvn_wc/lock.c

(adm_access_alloc, svn_wc__acquire_write_lock): Set levels_to_lock as 0 in

the sdb.

* subversion/libsvn_wc/upgrade.c

(upgrade_to_wcng): Same.

* subversion/libsvn_wc/log.c

(cleanup_internal): Same.

* subversion/libsvn_wc/wc-queries.sql

(STMT_INSERT_WC_LOCK): Allow consumers to set the locked_levels column.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_wclock_set): Add levels_to_lock parameter, and use it.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_wclock_set): Add levels_to_lock parameter.

  1. … 5 more files in changeset.
Fix warning of shadowed declaration.

* subversion/libsvn_wc/lock.c

(svn_wc__acquire_write_lock): s/basename/base/

* subversion/libsvn_wc/lock.c

(svn_wc_adm_retrieve): Remove a hack required for use by svn_wc_status2(),

which no longer calls this function. This fix is required for a pending

commit. Also do some general reorganization while we're here.

* subversion/libsvn_wc/lock.c

(svn_wc__acquire_write_lock): Remove duplicate variable declaration.

A better fix for the SEGV fixed in r881265: replace another use

of access batons. This no longer leaves .svn directories around.

* subversion/libsvn_wc/adm_files.h

(svn_wc__adm_destroy): Pass svn_wc__db_t and abspath rather than


* subversion/libsvn_wc/adm_files.c

(svn_wc__adm_destroy): Use svn_wc__db_t directly.

* subversion/libsvn_wc/adm_ops.c

(svn_wc__internal_remove_from_revision_control): Revert r881265: no

need to check for null access baton.

* subversion/include/private/svn_wc_private.h

(svn_wc_acquire_write_lock): Add anchor_abspath parameter.

* subversion/libsvn_wc/lock.c

(svn_wc_acquire_write_lock): Add anchor_abspath parameter and code.

* subversion/libsvn_client/revert.c

(revert): Acquire and release locks on the anchor.

* subversion/libsvn_client/add.c

(svn_client_add4): Update svn_wc_acquire_write_lock call.

  1. … 6 more files in changeset.
When acquiring and releasing wc write locks, use the parent path for unknown

kinds in the working copy. Update 'add --parents' to ensure we release working

copy locks on error.

* subversion/libsvn_wc/lock.c

(svn_wc__acquire_write_lock, svn_wc__release_write_lock): Look at the parent

path if the kind is anything but a directory, rather than only for files.

* subversion/libsvn_client/add.c

(svn_client_add4): Make sure we release the lock if we encounter an error

while adding parents.

  1. … 1 more file in changeset.
Add a couple of working copy APIs to allow the client library to lock the

working copy, without the use of an intermediate access baton. Use these

APIs in svn_client_add4().

* subversion/include/private/svn_wc_private.h

(svn_wc__acquire_write_lock, svn_wc__release_write_lock): New.

* subversion/libsvn_wc/lock.c

(svn_wc__acquire_write_lock, svn_wc__release_write_lock): New.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_temp_mark_locked): When marking the pdh locked, create it

if needed.

* subversion/libsvn_client/add.c

(svn_client_add4): Replace access baton use with lock APIs instead.

  1. … 3 more files in changeset.