Fix a Perl-to-APR conversion function.

* subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
  (svn_swig_pl_to_hash): This function is the universal converter
  from "Perl hash of some values" to "APR hash of (converted) values".
  It uses hv_iternextsv(H, &KEY, &LEN) to retrieve a Perl 
  hash key. This does _not_ copy the key string, but simply sets KEY
  to a pointer into Perl internal memory. svn_hash_sets() also does _not_
  copy KEY, so the returned apt_hash_t now contains a pointer into Perl memory.
  If Perl later garbage collects this memory this apt_hash_t key will point
  to random bytes and apr_hash_get() for this key will fail.
  Hence make a copy of the string and use that for svn_hash_sets().


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507044 13f79535-47bb-0310-9956-ffa450edef68
Fix possible duplication of work when using svn_hash_sets() macro.

svn_hash_sets() is a macro that uses the key argument twice, so the expression
used in the key argument will be evaluated twice.  We often put calls to
apr_pstrdup() and other functions in that position, which causes unnecessary
extra work and memory usage.

* subversion/include/svn_hash.h
  (svn_hash_sets): Use a variable to avoid executing key expression twice.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507155 13f79535-47bb-0310-9956-ffa450edef68
Implement the get_locations RA method in JavaHL.

[in subversion/bindings/javahl/src/org/apache/subversion/javahl]
* ISVNRemote.java, remote/RemoteSession.java
  (ISVNRemote.getLocations): New method.

[in subversion/bindings/javahl/native]
* RemoteSession.h (RemoteSession::getLocations): New method.
* RemoteSession.cpp (long_iterable_to_revnum_array, location_hash_to_map):
   New private helper functions.
  (RemoteSession::getLocations): Implement.

[in subversion/bindings/javahl/tests/org/apache/subversion/javahl]
* SVNRemoteTests.java (SVNRemoteTests.testGetLocations): New test case.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507164 13f79535-47bb-0310-9956-ffa450edef68
Introduce a pool wrapper for the iteration pool idiom in the C++HL APR wrapper.

* subversion/bindings/cxxhl/src/aprwrap/pool.hpp
  (IterationPool): New class; a pool wrapper that hides its API.
  (Pool::Pool): Make non-default constructor explicit and accept a non-const
   reference to the parent pool instead of a const pointer.
  (Pool::Iteration): New nested class; a proxy for the pool in IterationPool.
* subversion/bindings/cxxhl/src/exception.cpp
  (Error::compile_messages): Use IterationPool and Pool::Iteration in the loop.
* subversion/bindings/cxxhl/tests/test_aprwrap.cpp
  (CreateSubpool): Adapt to changed pool constructor signature.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507217 13f79535-47bb-0310-9956-ffa450edef68
Fix possible duplication of work when using svn_hash_gets() macro.

This is similar to the situation described about svn_hash_sets() in
r1507155.  However, we can't use the fix used there because svn_hash_gets()
has a return value.  This essentially roles back the opportunity for the
compiler to optimize the strlen() call when the key is a literal string.  It
also puts svn_hash_gets() back to the same implementation it had in r1443387.

* subversion/include/svn_hash.h
  (svn_hash_gets): Use APR_HASH_KEY_STRING as length.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507366 13f79535-47bb-0310-9956-ffa450edef68
* subversion/include/svn_config.h:
  (svn_hash_sets): Change temp variable name to avoid shadow warnings.

Suggested by: philip


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507367 13f79535-47bb-0310-9956-ffa450edef68
Allow passing NULL for the config dir param in svn_config_walk_auth_data, 
which means using the default configuration directory path.

* subversion/libsvn_subr/config_auth.c
  (svn_config_walk_auth_data): Remove check for NULL config dir string.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507382 13f79535-47bb-0310-9956-ffa450edef68
Revert r1507367.  I committed the wrong file with unintended changes.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507390 13f79535-47bb-0310-9956-ffa450edef68
* subversion/include/svn_config.h:
  (svn_hash_sets): Change temp variable name to avoid shadow warnings.

Suggested by: philip

[This is the commit that was intended to be committed in r1507390]


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507391 13f79535-47bb-0310-9956-ffa450edef68
Refactor svn_error_t wrapping in C++HL so that we do not have to expose the
type name in the public API, and simplify memory management.

* subversion/bindings/cxxhl/include/svncxxhl/exception.hpp
  (InternalError::InternalError): Make constructors explicit.
  (InternalError::m_description): Change type to a shared_ptr.
  (Error::Error): Remove public constructors and make constructor explicit.
  (Error::smart_ptr, Error::nested, Error::throw_svn_error,
   Error::m_errno, Error::m_nested): Remove.
  (Error::Message): Make this a nested class instead of using std::pair.
  (Cancelled::Cancelled): Make constructor explicit.
* subversion/bindings/cxxhl/src/cxxhl-private.hpp: New header.
* subversion/bindings/cxxhl/src/private/exception.hpp: New header.
  (detail::checked_call): New prototype. Replaces Error::throw_svn_error.
* subversion/bindings/cxxhl/src/exception.cpp: Refactor InternalError,
   Error and Cancelled implementation. Subversion error stack is now
   represented by chained error descriptions instead of chained
   exception objects.
  (detail::checked_call): Implement.

* subversion/bindings/cxxhl/tests/test_exception.cpp:
   Use new Error::Message and detail::checked_call functions.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507413 13f79535-47bb-0310-9956-ffa450edef68
Fix private header name clash in C++HL.

* build.conf (private-includes):
   Add subversion/bindings/cxxhl/src/private/*.hpp.
* subversion/bindings/cxxhl/src/private/exception-private.hpp:
   Renamed from exception.hpp
* subversion/bindings/cxxhl/src/cxxhl-private.hpp:
   Update include directive.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507415 13f79535-47bb-0310-9956-ffa450edef68
Add test that exercises issue #4400.

* subversion/tests/cmdline/commit_tests.py
  (commit_cp_with_deep_delete,test_list): New test.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507567 13f79535-47bb-0310-9956-ffa450edef68
* subversion/bindings/cxxhl/src/private.hpp: renamed from cxxhl-private.hpp.
* subversion/bindings/cxxhl/src/exception.cpp,
  subversion/bindings/cxxhl/tests/test_exception.cpp: Update include directives.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507573 13f79535-47bb-0310-9956-ffa450edef68
Make the C++HL Pool class & co. explicitly non-copyable.

* subversion/bindings/cxxhl/include/svncxxhl/_compat.hpp
  (compat::noncopyable): Define mixin, or use Boost's version if available.

* subversion/bindings/cxxhl/src/aprwrap/pool.hpp
  (Pool, Pool::Iteration, IterationPool): Derive from non-copyable.
  (Pool::Pool, IterationPool::IterationPool): Change subpool constructors to
   accept a pointer to the parent instead of a reference, to make them
   obviously different from copy constructors.

* subversion/bindings/cxxhl/tests/test_aprwrap.cpp (CreateSubpool):
   Update for changed subpool constructor signature.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507574 13f79535-47bb-0310-9956-ffa450edef68
* subversion/bindings/cxxhl/src/aprwrap/hash.hpp (Hash):
   Remove copy constructors. The hash wrapper is trivially copyable
   and the default assignment operators and copy constructors work fine.
* subversion/bindings/cxxhl/src/aprwrap/array.hpp (Array):
   Remove copy constructor; same rationale as above.
   (Note that ConstArray does need it because it also has a conversion
    constructor from Array.)


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507576 13f79535-47bb-0310-9956-ffa450edef68
Fix Issue #4400: commits fail with copy and deep delete under copy.

* subversion/libsvn_ra_serf/commit.c
  (checkout_dir): Generate the working_url when a parent is added by combining
    the add parent's working_url and the unique (vs add parent) portion of the
    checkout directory's relpath.

* subversion/tests/cmdline/commit_tests.py
  (commit_cp_with_deep_delete): Remove the XFail decorator from the test which
    will pass now.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507589 13f79535-47bb-0310-9956-ffa450edef68
backport.pl conflicts mode: improve the warning summary by adding the
logsummarysummary (sic) to it.

To this end, change the %ERRORS global hash's values interface.

* tools/dist/backport.pl
  (merge, handle_entry): Track %ERRORS interface change.
  (logsummarysummary): New helper, factored out from..
  (handle_entry): .. here.
  (warning_summary): Include the logsummarysummary in the errput..


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507639 13f79535-47bb-0310-9956-ffa450edef68
backport.pl conflicts mode: fix a bug whereby conflicts in the root dir would
not be reported properly.

* tools/dist/backport.pl
  (handle_entry): Implement basename() correctly.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507640 13f79535-47bb-0310-9956-ffa450edef68
backport.pl: Follow-up to r1507640: implement basename() really correctly
(that is, don't).

* tools/dist/backport.pl
  (File::Basename::basename): Import.
  (usage, handle_entry): Use it instead of reinventing it.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1507643 13f79535-47bb-0310-9956-ffa450edef68
* tools/dist/backport.pl
  (handle_entry): Use the correct form of line noise to ask an array whether
    it has more than one element.

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