Revert r1704048 (merge of 'reuse-ra-session' branch): unfortunately the code is not ready for trunk. The most serious problem that we cannot assume that API user doesn't change svn_client_ctx_t fields like AUTH_BATON or OPEN_TUNNEL_FUNC between svn_client_*() functions invocation. JavaHL bindings is one example of usage of such pattern.
I'll revive 'reuse-ra-session' branch and attempt to fix these problems there.
* 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.