You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/07/11 18:00:52 UTC

svn commit: r1502256 [1/4] - in /subversion/branches/fsfs-improvements: ./ build/ac-macros/ build/generator/ subversion/bindings/cxxhl/include/svncxxhl/ subversion/bindings/cxxhl/src/ subversion/bindings/cxxhl/src/aprwrap/ subversion/bindings/javahl/na...

Author: stefan2
Date: Thu Jul 11 16:00:50 2013
New Revision: 1502256

URL: http://svn.apache.org/r1502256
Log:
On the fsfs-improvements branch: Sync with /trunk.

Added:
    subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/src/aprwrap/
      - copied from r1502252, subversion/trunk/subversion/bindings/cxxhl/src/aprwrap/
    subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/src/aprwrap.hpp
      - copied unchanged from r1502252, subversion/trunk/subversion/bindings/cxxhl/src/aprwrap.hpp
    subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/src/aprwrap/array.hpp
      - copied unchanged from r1502252, subversion/trunk/subversion/bindings/cxxhl/src/aprwrap/array.hpp
    subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/src/aprwrap/hash.hpp
      - copied unchanged from r1502252, subversion/trunk/subversion/bindings/cxxhl/src/aprwrap/hash.hpp
    subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/src/aprwrap/impl.cpp
      - copied unchanged from r1502252, subversion/trunk/subversion/bindings/cxxhl/src/aprwrap/impl.cpp
    subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/src/aprwrap/pool.hpp
      - copied unchanged from r1502252, subversion/trunk/subversion/bindings/cxxhl/src/aprwrap/pool.hpp
    subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/PropertyTable.cpp
      - copied unchanged from r1502252, subversion/trunk/subversion/bindings/javahl/native/PropertyTable.cpp
    subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/PropertyTable.h
      - copied unchanged from r1502252, subversion/trunk/subversion/bindings/javahl/native/PropertyTable.h
Removed:
    subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/RevpropTable.cpp
    subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/RevpropTable.h
Modified:
    subversion/branches/fsfs-improvements/   (props changed)
    subversion/branches/fsfs-improvements/CHANGES
    subversion/branches/fsfs-improvements/build.conf
    subversion/branches/fsfs-improvements/build/ac-macros/berkeley-db.m4
    subversion/branches/fsfs-improvements/build/ac-macros/compiler.m4
    subversion/branches/fsfs-improvements/build/ac-macros/sqlite.m4
    subversion/branches/fsfs-improvements/build/generator/gen_win.py
    subversion/branches/fsfs-improvements/configure.ac
    subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/include/svncxxhl/exception.hpp
    subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/src/exception.cpp
    subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/CommitEditor.cpp
    subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/CommitEditor.h
    subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/JNIUtil.cpp
    subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/RemoteSession.cpp
    subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/SVNClient.cpp
    subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/SVNClient.h
    subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
    subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteFactory.java
    subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
    subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java
    subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
    subversion/branches/fsfs-improvements/subversion/bindings/swig/perl/native/Client.pm
    subversion/branches/fsfs-improvements/subversion/include/svn_config.h
    subversion/branches/fsfs-improvements/subversion/include/svn_error_codes.h
    subversion/branches/fsfs-improvements/subversion/include/svn_string.h
    subversion/branches/fsfs-improvements/subversion/libsvn_client/diff_local.c
    subversion/branches/fsfs-improvements/subversion/libsvn_client/switch.c
    subversion/branches/fsfs-improvements/subversion/libsvn_delta/compat.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c
    subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/serf.c
    subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/util.c
    subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/util_error.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/config_file.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/gpg_agent.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/io.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/ssl_server_trust_providers.c
    subversion/branches/fsfs-improvements/subversion/libsvn_subr/string.c
    subversion/branches/fsfs-improvements/subversion/libsvn_wc/update_editor.c
    subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db.c
    subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db_private.h
    subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db_wcroot.c
    subversion/branches/fsfs-improvements/subversion/po/de.po
    subversion/branches/fsfs-improvements/subversion/svnauth/svnauth.c
    subversion/branches/fsfs-improvements/subversion/tests/cmdline/svntest/actions.py
    subversion/branches/fsfs-improvements/subversion/tests/cmdline/svntest/main.py
    subversion/branches/fsfs-improvements/subversion/tests/cmdline/wc_tests.py
    subversion/branches/fsfs-improvements/subversion/tests/libsvn_wc/wc-lock-tester.c
    subversion/branches/fsfs-improvements/tools/dev/build-svn-deps-win.pl
    subversion/branches/fsfs-improvements/tools/dev/svnraisetreeconflict/svnraisetreeconflict.c
    subversion/branches/fsfs-improvements/tools/dist/backport.pl
    subversion/branches/fsfs-improvements/tools/dist/make-deps-tarball.sh   (props changed)
    subversion/branches/fsfs-improvements/win-tests.py

Propchange: subversion/branches/fsfs-improvements/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1499981-1502252
  Merged /subversion/branches/fsfs-format7:r1426304,1500054

Modified: subversion/branches/fsfs-improvements/CHANGES
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/CHANGES?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/CHANGES (original)
+++ subversion/branches/fsfs-improvements/CHANGES Thu Jul 11 16:00:50 2013
@@ -35,7 +35,7 @@ http://svn.apache.org/repos/asf/subversi
     * remove revision property buffer limit in fsfs (r1491770)
     * reduce network usage for 'svn mergeinfo --show-revs' (r1492005)
     * resolve segfault in fsfs-stats when passing invalid path (r1492164)
-    * fix 'svnadmin upgrade' error of non-shared fsfs repositories (r1494287)
+    * fix 'svnadmin upgrade' error of non-sharded fsfs repositories (r1494287)
     * fix data loss when cancelling 'svnadmin upgrade' in last stage (r1494298)
     * deny 'svnadmin create --fs-type=fsfs --compatible-version=1.0' (r1494223)
     * improve http status handling in ra_serf (r1495104)

Modified: subversion/branches/fsfs-improvements/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build.conf?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build.conf (original)
+++ subversion/branches/fsfs-improvements/build.conf Thu Jul 11 16:00:50 2013
@@ -40,6 +40,8 @@ private-includes =
         subversion/libsvn_delta/compose_delta.c
         subversion/bindings/cxxhl/include/*.hpp
         subversion/bindings/cxxhl/include/svncxxhl/*.hpp
+        subversion/bindings/cxxhl/src/*.hpp
+        subversion/bindings/cxxhl/src/aprwrap/*.hpp
         subversion/libsvn_subr/utf8proc/utf8proc.h
         subversion/libsvn_subr/utf8proc/utf8proc.c
         subversion/libsvn_subr/utf8proc/utf8proc_data.c
@@ -202,7 +204,7 @@ manpages = subversion/svnmucc/svnmucc.1
 description = Subversion Authentication Credentials Management Tool
 type = exe
 path = subversion/svnauth
-libs = libsvn_subr apriconv apr
+libs = libsvn_subr apriconv apr serf
 install = bin
 manpages = subversion/svnauth/svnauth.1
 
@@ -666,7 +668,7 @@ type = lib
 path = subversion/bindings/cxxhl
 libs = libsvn_repos libsvn_client libsvn_wc libsvn_ra libsvn_delta libsvn_diff
        libsvn_subr libsvn_fs aprutil apriconv apr
-sources = src/*.cpp
+sources = src/*.cpp src/aprwrap/*.cpp
 install = cxxhl-lib
 msvc-static = yes
 compile-cmd = $(COMPILE_CXXHL_CXX)

Modified: subversion/branches/fsfs-improvements/build/ac-macros/berkeley-db.m4
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build/ac-macros/berkeley-db.m4?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build/ac-macros/berkeley-db.m4 (original)
+++ subversion/branches/fsfs-improvements/build/ac-macros/berkeley-db.m4 Thu Jul 11 16:00:50 2013
@@ -126,8 +126,8 @@ AC_DEFUN(SVN_LIB_BERKELEY_DB,
     svn_lib_berkeley_db=no
   else
     AC_MSG_CHECKING([for availability of Berkeley DB])
-    AC_ARG_ENABLE(banging-head-against-wall,
-      AS_HELP_STRING([---disable-banging-head-against-wall],
+    AC_ARG_ENABLE(bdb6,
+      AS_HELP_STRING([--enable-bdb6],
                      [Allow building against BDB 6+.
                       See --with-berkeley-db for specifying the location of
                       the Berkeley DB installation.  Using BDB 6 will fail if
@@ -140,7 +140,7 @@ AC_DEFUN(SVN_LIB_BERKELEY_DB,
       svn_lib_berkeley_db=yes
     else
       if test "$svn_have_berkeley_db" = "no6"; then
-        AC_MSG_RESULT([no (found version 6, but --enable-banging-head-against-wall not specified)])
+        AC_MSG_RESULT([no (found version 6, but --enable-bdb6 not specified)])
         # A warning will be printed at the end of configure.ac.
       else
         AC_MSG_RESULT([no])

Modified: subversion/branches/fsfs-improvements/build/ac-macros/compiler.m4
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build/ac-macros/compiler.m4?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build/ac-macros/compiler.m4 (original)
+++ subversion/branches/fsfs-improvements/build/ac-macros/compiler.m4 Thu Jul 11 16:00:50 2013
@@ -67,8 +67,16 @@ AC_DEFUN([SVN_CC_MODE_SETUP],
   ])
 
   CMODEFLAGS="$CFLAGS"
+  CFLAGS=""
+
+  dnl Find flags to silence all warnings
+  SVN_CFLAGS_ADD_IFELSE([-w])
+
+  CNOWARNFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS_KEEP"
+
   AC_SUBST(CMODEFLAGS)
+  AC_SUBST(CNOWARNFLAGS)
   AC_SUBST(CMAINTAINERFLAGS)
 
   dnl Tell clang to not accept unknown warning flags
@@ -85,9 +93,17 @@ AC_DEFUN([SVN_CXX_MODE_SETUP],
                 dnl g++ and clang++
   SVN_CXXFLAGS_ADD_IFELSE([-std=c++98])
 
-  CXXMODEFLAGS="$CXXFLAGS"
+  CXXMODEFLAGS="$CFLAGS"
+  CXXFLAGS=""
+
+  dnl Find flags to silence all warnings
+  SVN_CXXFLAGS_ADD_IFELSE([-w])
+
+  CXXNOWARNFLAGS="$CXXFLAGS"
   CXXFLAGS="$CXXFLAGS_KEEP"
+
   AC_SUBST(CXXMODEFLAGS)
+  AC_SUBST(CXXNOWARNFLAGS)
   AC_SUBST(CXXMAINTAINERFLAGS)
 
   dnl Tell clang++ to not accept unknown warning flags

Modified: subversion/branches/fsfs-improvements/build/ac-macros/sqlite.m4
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build/ac-macros/sqlite.m4?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build/ac-macros/sqlite.m4 (original)
+++ subversion/branches/fsfs-improvements/build/ac-macros/sqlite.m4 Thu Jul 11 16:00:50 2013
@@ -250,8 +250,10 @@ AC_DEFUN(SVN_DOWNLOAD_SQLITE,
   echo "unpack the archive using unzip and rename the resulting"
   echo "directory to:"
   echo "$abs_srcdir/sqlite-amalgamation"
-  echo "or to:"
-  echo "$abs_builddir/sqlite-amalgamation"
+  if test x"$abs_srcdir" != x"$abs_builddir"; then
+    echo "or to:"
+    echo "$abs_builddir/sqlite-amalgamation"
+  fi
   echo ""
   AC_MSG_ERROR([Subversion requires SQLite])
 ])

Modified: subversion/branches/fsfs-improvements/build/generator/gen_win.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build/generator/gen_win.py?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build/generator/gen_win.py (original)
+++ subversion/branches/fsfs-improvements/build/generator/gen_win.py Thu Jul 11 16:00:50 2013
@@ -225,6 +225,9 @@ class GeneratorBase(gen_base.GeneratorBa
       if os.path.exists(os.path.join(path, lib + ".lib")):
         self.bdb_lib = lib
         break
+      elif os.path.exists(os.path.join(path, lib + "d.lib")):
+        self.bdb_lib = lib
+        break
     else:
       self.bdb_lib = None
 
@@ -243,7 +246,8 @@ class WinGeneratorBase(GeneratorBase):
     GeneratorBase.__init__(self, fname, verfname, options)
 
     if self.bdb_lib is not None:
-      print("Found %s.lib in %s\n" % (self.bdb_lib, self.bdb_path))
+      print("Found %s.lib or %sd.lib in %s\n" % (self.bdb_lib, self.bdb_lib,
+                                                 self.bdb_path))
     else:
       print("BDB not found, BDB fs will not be built\n")
 
@@ -345,7 +349,7 @@ class WinGeneratorBase(GeneratorBase):
 
   def errno_filter(self, codes):
     "Callback for gen_base.write_errno_table()."
-    # Filter out apr_errno.h SOC* codes, which alias the windows API names.
+    # Filter out python's SOC* codes, which alias the windows API names.
     return set(filter(lambda code: not (10000 <= code <= 10100), codes))
 
   def find_rootpath(self):

Modified: subversion/branches/fsfs-improvements/configure.ac
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/configure.ac?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/configure.ac (original)
+++ subversion/branches/fsfs-improvements/configure.ac Thu Jul 11 16:00:50 2013
@@ -1517,9 +1517,9 @@ if test "$svn_have_berkeley_db" = "no6" 
 
 
 Berkeley DB 6 was found, but not used.  Please re-run configure (see
-./config.nice) with the '--enable-banging-head-against-wall' flag to use it,
-or explicitly specify '--disable-banging-head-against-wall' or 
-'--without-berkeley-db' to silence this warning.
+./config.nice) with the '--enable-bdb6' flag to use it,
+or explicitly specify '--disable-bdb6' or '--without-berkeley-db'
+to silence this warning.
 
 Please note that some versions of Berkeley DB 6+ are under the GNU Affero
 General Public License, version 3:

Modified: subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/include/svncxxhl/exception.hpp
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/include/svncxxhl/exception.hpp?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/include/svncxxhl/exception.hpp (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/include/svncxxhl/exception.hpp Thu Jul 11 16:00:50 2013
@@ -49,7 +49,34 @@ namespace detail {
 class ErrorDescription;
 } // namespace detail
 
-class Error : public std::exception
+/**
+ * Exceptions generated by the C++HL implementation.
+ */
+class InternalError : public std::exception
+{
+public:
+  InternalError(const char* description);
+
+  InternalError(const InternalError& that) throw();
+  InternalError& operator= (const InternalError& that) throw();
+  virtual ~InternalError() throw();
+
+  /**
+   * Returns the message associated with this exception object.
+   */
+  virtual const char* what() const throw();
+
+protected:
+  InternalError(detail::ErrorDescription* description) throw();
+
+  /** Error description and trace location information. */
+  detail::ErrorDescription* m_description;
+};
+
+/**
+ * Encapsulate a stack of Subversion error codes and messages.
+ */
+class Error : public InternalError
 {
 public:
   typedef compat::shared_ptr<Error> shared_ptr;
@@ -71,9 +98,6 @@ public:
    */
   virtual shared_ptr nested() const throw() { return m_nested; }
 
-  /// Returns the message associated with this exception object.
-  virtual const char* what() const throw();
-
   /**
    * Error message description.
    *
@@ -122,15 +146,16 @@ private:
 
   int m_errno;                /**< The (SVN or APR) error code. */
   shared_ptr m_nested;        /**< Optional pointer to nessted error. */
-  /** Error description and trace location information. */
-  detail::ErrorDescription* m_description;
 };
 
+/**
+ * Thrown instead of Error when the error chain contains a
+ * @c SVN_ERR_CANCELLED error code.
+ */
 class Cancelled : public Error
 {
-  friend void Error::throw_svn_error(svn_error_t*);
-
 protected:
+  friend void Error::throw_svn_error(svn_error_t*);
   Cancelled(int error_code, detail::ErrorDescription* description) throw()
     : Error(error_code, description)
     {}

Modified: subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/src/exception.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/src/exception.cpp?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/src/exception.cpp (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/cxxhl/src/exception.cpp Thu Jul 11 16:00:50 2013
@@ -113,23 +113,64 @@ private:
 
 } // namespace detail
 
+//
+// Class InternalError
+//
+
+InternalError::InternalError(const char* description)
+  : m_description(detail::ErrorDescription::create(description)->reference())
+{}
+
+InternalError::InternalError(const InternalError& that) throw()
+  : m_description(that.m_description->reference())
+{}
+
+InternalError& InternalError::operator=(const InternalError& that) throw()
+{
+  if (this == &that)
+    return *this;
+
+  // This in-place destroy+copy implementation of the assignment
+  // operator is safe because both the destructor and the copy
+  // constructor do not throw exceptions.
+  this->~InternalError();
+  return *new(this) InternalError(that);
+}
+
+InternalError::~InternalError() throw()
+{
+  m_description->dereference();
+}
+
+const char* InternalError::what() const throw()
+{
+  return m_description->what();
+}
+
+InternalError::InternalError(detail::ErrorDescription* description) throw()
+  : m_description(description)
+{}
+
+//
+// Class Error
+//
 
 Error::Error(const char* description, int error_code)
-  : m_errno(error_code),
-    m_description(detail::ErrorDescription::create(description)->reference())
+  : InternalError(description),
+    m_errno(error_code)
 {}
 
 Error::Error(const char* description, int error_code,
              Error::shared_ptr nested_error)
-  : m_errno(error_code),
-    m_nested(nested_error),
-    m_description(detail::ErrorDescription::create(description)->reference())
+  : InternalError(description),
+    m_errno(error_code),
+    m_nested(nested_error)
 {}
 
 Error::Error(const Error& that) throw()
-  : m_errno(that.m_errno),
-    m_nested(that.m_nested),
-    m_description(that.m_description->reference())
+  : InternalError(that.m_description->reference()),
+    m_errno(that.m_errno),
+    m_nested(that.m_nested)
 {}
 
 Error& Error::operator=(const Error& that) throw()
@@ -144,19 +185,11 @@ Error& Error::operator=(const Error& tha
   return *new(this) Error(that);
 }
 
-Error::~Error() throw()
-{
-  m_description->dereference();
-}
-
-const char* Error::what() const throw()
-{
-  return m_description->what();
-}
+Error::~Error() throw() {}
 
 Error::Error(int error_code, detail::ErrorDescription* description) throw()
-  : m_errno(error_code),
-    m_description(description)
+  : InternalError(description),
+    m_errno(error_code)
 {}
 
 void Error::throw_svn_error(svn_error_t* err)

Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/CommitEditor.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/CommitEditor.cpp?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/CommitEditor.cpp (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/CommitEditor.cpp Thu Jul 11 16:00:50 2013
@@ -30,7 +30,7 @@
 #include "Iterator.h"
 #include "JNIByteArray.h"
 #include "LockTokenTable.h"
-#include "RevpropTable.h"
+#include "PropertyTable.h"
 #include "RemoteSession.h"
 
 #include <apr_tables.h>
@@ -69,7 +69,6 @@ CommitEditor::createInstance(jobject jse
   return editor->getCppAddr();
 }
 
-
 CommitEditor::CommitEditor(RemoteSession* session,
                            jobject jrevprops, jobject jcommit_callback,
                            jobject jlock_tokens, jboolean jkeep_locks)
@@ -90,7 +89,7 @@ CommitEditor::CommitEditor(RemoteSession
                                &m_callback_session_uuid,
                                pool.getPool()),);
 
-  RevpropTable revprops(jrevprops, true);
+  PropertyTable revprops(jrevprops, true);
   if (JNIUtil::isJavaExceptionThrown())
     return;
   LockTokenTable lock_tokens(jlock_tokens);
@@ -105,8 +104,8 @@ CommitEditor::CommitEditor(RemoteSession
                   m_callback.callback, &m_callback,
                   lock_tokens.hash(subPool, true),
                   bool(jkeep_locks),
-                  NULL,               // svn_ra__provide_base_cb_t
-                  NULL,               // svn_ra__provide_props_cb_t
+                  this->provide_base_cb,
+                  this->provide_props_cb,
                   this->get_copysrc_kind_cb, this,
                   pool.getPool(),     // result pool
                   subPool.getPool()), // scratch pool
@@ -265,7 +264,7 @@ void CommitEditor::addDirectory(jstring 
   Iterator children(jchildren);
   if (JNIUtil::isJavaExceptionThrown())
     return;
-  RevpropTable properties(jproperties, true);
+  PropertyTable properties(jproperties, true);
   if (JNIUtil::isJavaExceptionThrown())
     return;
 
@@ -290,7 +289,7 @@ void CommitEditor::addFile(jstring jrelp
   SVN_JNI_ERR(m_session->m_context->checkCancel(m_session->m_context),);
 
   InputStream contents(jcontents);
-  RevpropTable properties(jproperties, true);
+  PropertyTable properties(jproperties, true);
   if (JNIUtil::isJavaExceptionThrown())
     return;
 
@@ -342,7 +341,7 @@ void CommitEditor::alterDirectory(jstrin
   Iterator children(jchildren);
   if (JNIUtil::isJavaExceptionThrown())
     return;
-  RevpropTable properties(jproperties, true);
+  PropertyTable properties(jproperties, true);
   if (JNIUtil::isJavaExceptionThrown())
     return;
 
@@ -366,7 +365,7 @@ void CommitEditor::alterFile(jstring jre
   SVN_JNI_ERR(m_session->m_context->checkCancel(m_session->m_context),);
 
   InputStream contents(jcontents);
-  RevpropTable properties(jproperties, true);
+  PropertyTable properties(jproperties, true);
   if (JNIUtil::isJavaExceptionThrown())
     return;
 
@@ -487,23 +486,20 @@ void CommitEditor::abort()
 }
 
 
-svn_error_t*
-CommitEditor::get_copysrc_kind_cb(svn_node_kind_t* kind, void* baton,
-                                  const char* repos_relpath,
-                                  svn_revnum_t src_revision,
-                                  apr_pool_t *scratch_pool)
+namespace {
+svn_error_t* open_callback_session(svn_ra_session_t*& session,
+                                   const char* url, const char* uuid,
+                                   RemoteSessionContext* context,
+                                   SVN::Pool& sessionPool)
 {
-  CommitEditor* editor = static_cast<CommitEditor*>(baton);
-  if (!editor->m_callback_session)
+  if (!session)
     {
-      const char* corrected_url;
-      SVN_ERR(svn_ra_open4(&editor->m_callback_session, &corrected_url,
-                           editor->m_callback_session_url,
-                           editor->m_callback_session_uuid,
-                           editor->m_session->m_context->getCallbacks(),
-                           editor->m_session->m_context->getCallbackBaton(),
-                           editor->m_session->m_context->getConfigData(),
-                           editor->pool.getPool()));
+      const char* corrected_url = NULL;
+      SVN_ERR(svn_ra_open4(&session, &corrected_url, url, uuid,
+                           context->getCallbacks(),
+                           context->getCallbackBaton(),
+                           context->getConfigData(),
+                           sessionPool.getPool()));
 
       if (corrected_url)
         {
@@ -515,12 +511,79 @@ CommitEditor::get_copysrc_kind_cb(svn_no
               SVN_ERR_RA_ILLEGAL_URL, NULL,
               _("Repository URL changed while session was open.\n"
                 "Expected URL: %s\nApparent URL: %s"),
-              editor->m_callback_session_url, corrected_url);
+              url, corrected_url);
         }
     }
+  return SVN_NO_ERROR;
+}
+} // anonymous namespace
+
+
+svn_error_t*
+CommitEditor::provide_base_cb(svn_stream_t **contents,
+                              svn_revnum_t *revision,
+                              void *baton,
+                              const char *repos_relpath,
+                              apr_pool_t *result_pool,
+                              apr_pool_t *scratch_pool)
+{
+  *contents = NULL;
+  *revision = NULL;
+  return SVN_NO_ERROR;
+}
+
+svn_error_t*
+CommitEditor::provide_props_cb(apr_hash_t **props,
+                               svn_revnum_t *revision,
+                               void *baton,
+                               const char *repos_relpath,
+                               apr_pool_t *result_pool,
+                               apr_pool_t *scratch_pool)
+{
+  CommitEditor* editor = static_cast<CommitEditor*>(baton);
+  SVN_ERR(open_callback_session(editor->m_callback_session,
+                                editor->m_callback_session_url,
+                                editor->m_callback_session_uuid,
+                                editor->m_session->m_context,
+                                editor->pool));
+
+  svn_node_kind_t kind = svn_node_unknown;
+  SVN_ERR(svn_ra_check_path(editor->m_callback_session,
+                            repos_relpath, SVN_INVALID_REVNUM, &kind,
+                            scratch_pool));
+
+  // FIXME: Getting properties from the youngest revision is in fact
+  // not such a bright idea, as the path may have been moved or
+  // deleted in the path.
+  if (kind == svn_node_file)
+    return svn_ra_get_file(editor->m_callback_session,
+                           repos_relpath, SVN_INVALID_REVNUM,
+                           NULL, revision, props, scratch_pool);
+  else if (kind == svn_node_dir)
+    return svn_ra_get_dir2(editor->m_callback_session, NULL, revision, props,
+                           repos_relpath, SVN_INVALID_REVNUM, 0, scratch_pool);
+  else
+    return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
+                             _("Expected node kind '%s' or '%s' but got '%s'"),
+                             svn_node_kind_to_word(svn_node_file),
+                             svn_node_kind_to_word(svn_node_dir),
+                             svn_node_kind_to_word(kind));
+}
+
+svn_error_t*
+CommitEditor::get_copysrc_kind_cb(svn_node_kind_t* kind, void* baton,
+                                  const char* repos_relpath,
+                                  svn_revnum_t src_revision,
+                                  apr_pool_t *scratch_pool)
+{
+  CommitEditor* editor = static_cast<CommitEditor*>(baton);
+  SVN_ERR(open_callback_session(editor->m_callback_session,
+                                editor->m_callback_session_url,
+                                editor->m_callback_session_uuid,
+                                editor->m_session->m_context,
+                                editor->pool));
 
-  SVN::Pool subPool(editor->pool);
   return svn_ra_check_path(editor->m_callback_session,
                            repos_relpath, src_revision, kind,
-                           subPool.getPool());
+                           scratch_pool);
 }

Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/CommitEditor.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/CommitEditor.h?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/CommitEditor.h (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/CommitEditor.h Thu Jul 11 16:00:50 2013
@@ -90,7 +90,19 @@ private:
                jobject jrevprops, jobject jcommit_callback,
                jobject jlock_tokens, jboolean jkeep_locks);
 
-  // This is our svn_ra__get_copysrc_kind_cb_t for the commit editor.
+  // This is our private callbacks for the commit editor.
+  static svn_error_t* provide_base_cb(svn_stream_t **contents,
+                                      svn_revnum_t *revision,
+                                      void *baton,
+                                      const char *repos_relpath,
+                                      apr_pool_t *result_pool,
+                                      apr_pool_t *scratch_pool);
+  static svn_error_t* provide_props_cb(apr_hash_t **props,
+                                       svn_revnum_t *revision,
+                                       void *baton,
+                                       const char *repos_relpath,
+                                       apr_pool_t *result_pool,
+                                       apr_pool_t *scratch_pool);
   static svn_error_t* get_copysrc_kind_cb(svn_node_kind_t* kind, void* baton,
                                           const char* repos_relpath,
                                           svn_revnum_t src_revision,

Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/JNIUtil.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/JNIUtil.cpp?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/JNIUtil.cpp (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/JNIUtil.cpp Thu Jul 11 16:00:50 2013
@@ -908,11 +908,9 @@ JNIUtil::getDate(jobject jdate)
  */
 jbyteArray JNIUtil::makeJByteArray(const void *data, int length)
 {
-  if (data == NULL)
-    {
-      // a NULL will create no Java array
-      return NULL;
-    }
+  // a NULL will create no Java array
+  if (!data)
+    return NULL;
 
   JNIEnv *env = getEnv();
 
@@ -943,6 +941,10 @@ jbyteArray JNIUtil::makeJByteArray(const
  */
 jbyteArray JNIUtil::makeJByteArray(const svn_string_t *str)
 {
+  // a NULL will create no Java array
+  if (!str)
+    return NULL;
+
   return JNIUtil::makeJByteArray(str->data, static_cast<int>(str->len));
 }
 

Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/RemoteSession.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/RemoteSession.cpp?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/RemoteSession.cpp (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/RemoteSession.cpp Thu Jul 11 16:00:50 2013
@@ -110,8 +110,8 @@ RemoteSession::open(jint jretryAttempts,
 
   jobject jremoteSession = open(
       jretryAttempts, url.c_str(), uuid,
-      configDirectory.c_str(), jconfigHandler,
-      usernameStr, passwordStr, prompter, jprogress);
+      (jconfigDirectory ? configDirectory.c_str() : NULL),
+      jconfigHandler, usernameStr, passwordStr, prompter, jprogress);
   if (JNIUtil::isExceptionThrown() || !jremoteSession)
     {
       delete prompter;
@@ -410,14 +410,13 @@ RemoteSession::getRevisionByTimestamp(jl
 }
 
 namespace {
-bool byte_array_to_svn_string(JNIByteArray& ary, svn_string_t& str)
+svn_string_t*
+byte_array_to_svn_string(JNIByteArray& ary, SVN::Pool& scratch_pool)
 {
   if (ary.isNull())
-    return false;
-
-  str.data = reinterpret_cast<const char*>(ary.getBytes());
-  str.len = ary.getLength();
-  return true;
+    return NULL;
+  return svn_string_ncreate(reinterpret_cast<const char*>(ary.getBytes()),
+                            ary.getLength(), scratch_pool.getPool());
 }
 } // anonymous namespace
 
@@ -438,21 +437,17 @@ RemoteSession::changeRevisionProperty(
   if (JNIUtil::isExceptionThrown())
     return;
 
-  svn_string_t str_old_value;
-  svn_string_t* const p_old_value = &str_old_value;
-  svn_string_t* const* pp_old_value = NULL;
-  if (byte_array_to_svn_string(old_value, str_old_value))
-      pp_old_value = &p_old_value;
-
-  svn_string_t str_value;
-  svn_string_t* p_value = NULL;
-  if (byte_array_to_svn_string(value, str_value))
-      p_value = &str_value;
-
   SVN::Pool subPool(pool);
+  svn_string_t* const* p_old_value = NULL;
+  svn_string_t* const str_old_value =
+    byte_array_to_svn_string(old_value, subPool);
+  if (str_old_value)
+    p_old_value = &str_old_value;
+
   SVN_JNI_ERR(svn_ra_change_rev_prop2(m_session,
                                       svn_revnum_t(jrevision),
-                                      name, pp_old_value, p_value,
+                                      name, p_old_value,
+                                      byte_array_to_svn_string(value, subPool),
                                       subPool.getPool()), );
 }
 

Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/SVNClient.cpp?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/SVNClient.cpp Thu Jul 11 16:00:50 2013
@@ -51,7 +51,7 @@
 #include "CommitMessage.h"
 #include "EnumMapper.h"
 #include "StringArray.h"
-#include "RevpropTable.h"
+#include "PropertyTable.h"
 #include "DiffOptions.h"
 #include "CreateJ.h"
 #include "svn_auth.h"
@@ -319,7 +319,7 @@ jlong SVNClient::checkout(const char *mo
 }
 
 void SVNClient::remove(Targets &targets, CommitMessage *message, bool force,
-                       bool keep_local, RevpropTable &revprops,
+                       bool keep_local, PropertyTable &revprops,
                        CommitCallback *callback)
 {
     SVN::Pool subPool(pool);
@@ -419,7 +419,7 @@ jlongArray SVNClient::update(Targets &ta
 
 void SVNClient::commit(Targets &targets, CommitMessage *message,
                        svn_depth_t depth, bool noUnlock, bool keepChangelist,
-                       StringArray &changelists, RevpropTable &revprops,
+                       StringArray &changelists, PropertyTable &revprops,
                        CommitCallback *callback)
 {
     SVN::Pool subPool(pool);
@@ -444,7 +444,7 @@ void SVNClient::commit(Targets &targets,
 void SVNClient::copy(CopySources &copySources, const char *destPath,
                      CommitMessage *message, bool copyAsChild,
                      bool makeParents, bool ignoreExternals,
-                     RevpropTable &revprops, CommitCallback *callback)
+                     PropertyTable &revprops, CommitCallback *callback)
 {
     SVN::Pool subPool(pool);
 
@@ -473,7 +473,7 @@ void SVNClient::copy(CopySources &copySo
 void SVNClient::move(Targets &srcPaths, const char *destPath,
                      CommitMessage *message, bool force, bool moveAsChild,
                      bool makeParents, bool metadataOnly, bool allowMixRev,
-                     RevpropTable &revprops, CommitCallback *callback)
+                     PropertyTable &revprops, CommitCallback *callback)
 {
     SVN::Pool subPool(pool);
 
@@ -498,7 +498,7 @@ void SVNClient::move(Targets &srcPaths, 
 }
 
 void SVNClient::mkdir(Targets &targets, CommitMessage *message,
-                      bool makeParents, RevpropTable &revprops,
+                      bool makeParents, PropertyTable &revprops,
                       CommitCallback *callback)
 {
     SVN::Pool subPool(pool);
@@ -616,7 +616,7 @@ void SVNClient::doImport(const char *pat
                          CommitMessage *message, svn_depth_t depth,
                          bool noIgnore, bool noAutoProps,
                          bool ignoreUnknownNodeTypes,
-                         RevpropTable &revprops,
+                         PropertyTable &revprops,
                          ImportFilterCallback *ifCallback,
                          CommitCallback *commitCallback)
 {
@@ -905,7 +905,7 @@ void SVNClient::propertySetRemote(const 
                                   const char *name,
                                   CommitMessage *message,
                                   JNIByteArray &value, bool force,
-                                  RevpropTable &revprops,
+                                  PropertyTable &revprops,
                                   CommitCallback *callback)
 {
     SVN::Pool subPool(pool);

Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/SVNClient.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/SVNClient.h?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/SVNClient.h (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/SVNClient.h Thu Jul 11 16:00:50 2013
@@ -53,7 +53,7 @@ class PatchCallback;
 class ChangelistCallback;
 class CommitMessage;
 class StringArray;
-class RevpropTable;
+class PropertyTable;
 class DiffOptions;
 #include "svn_types.h"
 #include "svn_client.h"
@@ -87,7 +87,7 @@ class SVNClient :public SVNBase
   void propertySetRemote(const char *path, long base_rev, const char *name,
                          CommitMessage *message,
                          JNIByteArray &value, bool force,
-                         RevpropTable &revprops, CommitCallback *callback);
+                         PropertyTable &revprops, CommitCallback *callback);
   void properties(const char *path, Revision &revision,
                   Revision &pegRevision, svn_depth_t depth,
                   StringArray &changelists, ProplistCallback *callback);
@@ -115,7 +115,7 @@ class SVNClient :public SVNBase
   void doImport(const char *path, const char *url, CommitMessage *message,
                 svn_depth_t depth, bool noIgnore, bool noAutoProps,
                 bool ignoreUnknownNodeTypes,
-                RevpropTable &revprops, ImportFilterCallback *ifCallback,
+                PropertyTable &revprops, ImportFilterCallback *ifCallback,
                 CommitCallback *commitCallback);
   jlong doSwitch(const char *path, const char *url, Revision &revision,
                  Revision &pegRevision, svn_depth_t depth,
@@ -129,18 +129,18 @@ class SVNClient :public SVNBase
                svn_wc_conflict_choice_t choice);
   void cleanup(const char *path);
   void mkdir(Targets &targets, CommitMessage *message, bool makeParents,
-             RevpropTable &revprops, CommitCallback *callback);
+             PropertyTable &revprops, CommitCallback *callback);
   void move(Targets &srcPaths, const char *destPath,
             CommitMessage *message, bool force, bool moveAsChild,
             bool makeParents, bool metadataOnly, bool allowMixRev,
-            RevpropTable &revprops, CommitCallback *callback);
+            PropertyTable &revprops, CommitCallback *callback);
   void copy(CopySources &copySources, const char *destPath,
             CommitMessage *message, bool copyAsChild, bool makeParents,
-            bool ignoreExternals, RevpropTable &revprops,
+            bool ignoreExternals, PropertyTable &revprops,
             CommitCallback *callback);
   void commit(Targets &targets, CommitMessage *message, svn_depth_t depth,
               bool noUnlock, bool keepChangelist,
-              StringArray &changelists, RevpropTable &revprops,
+              StringArray &changelists, PropertyTable &revprops,
               CommitCallback *callback);
   jlongArray update(Targets &targets, Revision &revision, svn_depth_t depth,
                     bool depthIsSticky, bool makeParents, bool ignoreExternals,
@@ -149,7 +149,7 @@ class SVNClient :public SVNBase
            bool no_ignore, bool no_autoprops, bool add_parents);
   void revert(const char *path, svn_depth_t depth, StringArray &changelists);
   void remove(Targets &targets, CommitMessage *message, bool force,
-              bool keep_local, RevpropTable &revprops,
+              bool keep_local, PropertyTable &revprops,
               CommitCallback *callback);
   jlong checkout(const char *moduleName, const char *destPath,
                  Revision &revision, Revision &pegRevsion, svn_depth_t depth,

Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp Thu Jul 11 16:00:50 2013
@@ -50,7 +50,7 @@
 #include "ImportFilterCallback.h"
 #include "ChangelistCallback.h"
 #include "StringArray.h"
-#include "RevpropTable.h"
+#include "PropertyTable.h"
 #include "VersionExtended.h"
 #include "DiffOptions.h"
 #include "svn_version.h"
@@ -384,7 +384,7 @@ Java_org_apache_subversion_javahl_SVNCli
   if (JNIUtil::isExceptionThrown())
     return;
 
-  RevpropTable revprops(jrevpropTable);
+  PropertyTable revprops(jrevpropTable);
   if (JNIUtil::isExceptionThrown())
     return;
 
@@ -498,7 +498,7 @@ Java_org_apache_subversion_javahl_SVNCli
   if (JNIUtil::isExceptionThrown())
     return;
 
-  RevpropTable revprops(jrevpropTable);
+  PropertyTable revprops(jrevpropTable);
   if (JNIUtil::isExceptionThrown())
     return;
 
@@ -539,7 +539,7 @@ Java_org_apache_subversion_javahl_SVNCli
   if (JNIUtil::isExceptionThrown())
     return;
 
-  RevpropTable revprops(jrevpropTable);
+  PropertyTable revprops(jrevpropTable);
   if (JNIUtil::isExceptionThrown())
     return;
 
@@ -577,7 +577,7 @@ Java_org_apache_subversion_javahl_SVNCli
   if (JNIUtil::isExceptionThrown())
     return;
 
-  RevpropTable revprops(jrevpropTable);
+  PropertyTable revprops(jrevpropTable);
   if (JNIUtil::isExceptionThrown())
     return;
 
@@ -610,7 +610,7 @@ Java_org_apache_subversion_javahl_SVNCli
   if (JNIUtil::isExceptionThrown())
     return;
 
-  RevpropTable revprops(jrevpropTable);
+  PropertyTable revprops(jrevpropTable);
   if (JNIUtil::isExceptionThrown())
     return;
 
@@ -761,7 +761,7 @@ Java_org_apache_subversion_javahl_SVNCli
   if (JNIUtil::isExceptionThrown())
     return;
 
-  RevpropTable revprops(jrevpropTable);
+  PropertyTable revprops(jrevpropTable);
   if (JNIUtil::isExceptionThrown())
     return;
 
@@ -1012,7 +1012,7 @@ Java_org_apache_subversion_javahl_SVNCli
   if (JNIUtil::isExceptionThrown())
     return;
 
-  RevpropTable revprops(jrevpropTable);
+  PropertyTable revprops(jrevpropTable);
   if (JNIUtil::isExceptionThrown())
     return;
 

Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteFactory.java
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteFactory.java?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteFactory.java (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteFactory.java Thu Jul 11 16:00:50 2013
@@ -41,6 +41,14 @@ import java.util.HashSet;
 public class RemoteFactory
 {
     /**
+     * Load the required native library.
+     */
+    static
+    {
+        NativeResources.loadNativeLibrary();
+    }
+
+    /**
      * Default constructor.
      */
     public RemoteFactory() {}

Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Thu Jul 11 16:00:50 2013
@@ -3300,6 +3300,16 @@ public class BasicTests extends SVNTests
         }
     }
 
+    private static class CountingProgressListener implements ProgressCallback
+    {
+        public void onProgress(ProgressEvent event)
+        {
+            // TODO: Examine the byte counts from "event".
+            gotProgress = true;
+        }
+        public boolean gotProgress = false;
+    }
+
     public void testDataTransferProgressReport() throws Throwable
     {
         // ### FIXME: This isn't working over ra_local, because
@@ -3309,25 +3319,13 @@ public class BasicTests extends SVNTests
 
         // build the test setup
         OneTest thisTest = new OneTest();
-        ProgressCallback listener = new ProgressCallback()
-        {
-            public void onProgress(ProgressEvent event)
-            {
-                // TODO: Examine the byte counts from "event".
-                throw new RuntimeException("Progress reported as expected");
-            }
-        };
+        CountingProgressListener listener = new CountingProgressListener();
         client.setProgressCallback(listener);
 
         // Perform an update to exercise the progress notification.
-        try
-        {
-            update(thisTest);
+        update(thisTest);
+        if (!listener.gotProgress)
             fail("No progress reported");
-        }
-        catch (RuntimeException progressReported)
-        {
-        }
     }
 
     /**

Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java Thu Jul 11 16:00:50 2013
@@ -29,6 +29,7 @@ import org.apache.subversion.javahl.type
 
 import java.util.Arrays;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 import java.util.Set;
@@ -308,8 +309,20 @@ public class SVNRemoteTests extends SVNT
         }
         catch (ClientException ex)
         {
-            assertEquals("Disabled repository feature",
-                         ex.getAllMessages().get(0).getMessage());
+            ClientException.ErrorMessage error = null;
+            for (ClientException.ErrorMessage m : ex.getAllMessages())
+                if (!m.isGeneric()) {
+                    error = m;
+                    break;
+                }
+
+            if (error == null)
+                fail("Failed with no error message");
+
+            if (error.getCode() != 175002 && // SVN_ERR_RA_DAV_REQUEST_FAILED
+                error.getCode() != 165006)   // SVN_ERR_REPOS_DISABLED_FEATURE
+                fail(error.getMessage());
+
             return;
         }
 
@@ -351,8 +364,11 @@ public class SVNRemoteTests extends SVNT
         assertEquals(fetched_rev, 1);
         assertEquals(contents.toString("UTF-8"),
                      "This is the file 'lambda'.");
-        for (Map.Entry<String, byte[]> e : properties.entrySet())
-            assertTrue(e.getKey().startsWith("svn:entry:"));
+        for (Map.Entry<String, byte[]> e : properties.entrySet()) {
+            final String key = e.getKey();
+            assertTrue(key.startsWith("svn:entry:")
+                       || key.startsWith("svn:wc:"));
+        }
     }
 
     public void testGetDirectory() throws Exception
@@ -373,8 +389,11 @@ public class SVNRemoteTests extends SVNT
         assertEquals(dirents.get("E").getPath(), "E");
         assertEquals(dirents.get("F").getPath(), "F");
         assertEquals(dirents.get("lambda").getPath(), "lambda");
-        for (Map.Entry<String, byte[]> e : properties.entrySet())
-            assertTrue(e.getKey().startsWith("svn:entry:"));
+        for (Map.Entry<String, byte[]> e : properties.entrySet()) {
+            final String key = e.getKey();
+            assertTrue(key.startsWith("svn:entry:")
+                       || key.startsWith("svn:wc:"));
+        }
     }
 
     private final class CommitContext implements CommitCallback
@@ -574,19 +593,19 @@ public class SVNRemoteTests extends SVNT
         assertTrue(Arrays.equals(eolstyle, propval));
     }
 
-    public void testEditorSetFileProps() throws Exception
+    public void testEditorSetFileContents() throws Exception
     {
         Charset UTF8 = Charset.forName("UTF-8");
         ISVNRemote session = getSession();
 
-        byte[] eolstyle = "CRLF".getBytes(UTF8);
-        HashMap<String, byte[]> props = new HashMap<String, byte[]>();
-        props.put("svn:eol-style", eolstyle);
+        byte[] contents = "This is modified file 'alpha'.".getBytes(UTF8);
+        Checksum hash = new Checksum(SHA1(contents), Checksum.Kind.SHA1);
+        ByteArrayInputStream stream = new ByteArrayInputStream(contents);
 
         CommitContext cc =
-            new CommitContext(session, "Change eol-style on A/B/E/alpha");
+            new CommitContext(session, "Change contents of A/B/E/alpha");
         try {
-            cc.editor.alterFile("A/B/E/alpha", 1, null, null, props);
+            cc.editor.alterFile("A/B/E/alpha", 1, hash, stream, null);
             cc.editor.complete();
         } finally {
             cc.editor.dispose();
@@ -594,12 +613,10 @@ public class SVNRemoteTests extends SVNT
 
         assertEquals(2, cc.getRevision());
         assertEquals(2, session.getLatestRevision());
-        byte[] propval = client.propertyGet(session.getSessionUrl()
-                                            + "/A/B/E/alpha",
-                                            "svn:eol-style",
-                                            Revision.HEAD,
-                                            Revision.HEAD);
-        assertTrue(Arrays.equals(eolstyle, propval));
+        ByteArrayOutputStream checkcontents = new ByteArrayOutputStream();
+        client.streamFileContent(session.getSessionUrl() + "/A/B/E/alpha",
+                                 Revision.HEAD, Revision.HEAD, checkcontents);
+        assertTrue(Arrays.equals(contents, checkcontents.toByteArray()));
     }
 
     // public void testEditorRotate() throws Exception
@@ -787,7 +804,7 @@ public class SVNRemoteTests extends SVNT
 
     private static class RemoteStatusReceiver implements RemoteStatus
     {
-        static class StatInfo
+        static class StatInfo implements Comparable<StatInfo>
         {
             public String relpath = null;
             public char kind = ' '; // F, D, L
@@ -813,6 +830,18 @@ public class SVNRemoteTests extends SVNT
                 this.propsChanged = propsChanged;
                 this.info = info;
             }
+
+            @Override
+            public boolean equals(Object statinfo)
+            {
+                final StatInfo that = (StatInfo)statinfo;
+                return this.relpath.equals(that.relpath);
+            }
+
+            public int compareTo(StatInfo that)
+            {
+                return this.relpath.compareTo(that.relpath);
+            }
         }
 
         private boolean debug;
@@ -946,7 +975,11 @@ public class SVNRemoteTests extends SVNT
         } finally {
             rp.dispose();
         }
+
         assertEquals(4, receiver.status.size());
+
+        // ra_serf returns the entries in inverted order compared to ra_local.
+        Collections.sort(receiver.status);
         RemoteStatusReceiver.StatInfo mod = receiver.status.get(3);
         assertEquals("A/D/gamma", mod.relpath);
         assertEquals('F', mod.kind);
@@ -979,6 +1012,9 @@ public class SVNRemoteTests extends SVNT
             rp.dispose();
         }
         assertEquals(3, receiver.status.size());
+
+        // ra_serf returns the entries in inverted order compared to ra_local.
+        Collections.sort(receiver.status);
         RemoteStatusReceiver.StatInfo mod = receiver.status.get(2);
         assertEquals("A/mu", mod.relpath);
         assertEquals(' ', mod.kind);

Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java Thu Jul 11 16:00:50 2013
@@ -324,12 +324,12 @@ class SVNTests extends TestCase
 
         public boolean prompt(String realm, String username)
         {
-            return false;
+            return true;
         }
 
         public boolean prompt(String realm, String username, boolean maySave)
         {
-            return false;
+            return true;
         }
 
         public String askQuestion(String realm, String question,

Modified: subversion/branches/fsfs-improvements/subversion/bindings/swig/perl/native/Client.pm
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/swig/perl/native/Client.pm?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/swig/perl/native/Client.pm (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/swig/perl/native/Client.pm Thu Jul 11 16:00:50 2013
@@ -138,7 +138,7 @@ keywords) 'HEAD', 'BASE', 'COMMITTED', a
 meanings as in the command line client.  When referencing a working copy
 you can use the string 'WORKING" to reference the BASE plus any local
 modifications.  C<undef> may be used to specify an unspecified revision.
-You may alos pass a date by specifying the date inside curly braces
+You may also pass a date by specifying the date inside curly braces
 '{}'.  The date formats accepted are the same as the command line client
 accepts. Finally a C<_p_svn_opt_revision_t> object is accepted
 (which may have been returned by some Subversion function).

Modified: subversion/branches/fsfs-improvements/subversion/include/svn_config.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/svn_config.h?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/svn_config.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/svn_config.h Thu Jul 11 16:00:50 2013
@@ -96,7 +96,7 @@ typedef struct svn_config_t svn_config_t
 /** @since New in 1.8. */
 #define SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS      "http-max-connections"
 /** @since New in 1.9. */
-#define SVN_CONFIG_OPTION_BUSTED_PROXY              "busted-proxy"
+#define SVN_CONFIG_OPTION_HTTP_DETECT_CHUNKING      "http-detect-chunking"
 
 #define SVN_CONFIG_CATEGORY_CONFIG          "config"
 #define SVN_CONFIG_SECTION_AUTH                 "auth"
@@ -725,7 +725,7 @@ svn_config_write_auth_data(apr_hash_t *h
  */
 typedef svn_error_t *
 (*svn_config_auth_walk_func_t)(svn_boolean_t *delete_cred,
-                               void *cleanup_baton,
+                               void *walk_baton,
                                const char *cred_kind,
                                const char *realmstring,
                                apr_hash_t *hash,

Modified: subversion/branches/fsfs-improvements/subversion/include/svn_error_codes.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/svn_error_codes.h?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/svn_error_codes.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/svn_error_codes.h Thu Jul 11 16:00:50 2013
@@ -1512,7 +1512,10 @@ SVN_ERROR_START
              SVN_ERR_RA_SERF_CATEGORY_START + 2,
              "Initialization of the GSSAPI context failed")
 
-  /** @since New in 1.7. */
+  /** @since New in 1.7.
+   * @note When @c svn_error_t.apr_err is set to this,
+   * @c svn_error_t.child->apr_err is a serf error code, not a Subversion
+   * one! */
   SVN_ERRDEF(SVN_ERR_RA_SERF_WRAPPED_ERROR,
              SVN_ERR_RA_SERF_CATEGORY_START + 3,
              "While handling serf response:")

Modified: subversion/branches/fsfs-improvements/subversion/include/svn_string.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/svn_string.h?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/svn_string.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/svn_string.h Thu Jul 11 16:00:50 2013
@@ -232,6 +232,15 @@ svn_stringbuf_create_ensure(apr_size_t m
 svn_stringbuf_t *
 svn_stringbuf_create_from_string(const svn_string_t *str, apr_pool_t *pool);
 
+/** Create a new stringbuf using the given @a str as initial buffer.
+ * Allocate the result in @a pool.  In contrast to #svn_stringbuf_create,
+ * the contents of @a str may change when the stringbuf gets modified.
+ *
+ * @since New in 1.9
+ */
+svn_stringbuf_t *
+svn_stringbuf_create_wrap(char *str, apr_pool_t *pool);
+
 /** Create a new stringbuf by printf-style formatting using @a fmt and the
  * variable arguments, which are as appropriate for apr_psprintf().
  */

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_client/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_client/diff_local.c?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_client/diff_local.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_client/diff_local.c Thu Jul 11 16:00:50 2013
@@ -607,7 +607,10 @@ svn_client__arbitrary_nodes_diff(const c
   if (kind1 != kind2)
     return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
                              _("'%s' is not the same node kind as '%s'"),
-                             local_abspath1, local_abspath2);
+                             svn_dirent_local_style(local_abspath1,
+                                                    scratch_pool),
+                             svn_dirent_local_style(local_abspath2,
+                                                    scratch_pool));
 
   if (depth == svn_depth_unknown)
     depth = svn_depth_infinity;
@@ -627,7 +630,10 @@ svn_client__arbitrary_nodes_diff(const c
   else
     return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
                              _("'%s' is not a file or directory"),
-                             kind1 == svn_node_none ?
-                              local_abspath1 : local_abspath2);
+                             kind1 == svn_node_none
+                               ? svn_dirent_local_style(local_abspath1,
+                                                        scratch_pool)
+                               : svn_dirent_local_style(local_abspath2,
+                                                        scratch_pool));
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_client/switch.c?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_client/switch.c Thu Jul 11 16:00:50 2013
@@ -239,7 +239,7 @@ switch_internal(svn_revnum_t *result_rev
         return svn_error_createf(SVN_ERR_CLIENT_UNRELATED_RESOURCES, NULL,
                                  _("'%s' shares no common ancestry with '%s'"),
                                  switch_url,
-                                 svn_dirent_dirname(local_abspath, pool));
+                                 svn_dirent_local_style(local_abspath, pool));
     }
 
   wcroot_iprops = apr_hash_make(pool);

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_delta/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_delta/compat.c?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_delta/compat.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_delta/compat.c Thu Jul 11 16:00:50 2013
@@ -1634,11 +1634,14 @@ apply_change(void **dir_baton,
                                                        change->copyfrom_path,
                                                        scratch_pool);
           else
-            copyfrom_url = change->copyfrom_path;
+            {
+              copyfrom_url = change->copyfrom_path;
 
-          /* Make this an FS path by prepending "/" */
-          if (copyfrom_url[0] != '/')
-            copyfrom_url = apr_pstrcat(scratch_pool, "/", copyfrom_url, NULL);
+              /* Make this an FS path by prepending "/" */
+              if (copyfrom_url[0] != '/')
+                copyfrom_url = apr_pstrcat(scratch_pool, "/",
+                                           copyfrom_url, NULL);
+            }
 
           copyfrom_rev = change->copyfrom_rev;
         }

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c Thu Jul 11 16:00:50 2013
@@ -357,7 +357,28 @@ cache_lookup( fs_fs_dag_cache_t *cache
     }
 
   /* need to do a full lookup.  Calculate the hash value
-     (HASH_VALUE has been initialized to REVISION). */
+     (HASH_VALUE has been initialized to REVISION).
+
+     Note that the actual hash function is arbitrary as long as its result
+     in HASH_VALUE only depends on REVISION and *PATH.  However, we try to
+     make as much of *PATH influence the result as possible to get an "even"
+     spread across the hash buckets (maximizes our cache retention rate and
+     thus the hit rates).
+
+     When chunked access is possible (independent of the PATH pointer's
+     value!), we read 4 bytes at once and multiply the hash value with a
+     FACTOR that mirror / pattern / shift all 4 input bytes to various bits
+     of the result.  The final result will be taken from the MSBs.
+
+     When chunked access is not possible (not supported by CPU or odd bytes
+     at the end of *PATH), we use the simple traditional "* 33" hash
+     function that works very well with texts / paths and that e.g. APR uses.
+
+     Please note that the bytewise and the chunked calculation are *NOT*
+     interchangeable as they will yield different results for the same input.
+     For any given machine and *PATH, we must use a fixed combination of the
+     two functions.
+   */
   i = 0;
 #if SVN_UNALIGNED_ACCESS_IS_OK
   /* We relax the dependency chain between iterations by processing

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/ra_serf.h?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/ra_serf.h Thu Jul 11 16:00:50 2013
@@ -147,6 +147,10 @@ struct svn_ra_serf__session_t {
   /* Should we use Transfer-Encoding: chunked for HTTP/1.1 servers. */
   svn_boolean_t using_chunked_requests;
 
+  /* Do we need to detect whether the connection supports chunked requests?
+     i.e. is there a (reverse) proxy that does not support them?  */
+  svn_boolean_t detect_chunking;
+
   /* Our Version-Controlled-Configuration; may be NULL until we know it. */
   const char *vcc_url;
 
@@ -191,10 +195,6 @@ struct svn_ra_serf__session_t {
   /* Are we using a proxy? */
   svn_boolean_t using_proxy;
 
-  /* Should we be careful with this proxy? (some have insufficient support that
-     we need to work around).  */
-  svn_boolean_t busted_proxy;
-
   const char *proxy_username;
   const char *proxy_password;
   int proxy_auth_attempts;

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/serf.c?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/serf.c Thu Jul 11 16:00:50 2013
@@ -225,10 +225,11 @@ load_config(svn_ra_serf__session_t *sess
                                SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS,
                                SVN_CONFIG_DEFAULT_OPTION_HTTP_MAX_CONNECTIONS));
 
-  /* Is this proxy potentially busted? Do we need to take special care?  */
-  SVN_ERR(svn_config_get_bool(config, &session->busted_proxy,
+  /* Do we need to detect whether an intervening proxy does not support
+     chunked requests?  */
+  SVN_ERR(svn_config_get_bool(config, &session->detect_chunking,
                               SVN_CONFIG_SECTION_GLOBAL,
-                              SVN_CONFIG_OPTION_BUSTED_PROXY,
+                              SVN_CONFIG_OPTION_HTTP_DETECT_CHUNKING,
                               FALSE));
 
   if (config)
@@ -290,10 +291,10 @@ load_config(svn_ra_serf__session_t *sess
 
       /* Do we need to take care with this proxy?  */
       SVN_ERR(svn_config_get_bool(
-               config, &session->busted_proxy,
+               config, &session->detect_chunking,
                server_group,
-               SVN_CONFIG_OPTION_BUSTED_PROXY,
-               session->busted_proxy));
+               SVN_CONFIG_OPTION_HTTP_DETECT_CHUNKING,
+               session->detect_chunking));
     }
 
   /* Don't allow the http-max-connections value to be larger than our
@@ -506,11 +507,11 @@ svn_ra_serf__open(svn_ra_session_t *sess
   SVN_ERR(err);
 
   /* We have set up a useful connection (that doesn't indication a redirect).
-     If we've been told there is possibly a busted proxy in our path to the
+     If we've been told there is possibly a worrisome proxy in our path to the
      server AND we switched to HTTP/1.1 (chunked requests), then probe for
      problems in any proxy.  */
   if ((corrected_url == NULL || *corrected_url == NULL)
-      && serf_sess->busted_proxy && !serf_sess->http10)
+      && serf_sess->detect_chunking && !serf_sess->http10)
     SVN_ERR(svn_ra_serf__probe_proxy(serf_sess, pool));
 
   return SVN_NO_ERROR;

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/util.c?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/util.c Thu Jul 11 16:00:50 2013
@@ -1391,19 +1391,22 @@ inject_to_parser(svn_ra_serf__xml_parser
   int xml_status;
 
   xml_status = XML_Parse(ctx->xmlp, data, (int) len, 0);
-  if (xml_status == XML_STATUS_ERROR && !ctx->ignore_errors)
+
+  if (! ctx->ignore_errors)
     {
-      if (sl == NULL)
-        return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
-                                 _("XML parsing failed"));
+      SVN_ERR(ctx->error);
 
-      return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
-                               _("XML parsing failed: (%d %s)"),
-                               sl->code, sl->reason);
-    }
+      if (xml_status != XML_STATUS_OK)
+        {
+          if (sl == NULL)
+            return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
+                                     _("XML parsing failed"));
 
-  if (ctx->error && !ctx->ignore_errors)
-    return svn_error_trace(ctx->error);
+          return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
+                                   _("XML parsing failed: (%d %s)"),
+                                   sl->code, sl->reason);
+        }
+     }
 
   return SVN_NO_ERROR;
 }
@@ -1484,14 +1487,24 @@ svn_ra_serf__process_pending(svn_ra_serf
   if (pending_empty &&
       parser->pending->network_eof)
     {
+      int xml_status;
       SVN_ERR_ASSERT(parser->xmlp != NULL);
 
-      /* Tell the parser that no more content will be parsed. Ignore the
-         return status. We just don't care.  */
-      (void) XML_Parse(parser->xmlp, NULL, 0, 1);
+      /* Tell the parser that no more content will be parsed. */
+      xml_status = XML_Parse(parser->xmlp, NULL, 0, 1);
 
       apr_pool_cleanup_run(parser->pool, &parser->xmlp, xml_parser_cleanup);
       parser->xmlp = NULL;
+
+      if (! parser->ignore_errors)
+        {
+          SVN_ERR(parser->error);
+
+          if (xml_status != XML_STATUS_OK)
+            {
+            }
+        }
+
       add_done_item(parser);
     }
 
@@ -1706,12 +1719,25 @@ svn_ra_serf__handle_xml_parser(serf_requ
              in the PENDING structures, then we're completely done.  */
           if (!HAS_PENDING_DATA(ctx->pending))
             {
+              int xml_status;
               SVN_ERR_ASSERT(ctx->xmlp != NULL);
 
-              /* Ignore the return status. We just don't care.  */
-              (void) XML_Parse(ctx->xmlp, NULL, 0, 1);
+              xml_status = XML_Parse(ctx->xmlp, NULL, 0, 1);
 
               apr_pool_cleanup_run(ctx->pool, &ctx->xmlp, xml_parser_cleanup);
+
+              if (! ctx->ignore_errors)
+                {
+                  SVN_ERR(ctx->error);
+
+                  if (xml_status != XML_STATUS_OK)
+                    {
+                      return svn_error_create(
+                                    SVN_ERR_XML_MALFORMED, NULL,
+                                    _("The XML response contains invalid XML"));
+                    }
+                }
+
               add_done_item(ctx);
             }
 
@@ -2416,8 +2442,11 @@ svn_ra_serf__error_on_status(serf_status
 
       case 411:
         return svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
-                                _("DAV request failed: "
-                                  "Content length required"));
+                    _("DAV request failed: 411 Content length required. The "
+                      "server or an intermediate proxy does not accept "
+                      "chunked encoding. Try setting "
+                      "'http-detect-chunking=yes' "
+                      "in your client configuration."));
     }
 
   if (sline.code >= 300)

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/util_error.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/util_error.c?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/util_error.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_ra_serf/util_error.c Thu Jul 11 16:00:50 2013
@@ -96,5 +96,9 @@ svn_ra_serf__wrap_err(apr_status_t statu
         }
     }
 
+  /* Make the outer-most error code be a Subversion/APR one. */
+  if (serf_err_msg)
+    err = svn_error_create(SVN_ERR_RA_SERF_WRAPPED_ERROR, err, NULL);
+
   return err;
 }

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_subr/config_file.c?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_subr/config_file.c Thu Jul 11 16:00:50 2013
@@ -838,9 +838,14 @@ svn_config_ensure(const char *config_dir
         "###   http-max-connections       Maximum number of parallel server" NL
         "###                              connections to use for any given"  NL
         "###                              HTTP operation."                   NL
-        "###   busted-proxy               The proxy may have some protocol"  NL
-        "###                              issues that Subversion needs to"   NL
-        "###                              detect and work around."           NL
+        "###   http-detect-chunking       Detect if the connection supports" NL
+        "###                              chunked requests (which some proxies"
+                                                                             NL
+        "###                              do not support). This defaults to" NL
+        "###                              off since mod_dav_svn supports "   NL
+        "###                              chunked requests and the detection"
+                                                                             NL
+        "###                              may hurt performance."             NL
         "###   neon-debug-mask            Debug mask for Neon HTTP library"  NL
         "###   ssl-authority-files        List of files, each of a trusted CA"
                                                                              NL

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_subr/gpg_agent.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_subr/gpg_agent.c?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_subr/gpg_agent.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_subr/gpg_agent.c Thu Jul 11 16:00:50 2013
@@ -156,42 +156,28 @@ send_option(int sd, char *buf, size_t n,
   return (strncmp(buf, "OK", 2) == 0);
 }
 
-/* Implementation of svn_auth__password_get_t that retrieves the password
-   from gpg-agent */
+
+/* Locate a running GPG Agent, and return an open file descriptor
+ * for communication with the agent in *NEW_SD. If no running agent
+ * can be found, set *NEW_SD to -1. */
 static svn_error_t *
-password_get_gpg_agent(svn_boolean_t *done,
-                       const char **password,
-                       apr_hash_t *creds,
-                       const char *realmstring,
-                       const char *username,
-                       apr_hash_t *parameters,
-                       svn_boolean_t non_interactive,
-                       apr_pool_t *pool)
+find_running_gpg_agent(int *new_sd, apr_pool_t *pool)
 {
-  int sd;
+  char *buffer;
   char *gpg_agent_info = NULL;
+  const char *socket_name = NULL;
+  const char *request = NULL;
   const char *p = NULL;
   char *ep = NULL;
-  char *buffer;
-
-  apr_array_header_t *socket_details;
-  const char *request = NULL;
-  const char *cache_id = NULL;
-  struct sockaddr_un addr;
-  const char *tty_name;
-  const char *tty_type;
-  const char *lc_ctype;
-  const char *display;
-  const char *socket_name = NULL;
-  svn_checksum_t *digest = NULL;
-  char *password_prompt;
-  char *realm_prompt;
+  int sd;
 
-  *done = FALSE;
+  *new_sd = -1;
 
   gpg_agent_info = getenv("GPG_AGENT_INFO");
   if (gpg_agent_info != NULL)
     {
+      apr_array_header_t *socket_details;
+
       socket_details = svn_cstring_split(gpg_agent_info, ":", TRUE,
                                          pool);
       socket_name = APR_ARRAY_IDX(socket_details, 0, const char *);
@@ -201,6 +187,8 @@ password_get_gpg_agent(svn_boolean_t *do
 
   if (socket_name != NULL)
     {
+      struct sockaddr_un addr;
+
       addr.sun_family = AF_UNIX;
       strncpy(addr.sun_path, socket_name, sizeof(addr.sun_path) - 1);
       addr.sun_path[sizeof(addr.sun_path) - 1] = '\0';
@@ -273,6 +261,44 @@ password_get_gpg_agent(svn_boolean_t *do
       return SVN_NO_ERROR;
     }
 
+  *new_sd = sd;
+  return SVN_NO_ERROR;
+}
+
+/* Implementation of svn_auth__password_get_t that retrieves the password
+   from gpg-agent */
+static svn_error_t *
+password_get_gpg_agent(svn_boolean_t *done,
+                       const char **password,
+                       apr_hash_t *creds,
+                       const char *realmstring,
+                       const char *username,
+                       apr_hash_t *parameters,
+                       svn_boolean_t non_interactive,
+                       apr_pool_t *pool)
+{
+  int sd;
+  const char *p = NULL;
+  char *ep = NULL;
+  char *buffer;
+  const char *request = NULL;
+  const char *cache_id = NULL;
+  const char *tty_name;
+  const char *tty_type;
+  const char *lc_ctype;
+  const char *display;
+  svn_checksum_t *digest = NULL;
+  char *password_prompt;
+  char *realm_prompt;
+
+  *done = FALSE;
+
+  SVN_ERR(find_running_gpg_agent(&sd, pool));
+  if (sd == -1)
+    return SVN_NO_ERROR;
+
+  buffer = apr_palloc(pool, BUFFER_SIZE);
+
   /* Send TTY_NAME to the gpg-agent daemon. */
   tty_name = getenv("GPG_TTY");
   if (tty_name != NULL)
@@ -283,11 +309,6 @@ password_get_gpg_agent(svn_boolean_t *do
           return SVN_NO_ERROR;
         }
     }
-  else
-    {
-      close(sd);
-      return SVN_NO_ERROR;
-    }
 
   /* Send TTY_TYPE to the gpg-agent daemon. */
   tty_type = getenv("TERM");
@@ -299,11 +320,6 @@ password_get_gpg_agent(svn_boolean_t *do
           return SVN_NO_ERROR;
         }
     }
-  else
-    {
-      close(sd);
-      return SVN_NO_ERROR;
-    }
 
   /* Compute LC_CTYPE. */
   lc_ctype = getenv("LC_ALL");
@@ -388,8 +404,8 @@ password_get_gpg_agent(svn_boolean_t *do
    password in GPG Agent if that's how this particular integration
    worked.  But it isn't.  GPG Agent stores the password provided by
    the user via the pinentry program immediately upon its provision
-   (and regardless of its accuracy as passwords go), so there's
-   nothing really to do here.  */
+   (and regardless of its accuracy as passwords go), so we just need
+   to check if a running GPG Agent exists. */
 static svn_error_t *
 password_set_gpg_agent(svn_boolean_t *done,
                        apr_hash_t *creds,
@@ -400,6 +416,15 @@ password_set_gpg_agent(svn_boolean_t *do
                        svn_boolean_t non_interactive,
                        apr_pool_t *pool)
 {
+  int sd;
+
+  *done = FALSE;
+
+  SVN_ERR(find_running_gpg_agent(&sd, pool));
+  if (sd == -1)
+    return SVN_NO_ERROR;
+
+  close(sd);
   *done = TRUE;
 
   return SVN_NO_ERROR;

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_subr/io.c?rev=1502256&r1=1502255&r2=1502256&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_subr/io.c Thu Jul 11 16:00:50 2013
@@ -143,6 +143,26 @@
 #endif
 #endif
 
+#ifdef WIN32
+/* One-time initialization of the late bound Windows API functions. */
+static volatile svn_atomic_t win_dynamic_imports_state = 0;
+
+/* Pointer to GetFinalPathNameByHandleW function from kernel32.dll. */
+typedef DWORD (WINAPI *GETFINALPATHNAMEBYHANDLE)(
+               HANDLE hFile,
+               apr_wchar_t *lpszFilePath,
+               DWORD cchFilePath,
+               DWORD dwFlags);
+
+static GETFINALPATHNAMEBYHANDLE get_final_path_name_by_handle_proc = NULL;
+
+/* Forward declaration. */
+static svn_error_t * io_win_read_link(svn_string_t **dest,
+                                      const char *path,
+                                      apr_pool_t *pool);
+
+#endif
+
 /* Forward declaration */
 static apr_status_t
 dir_is_empty(const char *dir, apr_pool_t *pool);
@@ -664,7 +684,7 @@ svn_io_read_link(svn_string_t **dest,
                  const char *path,
                  apr_pool_t *pool)
 {
-#ifdef HAVE_READLINK
+#if defined(HAVE_READLINK)
   svn_string_t dest_apr;
   const char *path_apr;
   char buf[1025];
@@ -685,6 +705,8 @@ svn_io_read_link(svn_string_t **dest,
 
   /* ### Cast needed, one of these interfaces is wrong */
   return svn_utf_string_to_utf8((const svn_string_t **)dest, &dest_apr, pool);
+#elif defined(WIN32)
+  return io_win_read_link(dest, path, pool);
 #else
   return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
                           _("Symbolic links are not supported on this "
@@ -1701,6 +1723,46 @@ static apr_status_t io_utf8_to_unicode_p
             *t = L'\\';
     return APR_SUCCESS;
 }
+
+/* copy of the apr function unicode_to_utf8_path since apr doesn't export this
+ * one */
+static apr_status_t io_unicode_to_utf8_path(char* retstr, apr_size_t retlen,
+                                            const apr_wchar_t* srcstr)
+{
+    /* Skip the leading 4 characters if the path begins \\?\, or substitute
+     * // for the \\?\UNC\ path prefix, allocating the maximum string
+     * length based on the remaining string, plus the trailing null.
+     * then transform \\'s back into /'s since the \\?\ form never
+     * allows '/' path seperators, and APR always uses '/'s.
+     */
+    apr_size_t srcremains = wcslen(srcstr) + 1;
+    apr_status_t rv;
+    char *t = retstr;
+    if (srcstr[0] == L'\\' && srcstr[1] == L'\\' && 
+        srcstr[2] == L'?'  && srcstr[3] == L'\\') {
+        if (srcstr[4] == L'U' && srcstr[5] == L'N' && 
+            srcstr[6] == L'C' && srcstr[7] == L'\\') {
+            srcremains -= 8;
+            srcstr += 8;
+            retstr[0] = '\\';
+            retstr[1] = '\\';
+            retlen -= 2;
+            t += 2;
+        }
+        else {
+            srcremains -= 4;
+            srcstr += 4;
+        }
+    }
+        
+    if ((rv = apr_conv_ucs2_to_utf8(srcstr, &srcremains, t, &retlen))) {
+        return rv;
+    }
+    if (srcremains) {
+        return APR_ENAMETOOLONG;
+    }
+    return APR_SUCCESS;
+}
 #endif
 
 static apr_status_t io_win_file_attrs_set(const char *fname,
@@ -1760,6 +1822,83 @@ static apr_status_t io_win_file_attrs_se
     return APR_SUCCESS;
 }
 
+static svn_error_t *win_init_dynamic_imports(void *baton, apr_pool_t *pool)
+{
+    get_final_path_name_by_handle_proc = (GETFINALPATHNAMEBYHANDLE)
+      GetProcAddress(GetModuleHandleA("kernel32.dll"),
+                     "GetFinalPathNameByHandleW");
+
+    return SVN_NO_ERROR;
+}
+
+static svn_error_t * io_win_read_link(svn_string_t **dest,
+                                      const char *path,
+                                      apr_pool_t *pool)
+{
+#if APR_HAS_UNICODE_FS
+    SVN_ERR(svn_atomic__init_once(&win_dynamic_imports_state,
+                                  win_init_dynamic_imports, NULL, pool));
+
+    if (get_final_path_name_by_handle_proc)
+      {
+        DWORD rv;
+        apr_status_t status;
+        apr_file_t *file;
+        apr_os_file_t filehand;
+        apr_wchar_t wdest[APR_PATH_MAX];
+        char buf[APR_PATH_MAX];
+
+        /* reserve one char for terminating zero. */
+        DWORD wdest_len = sizeof(wdest)/sizeof(wdest[0]) - 1;
+
+        status = apr_file_open(&file, path, APR_OPENINFO, APR_OS_DEFAULT, pool);
+
+        if (status)
+          return svn_error_wrap_apr(status,
+                                    _("Can't read contents of link"));
+
+        apr_os_file_get(&filehand, file);
+
+        rv = get_final_path_name_by_handle_proc(
+               filehand, wdest, wdest_len,
+               FILE_NAME_NORMALIZED | VOLUME_NAME_DOS);
+
+        /* Save error code. */
+        status = apr_get_os_error();
+
+        /* Close file/directory handle in any case. */
+        apr_file_close(file);
+
+        /* GetFinaPathNameByHandleW returns number of characters copied to
+         * output buffer. Returns zero on error. Returns required buffer size
+         * if supplied buffer is not enough. */
+        if (rv > wdest_len || rv == 0)
+          {
+            return svn_error_wrap_apr(status,
+                                      _("Can't read contents of link"));
+          }
+
+        /* GetFinaPathNameByHandleW doesn't add terminating NUL. */
+        wdest[rv] = 0;
+
+        status = io_unicode_to_utf8_path(buf, sizeof(buf), wdest);
+        if (status)
+          return svn_error_wrap_apr(status,
+                                    _("Can't read contents of link"));
+
+        *dest = svn_string_create(buf, pool);
+
+        return SVN_NO_ERROR;
+      }
+    else
+#endif
+      {
+        return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                                _("Symbolic links are not supported on this "
+                                "platform"));
+      }
+}
+
 #endif
 
 svn_error_t *