Checkout
philip
committed
on 22 Sep 02
Continuing issue 749. Pass the access baton to svn_wc_entries_read,
svn_wc_entry and svn_wc__entries write. Incoroprate an idea from
Benja… Show more
Continuing issue 749.  Pass the access baton to svn_wc_entries_read,

svn_wc_entry and svn_wc__entries write.  Incoroprate an idea from

Benjamin Pflugmann <benjamin-svn-dev@pflugmann.de> to handle revert

of schedule add directories that are missing.

Introduce a simple entries caching mechanism.  This is currently

disabled as it's experimental and has an adverse effect on client

memory use.  However the regression tests pass when it's enabled.

Compile with SVN_WC_ADM_CACHE_ENTRIES defined to try it.

* subversion/include/svn_wc.h

 (svn_wc_adm_probe_open, svn_wc_adm_probe_retrieve): New functions.

 (svn_wc_text_modified_p, svn_wc_props_modified_p, svn_wc_entry,

  svn_wc_walk_entries, svn_wc_status, svn_wc_statuses,

  svn_wc_get_status_editor, svn_wc_prop_set, svn_wc_crawl_revisions,

  svn_wc_transmit_text_deltas, svn_wc_get_ancestry,

  svn_wc_is_wc_root, svn_wc_translated_file): Add access baton

  parameter.

 (svn_wc_entries_read, svn_wc_set_auth_file): Change char* path

 parameter to access baton.

 (svn_wc_get_diff_editor, svn_wc_diff): Change char* anchor parameter

 to access baton.

* subversion/libsvn_wc/questions.h (svn_wc__timestamps_equal_p,

 svn_wc__versioned_file_modcheck): Add access baton parameter.

* subversion/libsvn_wc/questions.c (svn_wc__timestamps_equal_p,

 svn_wc_text_modified_p, svn_wc__versioned_file_modcheck): Add access

 baton parameter.

* subversion/libsvn_wc/merge.c (svn_wc_merge): Pass access baton to

 various functions.

* subversion/libsvn_wc/props.h (svn_wc__get_existing_prop_reject_file,

 svn_wc__merge_prop_diffs, svn_wc__remove_wcprops): Change char* path

 parameter to access baton.

* subversion/libsvn_wc/props.c

 (svn_wc__get_existing_prop_reject_file, svn_wc__merge_prop_diffs,

  svn_wc__remove_wcprops): Change char* path parameter to access baton.

 (svn_wc_props_modified_p, svn_wc_prop_set): Add access baton parameter.

* subversion/libsvn_wc/diff.c

 (struct edit_baton): Change char* anchor to access baton.

 (make_editor_baton): Change char* anchor parameter to access baton,

 dup input string.

 (file_diff, directory_elements_diff, delete_entry, close_file): Retrieve

 and pass access baton.

 (svn_wc_get_diff_editor, svn_wc_diff): Change char* anchor parameter

 to access baton.

* subversion/libsvn_wc/entries.h (svn_wc__entries_write): Change char*

 path parameter to access baton.

* subversion/libsvn_wc/entries.c

 (svn_wc_entry): Add access baton parameter. Try to retrieve access

 baton for directory, and handle failure.

 (svn_wc_entries_read, svn_wc__entries_write): Change char* path

 parameter to access baton.  Comment a possible BUG. Add simple

 entries caching support.

 (svn_wc__entry_modify): Pass access baton to svn_wc_entries_read and

 svn_wc__entries_write.  Add simple entries caching support.

 (walker_helper, svn_wc_walk_entries): Add access baton parameter.

* subversion/libsvn_wc/copy.c

 (svn_wc__remove_wcprops): Change char* path parameter to access

 baton.  No need to check for directory.  Don't drop ignored errors.

 (copy_file_administratively): Add source access baton parameter.

 (copy_dir_administratively): Add source access baton parameter.

 Remove physical locks from copied directory.  Open and close access

 baton to remove wcprops.

 (svn_wc_copy): Open source access baton.

* subversion/libsvn_wc/wc.h (svn_wc__adm_access_set_entries,

 svn_wc__adm_access_entries): New functions.

* subversion/libsvn_wc/adm_crawler.c

 (restore_file): Add access baton parameter.

 (report_revisions): Change char* path parameter to access baton.

 (svn_wc_crawl_revisions, svn_wc_transmit_text_deltas): Add access

 baton parameter.

* subversion/libsvn_wc/log.c

 (install_committed_file): Change char* dir parameter to access baton.

 (file_xfer_under_path): Change char* dir parameter to access baton.

 (log_do_file_xfer): Pass access baton to file_xfer_under_path.

 (log_do_delete_entry): Retrieve access baton earlier.

 (log_do_committed, svn_wc__run_log): Retrieve and pass access baton.

 (svn_wc_cleanup): Pass access baton to svn_wc_entries_read.

* subversion/libsvn_wc/adm_ops.h (*svn_wc__do_update_cleanup): Add

 access baton parameter.

* subversion/libsvn_wc/adm_ops.c

 (recursively_tweak_entries): Change char* path parameter to access

 baton.

 (svn_wc__do_update_cleanup, erase_from_wc, svn_wc_get_ancestry): Add

 access baton parameter.

 (svn_wc_process_committed, mark_tree): Pass access baton to

 svn_wc_entries_read.

 (svn_wc_delete): Retrieve access baton earlier.

 (svn_wc_get_ancestry): Open and close access baton for svn_wc_entry.

 (svn_wc_add): Retrieve access baton, only open access baton if path

 is newly versioned.

 (revert_admin_things): Change char* path parameter to access baton.

 (svn_wc_revert): Move access baton retrieve/open earlier. Handle

 added but missing directory.

 (svn_wc_remove_from_revision_control): Retrive parent access baton

 if required. Pass access baton to various functions. Remove access

 baton write check, since entries_write now does it.

 (svn_wc_resolve_conflict): Open, pass and close an access baton.

 (svn_wc_set_auth_file): Change char* path parameter to access baton.

* subversion/libsvn_wc/status.c

 (assemble_status, add_status_structure, add_unversioned_items): Add

 access baton parameter.

 (svn_wc_status): Add access baton parameter.  Don't drop ignored

 error.

 (svn_wc_statuses): Add access baton parameter. Simplify subdir

 svn_wc_entry call.

* subversion/libsvn_wc/adm_files.c (check_adm_exists): Open an close

 an access baton for svn_wc_entry.

* subversion/libsvn_wc/update_editor.c

 (make_dir_baton, make_file_baton): Retrieve and pass access baton.

 (add_directory): Retrieve and pass parent access baton.

 (close_directory): Pass access baton to svn_wc__merge_prop_diffs and

 svn_wc_props_modified_p.

 (add_or_open_file, apply_textdelta): Retrieve and pass access baton.

 (svn_wc_install_file): Pass access baton to various functions.

 (close_edit): Pass access baton to svn_wc__do_update_cleanup.

 (check_wc_root, svn_wc_is_wc_root): Add access baton parameter.

 (svn_wc_get_actual_target): Open and close access batons for

 check_wc_root.

* subversion/libsvn_wc/lock.c

 (struct svn_wc_adm_access_t): Add entries and entries_deleted

 members.  Correct indentation.

 (adm_access_alloc): Initialize entries and entries_deleted members.

 (probe, svn_wc_adm_probe_open, svn_wc_adm_probe_retrieve,

  svn_wc__adm_access_entries, svn_wc__adm_access_set_entries): New.

 (svn_wc_adm_open): Pass this access baton to svn_wc_entries_read.

 (svn_wc_adm_write_check): Remove comment.

* subversion/libsvn_wc/status_editor.c

 (struct edit_baton): Add adm_access member.

 (tweak_statushash): Add boolean is_dir parameter and use to retrieve

 appropriate access baton.

 (delete_entry): Retrieve and pass access baton.

 (close_directory, close_file): Pass boolean to tweak_statushash.

 (svn_wc_get_status_editor): Add access baton parameter, and store it

 in edit baton.

* subversion/libsvn_wc/translate.h (svn_wc__get_keywords): Add access

 baton parameter.

* subversion/libsvn_wc/translate.c (svn_wc__get_keywords,

 svn_wc_translated_file): Add access baton parameter.

* subversion/include/svn_path.h (svn_path_split_if_file): Tweak docstring.

* subversion/libsvn_subr/path.c (svn_path_split_if_file): Treat ENOENT

 like file as this corresponds to normal 'svn rm'.

* subversion/libsvn_subr/target.c (svn_path_condense_targets): Simplify

 code for new svn_path_split_if_file behaviour.

* subversion/libsvn_client/client.h

 (struct svn_client__callback_baton_t): Add access baton member.

 (svn_client__can_delete, svn_client__harvest_committables): Change

 char* path parameter to access baton.

 (svn_client__get_copy_committables, svn_client__do_commit): Add

 access baton parameter.

* subversion/libsvn_client/auth.c

 (store_auth_info): Pass calback baton instead of path and pool. Open

 and close access baton if required.

 (maybe_store_username, maybe_store_password): Pass calback baton to

 store_auth_info.

* subversion/libsvn_client/prop_commands.c

 (recursive_propset): New function extracted from svn_client_propset.

 (svn_client_propset): Open access baton and call recursive_propset.

 (recursive_propget, recursive_proplist): Change char* path parameter

 to access baton.

 (svn_client_propget, svn_client_proplist): Open and close access

 baton.

* subversion/libsvn_client/switch.c (svn_client_switch): Move access

 baton open earlier.  Comment a possible BUG.  Pass access baton or

 NULL to svn_client__open_ra_session.

* subversion/libsvn_client/ra.c

 (get_committed_rev): Retrieve and pass access baton.

 (svn_client__open_ra_session): Add access baton parameter, and store

 in callback baton.

* subversion/libsvn_client/delete.c

 (svn_client__can_delete): Add access baton parameter.

 (svn_client_delete): Pass NULL access baton to

 svn_client__open_ra_session. Move can_delete check later.

* subversion/libsvn_client/checkout.c (svn_client_checkout): Pass NULL

 access baton to svn_client__open_ra_session.

* subversion/libsvn_client/ls.c (svn_client_ls): Pass NULL access

 baton parameter to svn_client__open_ra_session.

* subversion/libsvn_client/revisions.c

 (svn_client__get_revision_number): Open and close access baton for

 svn_wc_entry.

* subversion/libsvn_client/add.c

 (svn_client_add): Open access baton.

 (svn_client_mkdir): Pass NULL access baton to svn_client__open_ra_session.

* subversion/libsvn_client/commit.c

 (get_ra_editor): Add access baton parameter.

 (svn_client_import): Pass access baton to get_ra_editor.

 (svn_client_commit): Simplify access baton opening. Pass access

 baton to various functions.

* subversion/libsvn_client/status.c

 (add_update_info_to_status_hash): Add access baton parameter, open

 anchor access baton if required.

 (svn_client_status): Open and close access baton.

* subversion/libsvn_client/export.c (copy_versioned_files): Open and

 pass access baton.

* subversion/libsvn_client/log.c (svn_client_log): Open and pass

 access baton.

* subversion/libsvn_client/update.c (svn_client_update): Pass access

 baton to various functions.

* subversion/libsvn_client/commit_util.c

 (harvest_committables): Add access baton parameter. Retrieve subdir

 access baton.

 (svn_client__harvest_committables): Change char* path parameter to

 access baton.

 (svn_client__get_copy_committables, do_item_commit,

 svn_client_do_commit): Add access baton parameter.

* subversion/libsvn_client/copy.c

 (wc_to_wc_copy): Always open source access baton, and do it earlier.

 (repos_to_repos_copy): Pass NULL access baton to

 svn_client__open_ra_session.

 (wc_to_repos_copy): Only open read access baton and pass to various

 functions.  Pass NULL access baton to svn_client__open_ra_session.

 (repos_to_wc_copy): Pass NULL access baton to

 svn_client__open_ra_session. Open destination access baton if

 required. Pass access baton to svn_wc_prop_set.

 (setup_copy): Move subdir copy check earlier. Open and close access

 baton for svn_wc_entry.

* subversion/libsvn_client/diff.c

 (merge_file_changed): Pass access baton to various functions.

 (merge_file_added, merge_dir_added): Pass access baton to svn_wc_entry.

 (convert_to_url): Open and close access baton for svn_wc_entry.

 (do_merge, do_single_file_merge): Add access baton, remove open and

 close of access baton.

 (do_diff): Open and close access batons.

 (svn_client_merge): Open and close access baton.

* subversion/clients/cmdline/switch-cmd.c (svn_cl__switch): Open

 access baton for svn_wc_entry.

* subversion/clients/cmdline/propedit-cmd.c (svn_cl__propedit): Open

 access baton for svn_wc_entry.

* subversion/clients/cmdline/info-cmd.c (svn_cl__info): Open access

 baton.

* subversion/clients/cmdline/main.c (main): Open and close access

 baton for svn_wc_entry on log file path.

* subversion/tests/clients/cmdline/basic_tests.py (basic_revert): Add

 test for revert of directory scheduled to be added but physically

 removed.

Show less