Add an explicit baton for the tunnel handling callbacks,
and make parameter names more consistent.

* subversion/include/svn_client.h (svn_client_ctx_t): New member tunnel_baton.
* subversion/include/svn_ra.h
  (svn_ra_callbacks2_t): New member tunnel_baton.
   Renamed open_tunnel to open_tunnel_func,
   and close_tunnel to close_tunnel_func.
  (svn_ra_open_tunnel_func_t, svn_ra_close_tunnel_func_t):
   Rename parameter tunnel_baton to tunnel_context.
   Rename parameter open_baton to tunnel_baton,
   to match the callbacks structure.

* subversion/libsvn_client/ra.c (svn_client__open_ra_session_internal):
   Update for renamed callback struct members and init the
   tunnel_baton in the RA callbacks.
* subversion/libsvn_ra_svn/client.c
  (tunnel_data_t, close_tunnel_cleanup, open_session, ra_svn_open):
   Update for renamed callback struct members.
* subversion/tests/libsvn_ra/ra-test.c: Likewise.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1531777 13f79535-47bb-0310-9956-ffa450edef68
Add another callback for ra_svn tunnels that determines whether the
default tunnel implementation should be used, based on the tunnel name.

* subversion/include/svn_ra.h (svn_ra_check_tunnel_func_t): New callback type.
  (svn_ra_callbacks2_t): Add check_tunnel_func callback. Update docstrings
   of open_tunnel_func and close_tunnel_func.
* subversion/include/svn_client.h (svn_client_ctx_t): Add check_tunnel_func
   callback. Update docstrings of open_tunnel_func and close_tunnel_func.
* subversion/libsvn_client/ra.c (svn_client__open_ra_session_internal):
   Pass check_tunnel_func to the RA session callbacks.
* subversion/libsvn_ra_svn/client.c (open_session): Change predicate
   for call to make_tunnel, based on tunnel_argv being non-null.
  (ra_svn_open): Call the check-tunnel callback to determine if
   a given tunnel type should be handled by the callbacks or by
   the default implementation.

* subversion/tests/libsvn_ra/ra-test.c
  (check_tunnel, last_tunnel_check): New.
  (check_tunnel_callback_test): New test.
  (tunel_callback_test): Verify last_tunnel_check.
  (test_funcs): Add check_tunnel_callback_test.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1531890 13f79535-47bb-0310-9956-ffa450edef68
* subversion/tests/libsvn_wc/op-depth-test.c
  (move_abspath_more_than_once): Add array terminators to avoid spurious FAILs.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1531938 13f79535-47bb-0310-9956-ffa450edef68
In the Win32 crashreport handler limit the length of variable names by their
length, instead of by their 0 byte. While debugging a r1519955 related crash
I found a non zero terminated variable name here, which crashed the crash
report handler.

* subversion/libsvn_subr/win32_crashrpt.c
  (write_var_values,
   write_function_detail): Use the length of the name as limit for printf.
   We can't just copy the string here as we can't trust pools in case of a
   crash.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532023 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_wc/wc_db.c
  (op_revert_recursive_txn): Resolve shadowed variable warning.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532098 13f79535-47bb-0310-9956-ffa450edef68
Fix a bug in JavaHL error handling; the original error was not cleared.
Enhance the native exception to SVN error wrapper to include the name
of the exception class in the error message.

* subversion/bindings/javahl/native/JNIUtil.h
  (JNIUtil::wrappedHandleSVNError): New private method.
* subversion/bindings/javahl/native/JNIUtil.cpp
  (JNIUtil::wrappedHandleSVNError): Renamed from JNIUtil::handleSVNError.
  (JNIUtil::handleSVNError): New implementation that clears the error.
  (known_exception_to_cstring): New; extracted from exception_to_cstring.
   Finds the exception class name.
  (exception_to_cstring): Call known_exception_to_cstring.
  (JNIUtil::checkJavaException): Call known_exception_to_cstring.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532117 13f79535-47bb-0310-9956-ffa450edef68
Pass the correct baton to the open-tunnel callback.

* subversion/libsvn_ra_svn/client.c (open_session):
   Use callbakcs->tunnel_baton, not callbacks_baton, in the open-tunnel call.
* subversion/tests/libsvn_ra/ra-test.c: Add checks to make sure that the
   tunnel baton and context get propagated through the callbacks.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532126 13f79535-47bb-0310-9956-ffa450edef68
Expose the tunnel management callbacks in JavaHL.

* build.conf (private-built-includes): Add new generated JavaHL headers.

[in subversion/bindings/javahl/src/org/apache/subversion/javahl]
* callback/TunnelAgent.java: New public interface.
* ISVNClient.java, SVNClient.java (ISVNClient.setTunnelAgent): New method.
* remote/RemoteFactory.java
  (RemoteFactory.RemoteFactory): New parameter tunnelAgent.
  (RemoteFactory.setTunnelAgent): New method.
  (RemoteFactory.tunnelAgent): New member.
  (RemoteFactory.open): New parameter tunnelAgent; all callers updated.
* util/TunnelChannel.java, util/RequestChannel.java, util/ResponseChannel.java:
   New private utility classes; implement byte channes for tunnels.

[in subversion/bindings/javahl/native]
* OperationContext.h
  (OperationContext::m_jtunnelcb): New class member.
  (OperationContext::checkTunnel,
   OperationContext::openTunnel,
   OperationContext::closeTUnnel): New static methods.
  (OperationContext::setTunnelCallback,
   OperationContext::getTunnelCallback): New methods.
* OperationContext.cpp
  (OperationContext::OperationContext): Initialise m_jtunnelcb.
  (OperationContext::~OperationContext): Release m_jtunnelcb.
  (OperationContext::checkTunnel, OperationContext::openTunnel,
   OperationContext::closeTUnnel, OperationContext::setTunnelCallback,
   OperationContext::getTunnelCallback): Implement.
  (TunnelContext): New local helper class.
  (create_Channel, create_RequestChannel,
   create_ResponseChannel): new local helper functions.

* ClientContext.h (ClientContext::setTunnelCallback): Override method.
* ClientContext.cpp (ClientContext::ClientContext): Set tunnel callbacks.
  (ClientContext::setTunnelCallback): Implement.

* RemoteSessionContext.h
  (RemoteSessionContext::RemoteSessionContext): New parameter jtunnelcb.
* RemoteSessionContext.cpp
  (RemoteSessionContext::RemoteSessionContext): Update signature and
   set tunnel callbacks.

* RemoteSession.h (RemoteSession::open, RemoteSession::RemoteSession):
   New parameter jtunnelcb.
* RemoteSession.cpp (RemoteSession::open, RemoteSession::RemoteSession):
   Update signature and implementation.
* SVNClient.cpp (SVNClient::openRemoteSession): Pass the tunnel callback
   from the context to the session factory.

* org_apache_subversion_javahl_SVNClient.cpp
  (Java_org_apache_subversion_javahl_SVNClient_setTunnelAgent):
   Implement native method.
* org_apache_subversion_javahl_remote_RemoteFactory.cpp
  (Java_org_apache_subversion_javahl_remote_RemoteFactory_open)
   Update native method.
* org_apache_subversion_javahl_util_TunnelChannel.cpp: New.
   Implementation of TunnelChannel, RequestChannel and ResponseChannel.

* JNIByteArray.h (JNIByteArray::m_abortOnRelease): New member.
  (JNIByteArray::JNIByteArray): New default parameter abortOnRelease.
* JNIByteArray.cpp (JNIByteArray::JNIByteArray): Update constructor.
  (JNIByteArray::~JNIByteArray): Optionally commit array changes.

[in subversion/bindings/javahl/tests/org/apache/subversion/javahl]
* SVNTests.java (SVNTests.DefaultProgressListener): Make protected.
* BasicTests.java (BasicTests.Tunnel): New helper class.
  (BasicTests.testTunnelAgent): New test case for tunnels.
* SVNRemoteTests.java
  (SVNRemoteTests.testSessionGC) Update factory construction.
  (SVNRemoteTests.testGetSession_ConfigConstructor): Likewise.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532182 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_ra_svn/marshal.c
  (read_item): fix typo in docstring. No functional change


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532185 13f79535-47bb-0310-9956-ffa450edef68
Minor optimization in svn_membuf code.

* subversion/libsvn_subr/string.c
  (membuf_create): always allocate, even 0 bytes
  (svn_membuf__resize): new allocated membuf->data can never be NULL

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532186 13f79535-47bb-0310-9956-ffa450edef68
Follow-up to r1532182: Include missing header.

* subversion/bindings/javahl/native/OperationContext.cpp:
   Include apr_file_io.h.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532189 13f79535-47bb-0310-9956-ffa450edef68
Introduce svn_stringbuf_from_stream() as symmetric counterpart to
svn_stream_from_stringbuf() and use it in one place.

* subversion/include/svn_io.h
  (svn_stringbuf_from_stream): declare new public API function

* subversion/libsvn_subr/stream.c
  (svn_stringbuf_from_stream): implement new API function

* subversion/libsvn_fs_fs/cached_data.c
  (get_dir_contents): use the new API

* develop/trunk/subversion/tests/libsvn_subr/stream-test.c
  (test_stringbuf_from_stream): new test case for new API
  (test_funcs): register new test case


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532193 13f79535-47bb-0310-9956-ffa450edef68
Add "null-info" command to svn-bench.  This simply duplicates the
info command code from the CL client and rips out all non-essential
client-side processing.

* tools/client-side/svn-bench/cl.h
  (svn_opt_subcommand_t): add null-info command

* tools/client-side/svn-bench/null-info-cmd.c
  (): new file
  (DIRENT_FIELDS,
   push_dir_info,
   client_info): duplicated and greatly simplified code from
                 client-side libs
  (svn_cl__null_info): main command implementation, does not support
                       --xml, working copy paths etc.

* tools/client-side/svn-bench/svn-bench.c
  (svn_cl__longopt_t): declare opt_changelist option
  (svn_cl__options): add description for null-info command
  (sub_main): handle new "-R" option

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532196 13f79535-47bb-0310-9956-ffa450edef68
* develop/trunk/tools/client-side/svn-bench/null-info-cmd.c
  (push_dir_info,
   client_info): update commentary. No functional change.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532199 13f79535-47bb-0310-9956-ffa450edef68
Add support for the "--auto-moves" option to svn-bench null-log
(code taken from SVN CL client).

* develop/trunk/tools/client-side/svn-bench/cl.h
  (svn_cl__opt_state_t): add auto_moves flag

* develop/trunk/tools/client-side/svn-bench/null-log-cmd.c
  (svn_cl__null_log): process auto-moves option and use latest API

* develop/trunk/tools/client-side/svn-bench/svn-bench.c
  (svn_cl__longopt_t): declare new option
  (svn_cl__options): describe it
  (svn_cl__cmd_table): add it to null-log command
  (sub_main): process the new option

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532200 13f79535-47bb-0310-9956-ffa450edef68
Publish authz_retrieve_config as svn_repos__retrieve_config
(we will need it soon).

* develop/trunk/subversion/include/private/svn_repos_private.h
  (svn_repos__retrieve_config): declare as private API function

* develop/trunk/subversion/libsvn_repos/authz.c
  (authz_retrieve_config): rename to ...
  (svn_repos__retrieve_config): ... this
  (svn_repos__authz_read): update caller

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532201 13f79535-47bb-0310-9956-ffa450edef68
We're stuck with the ancient pipe API in apr < 1.3.

* subversion/bindings/javahl/native/OperationContext.cpp:
   Include svn_dep_compat.h.
  (TunnelContext::TunnelContext): If we're compiling with an old enough APR,
   use apr_file_pipe_create instead of apr_file_pipe_create_ex.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532206 13f79535-47bb-0310-9956-ffa450edef68
First shot at a configuration pool.  This data structure allows
to cache parsed svn_config_t objects to be cached and shared
between threads.

We will use this code in svnserve's upcoming repository cache.

Code is untested and tests are yet to be written. 

* develop/trunk/subversion/include/private/svn_subr_private.h
  (svn_config_pool__t,
   svn_config_pool__create,
   svn_config_pool__get): declare new API

* develop/trunk/subversion/libsvn_subr/config_pool.c
  (): new file implementing the new API

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532239 13f79535-47bb-0310-9956-ffa450edef68
Tentatively move the new config pool API to libsvn_repos.
This is due to our support for URL config paths and the resulting
dependency on libsvn_repos

* subversion/include/private/svn_subr_private.h
  (svn_config_pool__t,
   svn_config_pool__create,
   svn_config_pool__get): move and rename API from here ...

* subversion/include/private/svn_repos_private.h
  (svn_repos__config_pool_t,
   svn_repos__config_pool_create,
   svn_repos__config_pool_get): ... to here

* subversion/libsvn_subr/config_pool.c
  (): moved ...

* subversion/libsvn_repos/config_pool.c
  (): ... here and update due to API renames

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532244 13f79535-47bb-0310-9956-ffa450edef68
In the Win32 resource compiler: stop including APR and several system headers
just to produce a nice version string. This slows down compilation and
generates several warnings per compiled library. (Too long macros, etc.)

* build/win32/svn.rc
  (SVN_WIN32_RESOURCE_COMPILATION): New explicit define.
  (APR_STRINGIFY): Define locally.

* subversion/include/svn_version.h
  (#ifdef SVN_WIN32_RESOURCE_COMPILATION): Use this check to skip including
    all headers instead of just ignoring once based on an APR define.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1532287 13f79535-47bb-0310-9956-ffa450edef68