* subversion/include/private/svn_client_private.h (svn_client__ra_session_from_path2): Update docstring to mention that RA session may be returned back to RA session pool by svn_client__ra_session_release() function. (svn_client__ra_session_release): New function declaration.
* subversion/libsvn_client/add.c * subversion/libsvn_client/blame.c * subversion/libsvn_client/cat.c * subversion/libsvn_client/checkout.c (mkdir_urls, svn_client_blame5, svn_client_cat3, svn_client__checkout_internal): Release locally created sessions if there were no errors.
* subversion/libsvn_client/client.h (svn_client__ra_cache_t): Add new type declare. (svn_client__private_ctx_t): Add RA_CACHE field.
* subversion/libsvn_client/commit.c (check_url_kind_baton): Remove POOL, SESSION and REPOS_ROOT_URL -- they were used as local RA session pool. (check_url_kind): Just use svn_client_open_ra_session2() and svn_client__ra_session_release() instead of trying to reparent existing RA session. (svn_client_commit6): Update baton initialization and release locally created sessions if there were no errors.
* subversion/libsvn_client/merge.c (ensure_ra_session_url): Add TODO comment to use release RA sessions back to RA session pool. (do_merge): Reduce scope of second RA session and return it early back to RA session pool. (merge_locked, merge_peg_locked, find_automatic_merge_no_wc, client_find_automatic_merge, do_automatic_merge_locked): Release locally created sessions if there were no errors.
* subversion/libsvn_client/mergeinfo.c (svn_client__get_wc_or_repos_mergeinfo_catalog, get_mergeinfo, logs_for_mergeinfo_rangelist, svn_client__mergeinfo_log, svn_client_suggest_merge_sources): Release locally created sessions if there were no errors.
* subversion/libsvn_client/ra.c (): Include "ra_cache.h" (svn_client__open_ra_session_internal): Use svn_client__ra_cache_open_session() to open RA session, instead of direct call to svn_ra_open4(). (svn_client__repos_locations, svn_client__get_youngest_common_ancestor): Release RA sessions after we finished using them. (svn_client__ra_session_release): New.
* subversion/libsvn_client/status.c * subversion/libsvn_client/switch.c * subversion/libsvn_client/update.c * subversion/libsvn_client/util.c (reporter_finish_report, svn_client_status6, switch_internal, svn_client__update_internal, svn_client_get_repos_root): Release locally created sessions if there were no errors.
* tools/dev/ra-cache-summary.py: New script to analyze debugging output of RA session reuse.
Following the availability of apr_hash_this_key() etc. in APR v1.5, use these in Subversion code instead of svn__apr_hash_index_key() etc. Provide substitutes only when APR is too old to provide them.
* subversion/include/svn_types.h, subversion/libsvn_subr/iter.c (svn__apr_hash_index_key, svn__apr_hash_index_klen, svn__apr_hash_index_val): Rename to apr_hash_this_key, apr_hash_this_key_len, apr_hash_this_val. Declare and define them only if APR is older than 1.5.