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

Changeset 964370 is being indexed.

* subversion/libsvn_wc/lock.c (child_is_disjoint): Remove unused variables.

* subversion/libsvn_wc/lock.c

(child_is_disjoint): Use svn_wc__db_is_wcroot, to check if a subdir is

registered in its parent instead of reading all nodes in the parent

and checking locally.

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

Add a c test to verify that we keep svn_wc_add3() compatibility working

when we move our own code in libsvn_client to a better route.

* subversion/libsvn_wc/lock.c

(adm_access_alloc): Allow obtaining an access baton with lock for a node

that is already locked in the same svn_wc__db_t instance.

* subversion/tests/libsvn_client/client-test.c

(test_wc_add_scenarios): New function: Testing svn_wc_add3() behavior,

to make sure it will be compatible when we move features to deprecated.c.

(test_funcs): Add test_wc_add_scenarios.

  1. … 1 more file in changeset.
Switch the argument order of (the new in 1.7) svn_dirent_split(),

svn_uri_split() and svn_relpath_split() functions to our new standard

order: output arguments before input arguments.

* subversion/include/svn_dirent_uri.h

(svn_dirent_split, svn_relpath_split, svn_uri_split): Reorder arguments.

* subversion/libsvn_client/add.c

* subversion/libsvn_client/commit.c

* subversion/libsvn_client/copy.c

* subversion/libsvn_client/delete.c

* subversion/libsvn_client/diff.c

* subversion/libsvn_client/externals.c

* subversion/libsvn_client/info.c

* subversion/libsvn_client/list.c

* subversion/libsvn_client/locking_commands.c

* subversion/libsvn_client/update.c

* subversion/libsvn_delta/path_driver.c

* subversion/libsvn_subr/dirent_uri.c

* subversion/libsvn_wc/adm_crawler.c

* subversion/libsvn_wc/adm_files.c

* subversion/libsvn_wc/adm_ops.c

* subversion/libsvn_wc/copy.c

* subversion/libsvn_wc/diff.c

* subversion/libsvn_wc/entries.c

* subversion/libsvn_wc/lock.c

* subversion/libsvn_wc/merge.c

* subversion/libsvn_wc/node.c

* subversion/libsvn_wc/old-and-busted.c

* subversion/libsvn_wc/props.c

* subversion/libsvn_wc/update_editor.c

* subversion/libsvn_wc/wc_db.c

* subversion/libsvn_wc/wc_db_pdh.c

* subversion/mod_dav_svn/repos.c

* subversion/svn/util.c

* subversion/tests/libsvn_subr/dirent_uri-test.c

(*): Update callers.

  1. … 29 more files in changeset.
Following up the last batch of commits, remove header includes

and entry modification flags that are no longer used.

* subversion/libsvn_wc/adm_crawler.c

* subversion/libsvn_wc/copy.c

* subversion/libsvn_wc/crop.c

* subversion/libsvn_wc/diff.c

Remove some unused includes of entry.h, lock.h and prop.h

* subversion/libsvn_wc/entries.c

(fold_entry): Remove unused foldings.

(svn_wc__entry_modify_stub): Remove flag.

* subversion/libsvn_wc/entries.h

(SVN_WC__ENTRY_MODIFY_REVISION, SVN_WC__ENTRY_MODIFY_URL,

SVN_WC__ENTRY_MODIFY_DELETED): Remove unused flags.

* subversion/libsvn_wc/lock.c

* subversion/libsvn_wc/log.c

* subversion/libsvn_wc/merge.c

* subversion/libsvn_wc/node.c

* subversion/libsvn_wc/props.c

* subversion/libsvn_wc/relocate.c

* subversion/libsvn_wc/status.c

* subversion/libsvn_wc/tree_conflicts.c

* subversion/libsvn_wc/update_editor.c

* subversion/libsvn_wc/workqueue.c

Remove some unused includes of entry.h, lock.h and prop.h

  1. … 15 more files in changeset.
Teach the WC-NG code to treat (in most cases) a "my parent is a

pre-1.7 working copy" error as merely "my parent isn't a working copy

at all" and degrade gracefully. This allows 1.7 working copies to be

created inside of pre-1.7 working copies.

* subversion/libsvn_wc/wc.h

(SVN_WC__ERR_IS_NOT_CURRENT_WC): New macro.

* subversion/libsvn_wc/status.c

(internal_status): Test returned error with new

SVN_WC__ERR_IS_NOT_CURRENT_WC() macro.

* subversion/libsvn_wc/lock.c

(svn_wc__acquire_write_lock): Test returned error with new

SVN_WC__ERR_IS_NOT_CURRENT_WC() macro.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_op_read_tree_conflict, svn_wc__db_temp_op_set_dir_depth,

svn_wc__db_is_wcroot, is_wclocked): Test returned error with new

SVN_WC__ERR_IS_NOT_CURRENT_WC() macro.

* subversion/libsvn_wc/update_editor.c

(already_in_a_tree_conflict): Test returned error with new

SVN_WC__ERR_IS_NOT_CURRENT_WC() macro.

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

http://svn.haxx.se/dev/archive-2010-06/0014.shtml.

* 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

baton.

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

subversion/libsvn_wc/lock.h

(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,

subversion/libsvn_subr/iter.c

(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,

subversion/libsvn_subr/mergeinfo.c,

subversion/tests/libsvn_wc/tree-conflict-data-test.c,

subversion/svndumpfilter/main.c,

subversion/svn/props.c,

subversion/svn/propget-cmd.c,

subversion/svn/log-cmd.c,

subversion/svn/status-cmd.c,

subversion/svnadmin/main.c,

subversion/libsvn_wc/adm_ops.c,

subversion/libsvn_wc/status.c,

subversion/libsvn_wc/update_editor.c,

subversion/libsvn_wc/lock.c,

subversion/libsvn_wc/old-and-busted.c,

subversion/libsvn_wc/tree_conflicts.c,

subversion/libsvn_wc/entries.c,

subversion/libsvn_wc/copy.c,

subversion/libsvn_wc/wc_db.c,

subversion/libsvn_wc/upgrade.c,

subversion/libsvn_client/externals.c,

subversion/libsvn_client/util.c,

subversion/libsvn_client/repos_diff.c,

subversion/libsvn_client/export.c,

subversion/libsvn_client/info.c,

subversion/libsvn_client/merge.c,

subversion/libsvn_client/prop_commands.c,

subversion/libsvn_client/ra.c,

subversion/libsvn_client/locking_commands.c,

subversion/libsvn_client/diff.c,

subversion/libsvn_client/mergeinfo.c,

subversion/libsvn_client/commit_util.c,

subversion/libsvn_client/add.c,

subversion/libsvn_client/commit.c,

subversion/svnlook/main.c,

subversion/svnsync/main.c,

subversion/svnsync/sync.c,

subversion/libsvn_repos/reporter.c,

subversion/svnserve/serve.c,

subversion/libsvn_fs_fs/tree.c,

subversion/libsvn_fs_fs/fs_fs.c,

subversion/libsvn_fs_fs/lock.c,

subversion/libsvn_fs_fs/dag.c,

subversion/libsvn_fs_fs/caching.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,

subversion/libsvn_wc/adm_files.c,

subversion/libsvn_wc/adm_ops.c,

subversion/libsvn_wc/ambient_depth_filter_editor.c,

subversion/libsvn_wc/conflicts.c,

subversion/libsvn_wc/deprecated.c,

subversion/libsvn_wc/entries.c,

subversion/libsvn_wc/lock.c,

subversion/libsvn_wc/log.c,

subversion/libsvn_wc/old-and-busted.c,

subversion/libsvn_wc/props.c,

subversion/libsvn_wc/relocate.c,

subversion/libsvn_wc/status.c,

subversion/libsvn_wc/translate.c,

subversion/libsvn_wc/tree_conflicts.c,

subversion/libsvn_wc/update_editor.c,

subversion/libsvn_wc/upgrade.c,

subversion/libsvn_wc/wc_db.c,

subversion/libsvn_wc/workqueue.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/upgrade_tests.py

(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):

Mention SVN_ERR_WC_NOT_WORKING_COPY instead of SVN_ERR_WC_NOT_DIRECTORY

in comments.

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

evaluation matters.

This causes patch_tests.py 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

http://mail-archives.apache.org/mod_mbox/subversion-dev/200912.mbox/%3C87ws0g458j.fsf@stat.home.lan%3E

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));

SVN_ERR(svn_wc_adm_close(adm_access));

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

hwright

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