subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1558485 [1/4] - in /subversion/branches/fsfs-ucsnorm: ./ subversion/bindings/javahl/native/ subversion/bindings/javahl/native/jniwrapper/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversion/bindings/javahl/tests/org/apa...
Date Wed, 15 Jan 2014 17:47:24 GMT
Author: brane
Date: Wed Jan 15 17:47:23 2014
New Revision: 1558485

URL: http://svn.apache.org/r1558485
Log:
On the fsfs-ucsnorm branch: Sync with trunk to r1558483.

Added:
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/get_file.c
      - copied unchanged from r1558483, subversion/trunk/subversion/libsvn_ra_serf/get_file.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/stat.c
      - copied unchanged from r1558483, subversion/trunk/subversion/libsvn_ra_serf/stat.c
Removed:
    subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/org_apache_subversion_javahl_NativeResources.cpp
Modified:
    subversion/branches/fsfs-ucsnorm/   (props changed)
    subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/JNIUtil.cpp
    subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/JNIUtil.h
    subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/Prompter.cpp
    subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/Prompter.h
    subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/RemoteSession.cpp
    subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/SVNClient.cpp
    subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/StateReporter.cpp
    subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp
    subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java
    subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java
    subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_sqlite.h
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_client/copy.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_client/repos_diff.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/tree.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/   (props changed)
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/tree.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/blame.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/commit.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/eagain_bucket.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/get_deleted_rev.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/getdate.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/getlocations.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/getlocationsegments.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/inherited_props.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/log.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/merge.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/mergeinfo.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/options.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/property.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/replay.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/serf.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/update.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/util.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/xml.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/log.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/sqlite.c
    subversion/branches/fsfs-ucsnorm/subversion/mod_dav_svn/reports/update.c
    subversion/branches/fsfs-ucsnorm/subversion/mod_dav_svn/repos.c
    subversion/branches/fsfs-ucsnorm/subversion/mod_dav_svn/version.c
    subversion/branches/fsfs-ucsnorm/subversion/svnrdump/dump_editor.c
    subversion/branches/fsfs-ucsnorm/subversion/svnserve/logger.c
    subversion/branches/fsfs-ucsnorm/subversion/svnserve/serve.c
    subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/prop_tests.py
    subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_fs/fs-test.c
    subversion/branches/fsfs-ucsnorm/subversion/tests/svn_test_main.c

Propchange: subversion/branches/fsfs-ucsnorm/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1556764-1558483

Modified: subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/JNIUtil.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/JNIUtil.cpp?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/JNIUtil.cpp (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/JNIUtil.cpp Wed Jan 15 17:47:23 2014
@@ -73,8 +73,6 @@ JNIMutex *JNIUtil::g_finalizedObjectsMut
 JNIMutex *JNIUtil::g_logMutex = NULL;
 JNIMutex *JNIUtil::g_configMutex = NULL;
 bool JNIUtil::g_initException;
-bool JNIUtil::g_inInit;
-JNIEnv *JNIUtil::g_initEnv;
 int JNIUtil::g_logLevel = JNIUtil::noLog;
 std::ofstream JNIUtil::g_logStream;
 
@@ -113,109 +111,19 @@ bool JNIUtil::JNIInit(JNIEnv *env)
   return true;
 }
 
-namespace
+/* Forwarder for calling JNIGlobalInit from JNI_OnLoad(). */
+bool initialize_jni_util(JNIEnv *env)
 {
-struct GlobalInitGuard
-{
-  enum InitState
-    {
-      state_null,
-      state_init,
-      state_done,
-      state_error
-    };
-
-  GlobalInitGuard()
-    : m_finished(false),
-      m_state(InitState(svn_atomic_cas(&m_global_state,
-                                       state_init, state_null)))
-    {
-      switch (m_state)
-        {
-        case state_null:
-          // This thread won the initialization contest.
-          break;
-
-        case state_done:
-          // The library is already initialized.
-          break;
-
-        case state_init:
-          // Another thread is currently initializing the
-          // library. Spin and wait for it to finish, with exponential
-          // backoff, but no longer than half a second.
-          for (unsigned shift = 0;
-               m_state == state_init && shift < 8;
-               ++shift)
-            {
-              apr_sleep((APR_USEC_PER_SEC / 1000) << shift);
-              m_state = InitState(svn_atomic_cas(&m_global_state,
-                                                 state_null, state_null));
-            }
-          if (m_state == state_init)
-            // The initialization didn't complete in half a second,
-            // which probably implies a thread crash or a deadlock.
-            m_state = state_error;
-          break;
-
-        default:
-          // Error state, or unknown state. In any case, do not continue.
-          m_state = state_error;
-        }
-    }
-
-  ~GlobalInitGuard()
-    {
-      // Signal the end of the library intialization if we're the
-      // initializing thread.
-      if (m_finished && m_state == state_null)
-        {
-          SVN_ERR_ASSERT_NO_RETURN(
-              state_init == svn_atomic_cas(&m_global_state,
-                                           state_done, state_init));
-        }
-    }
-
-  bool done() const
-    {
-      return (m_state == state_done);
-    }
-
-  bool error() const
-    {
-      return (m_state == state_error);
-    }
-
-  void finish()
-    {
-      m_finished = true;
-    }
-
-private:
-  bool m_finished;
-  InitState m_state;
-  static volatile svn_atomic_t m_global_state;
-};
-volatile svn_atomic_t
-GlobalInitGuard::m_global_state = GlobalInitGuard::state_null;
-} // anonymous namespace
+  return JNIUtil::JNIGlobalInit(env);
+}
 
 /**
  * Initialize the environment for all requests.
+ * This method must be called in a single-threaded context.
  * @param env   the JNI environment for this request
  */
 bool JNIUtil::JNIGlobalInit(JNIEnv *env)
 {
-  // This method has to be run only once during the run a program.
-  GlobalInitGuard guard;
-  if (guard.done())
-    return true;
-  else if (guard.error())
-    return false;
-
-  g_inInit = true;
-  g_initEnv = env;
-
   svn_error_t *err;
 
   /* This has to happen before any pools are created. */
@@ -242,8 +150,19 @@ bool JNIUtil::JNIGlobalInit(JNIEnv *env)
     }
 
   svn_utf_initialize2(FALSE, g_pool); /* Optimize character conversions */
-  svn_fs_initialize(g_pool); /* Avoid some theoretical issues */
-  svn_ra_initialize(g_pool);
+
+  // Initialize the libraries we use
+  err = svn_fs_initialize(g_pool);
+  if (!err)
+    err = svn_ra_initialize(g_pool);
+  if (err)
+    {
+      if (stderr && err->message)
+        fprintf(stderr, "%s", err->message);
+
+      svn_error_clear(err);
+      return FALSE;
+    }
 
   /* We shouldn't fill the JVMs memory with FS cache data unless
      explictly requested. And we don't either, because the caches get
@@ -325,10 +244,6 @@ bool JNIUtil::JNIGlobalInit(JNIEnv *env)
   if (isExceptionThrown())
     return false;
 
-  g_initEnv = NULL;
-  g_inInit = false;
-
-  guard.finish();
   return true;
 }
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/JNIUtil.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/JNIUtil.h?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/JNIUtil.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/JNIUtil.h Wed Jan 15 17:47:23 2014
@@ -147,7 +147,6 @@ class JNIUtil
     }
 
   static apr_pool_t *getPool();
-  static bool JNIGlobalInit(JNIEnv *env);
   static bool JNIInit(JNIEnv *env);
   static bool initializeJNIRuntime();
   enum { noLog, errorLog, exceptionLog, entryLog } LogLevel;
@@ -158,6 +157,9 @@ class JNIUtil
   static JNIMutex *g_configMutex;
 
  private:
+  friend bool initialize_jni_util(JNIEnv *env);
+  static bool JNIGlobalInit(JNIEnv *env);
+
   static void wrappedHandleSVNError(svn_error_t *err, jthrowable jcause);
   static void putErrorsInTrace(svn_error_t *err,
                                std::vector<jobject> &stackTrace);
@@ -194,17 +196,6 @@ class JNIUtil
   static bool g_initException;
 
   /**
-   * Flag, that one thread is in the init code.  Cannot use mutex
-   * here since apr is not initialized yet.
-   */
-  static bool g_inInit;
-
-  /**
-   * The JNI environment used during initialization.
-   */
-  static JNIEnv *g_initEnv;
-
-  /**
    * The stream to write log messages to.
    */
   static std::ofstream g_logStream;

Modified: subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/Prompter.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/Prompter.cpp?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/Prompter.cpp (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/Prompter.cpp Wed Jan 15 17:47:23 2014
@@ -94,6 +94,11 @@ Prompter *Prompter::makeCPrompter(jobjec
   return new Prompter(myPrompt);
 }
 
+Prompter *Prompter::makeCPrompter(const Prompter& prompter)
+{
+  return makeCPrompter(prompter.m_prompter);
+}
+
 /**
  * Retrieve the username from the Java object
  * @return Java string for the username or NULL

Modified: subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/Prompter.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/Prompter.h?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/Prompter.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/Prompter.h Wed Jan 15 17:47:23 2014
@@ -55,6 +55,8 @@ class Prompter
   bool m_maySave;
 
   Prompter(jobject jprompter);
+  Prompter(const Prompter&) {}
+
   bool prompt(const char *realm, const char *pi_username, bool maySave);
   bool askYesNo(const char *realm, const char *question, bool yesIsDefault);
   const char *askQuestion(const char *realm, const char *question,
@@ -95,6 +97,7 @@ class Prompter
      apr_pool_t *pool);
  public:
   static Prompter *makeCPrompter(jobject jprompter);
+  static Prompter *makeCPrompter(const Prompter& prompter);
   ~Prompter();
   svn_auth_provider_object_t *getProviderUsername(SVN::Pool &in_pool);
   svn_auth_provider_object_t *getProviderSimple(SVN::Pool &in_pool);

Modified: subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/RemoteSession.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/RemoteSession.cpp?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/RemoteSession.cpp (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/RemoteSession.cpp Wed Jan 15 17:47:23 2014
@@ -129,16 +129,6 @@ RemoteSession::open(jint jretryAttempts,
                     Prompter*& prompter, jobject jprogress,
                     jobject jcfgcb, jobject jtunnelcb)
 {
-  /*
-   * Initialize ra layer if we have not done so yet
-   */
-  static bool initialized = false;
-  if (!initialized)
-    {
-      SVN_JNI_ERR(svn_ra_initialize(JNIUtil::getPool()), NULL);
-      initialized = true;
-    }
-
   RemoteSession* session = new RemoteSession(
       jretryAttempts, url, uuid, configDirectory,
       usernameStr, passwordStr, prompter, jcfgcb, jtunnelcb);

Modified: subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/SVNClient.cpp?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/SVNClient.cpp Wed Jan 15 17:47:23 2014
@@ -1510,7 +1510,7 @@ SVNClient::openRemoteSession(const char*
 
     /* Decouple the RemoteSession's context from SVNClient's context
        by creating a copy of the prompter here. */
-    Prompter* prompter = new Prompter(context.getPrompter());
+    Prompter* prompter = Prompter::makeCPrompter(context.getPrompter());
     if (!prompter)
       return NULL;
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/StateReporter.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/StateReporter.cpp?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/StateReporter.cpp (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/StateReporter.cpp Wed Jan 15 17:47:23 2014
@@ -160,6 +160,7 @@ StateReporter::finishReport()
   SVN_JNI_ERR(m_raw_reporter->finish_report(m_report_baton,
                                             subPool.getPool()),
               SVN_INVALID_REVNUM);
+  m_valid = false;
   return jlong(m_target_revision);
 }
 
@@ -173,6 +174,7 @@ StateReporter::abortReport()
   SVN::Pool subPool(pool);
   SVN_JNI_ERR(m_raw_reporter->abort_report(m_report_baton,
                                            subPool.getPool()),);
+  m_valid = false;
 }
 
 void

Modified: subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp Wed Jan 15 17:47:23 2014
@@ -33,6 +33,7 @@
 #include "jni_stack.hpp"
 
 #include "../JNIUtil.h"
+bool initialize_jni_util(JNIEnv *env);
 
 // Global library initializaiton
 
@@ -45,6 +46,7 @@ JNIEXPORT jint JNICALL
 JNI_OnLoad(JavaVM* jvm, void*)
 {
   ::Java::Env::static_init(jvm);
+  const ::Java::Env env;
 
   const apr_status_t status = apr_initialize();
   if (!status)
@@ -55,9 +57,16 @@ JNI_OnLoad(JavaVM* jvm, void*)
       std::strcpy(buf, "Could not initialize APR: ");
       const std::size_t offset = std::strlen(buf);
       apr_strerror(status, buf + offset, sizeof(buf) - offset - 1);
-      const ::Java::Env env;
       env.ThrowNew(env.FindClass("java/lang/Error"), buf);
     }
+
+  // Initialize the old-style JavaHL infrastructure.
+  if (!initialize_jni_util(env.get()) && !env.ExceptionCheck())
+    {
+      env.ThrowNew(env.FindClass("java/lang/LinkageError"),
+                   "Native library initialization failed");
+    }
+
   return JNI_VERSION_1_2;
 }
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java Wed Jan 15 17:47:23 2014
@@ -141,9 +141,6 @@ public class NativeResources
      */
     private static final void init()
     {
-        if (!initNativeLibrary())
-            throw new LinkageError("Native library initialization failed");
-
         version = new Version();
         if (!version.isAtLeast(1, 9, 0))
         {
@@ -161,9 +158,4 @@ public class NativeResources
                 " but the run-time version is " + runtimeVersion);
         }
     }
-
-    /**
-     * Initialize the native library layer.
-     */
-    private static native boolean initNativeLibrary();
 }

Modified: subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java Wed Jan 15 17:47:23 2014
@@ -1141,6 +1141,7 @@ public class SVNRemoteTests extends SVNT
             rp.dispose();
         }
         assertEquals(21, receiver.status.size());
+        session.checkPath("", Revision.SVN_INVALID_REVNUM);
     }
 
     public void testTextchangeStatus() throws Exception
@@ -1356,4 +1357,43 @@ public class SVNRemoteTests extends SVNT
         assertEquals("/iota", rev.getPath());
         assertFalse(rev.isResultOfMerge());
     }
+
+    // This test is a result of a threading bug that was identified in
+    // serf-1.3.2 and earlier. The net result was that opening two RA
+    // sessions to an https:// URL in two parallel threads would cause
+    // a crash in serf, due to the OpenSSL library not being
+    // initialized in a single-threaded context.
+    //
+    // The problem does not appear to exist with other RA methods, but
+    // the test is here just in case someone is actually pedantic
+    // enough to test JavaHL with an HTTPS setup.
+    public void testParallelOpen() throws Exception
+    {
+        final Runnable runnable = new Runnable() {
+                @Override
+                public void run() {
+                    ISVNRemote session = null;
+                    try {
+                        session = getSession();
+                        assertEquals(1, session.getLatestRevision());
+                    }
+                    catch (ClientException ex) {
+                        throw new RuntimeException(ex);
+                    }
+                    finally {
+                        if (session != null)
+                            session.dispose();
+                    }
+                }
+            };
+
+        Thread thread1 = new Thread(runnable);
+        Thread thread2 = new Thread(runnable);
+
+        thread1.start();
+        thread2.start();
+
+        thread1.join();
+        thread2.join();
+    }
 }

Modified: subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_sqlite.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_sqlite.h?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_sqlite.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_sqlite.h Wed Jan 15 17:47:23 2014
@@ -345,6 +345,11 @@ svn_sqlite__column_is_null(svn_sqlite__s
 int
 svn_sqlite__column_bytes(svn_sqlite__stmt_t *stmt, int column);
 
+/* When Subversion is compiled in maintainer mode: enables the sqlite error
+   logging to stderr. */
+void
+svn_sqlite__dbg_enable_errorlog(void);
+
 
 /* --------------------------------------------------------------------- */
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_client/copy.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_client/copy.c Wed Jan 15 17:47:23 2014
@@ -1253,6 +1253,7 @@ wc_to_repos_copy(const apr_array_header_
   apr_hash_t *commit_revprops;
   svn_client__copy_pair_t *first_pair;
   apr_pool_t *session_pool = svn_pool_create(scratch_pool);
+  apr_array_header_t *commit_items_for_dav;
   int i;
 
   /* Find the common root of all the source paths */
@@ -1287,9 +1288,13 @@ wc_to_repos_copy(const apr_array_header_
 
   SVN_ERR(svn_dirent_get_absolute(&top_src_abspath, top_src_path, scratch_pool));
 
+  commit_items_for_dav = apr_array_make(session_pool, 0,
+                                        sizeof(svn_client_commit_item3_t*));
+
   /* Open a session to help while determining the exact targets */
   SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, top_dst_url,
-                                               top_src_abspath, NULL,
+                                               top_src_abspath,
+                                               commit_items_for_dav,
                                                FALSE /* write_dav_props */,
                                                TRUE /* read_dav_props */,
                                                ctx,
@@ -1471,6 +1476,10 @@ wc_to_repos_copy(const apr_array_header_
   SVN_ERR(svn_client__condense_commit_items(&top_dst_url,
                                             commit_items, scratch_pool));
 
+  /* Add the commit items to the DAV commit item list to provide access
+     to dav properties (for pre http-v2 DAV) */
+  apr_array_cat(commit_items_for_dav, commit_items);
+
 #ifdef ENABLE_EV2_SHIMS
   if (commit_items)
     {
@@ -1515,7 +1524,7 @@ wc_to_repos_copy(const apr_array_header_
   /* Perform the commit. */
   SVN_ERR_W(svn_client__do_commit(top_dst_url, commit_items,
                                   editor, edit_baton,
-                                  0, /* ### any notify_path_offset needed? */
+                                  NULL /* notify_path_prefix */,
                                   NULL, ctx, session_pool, session_pool),
             _("Commit failed (details follow):"));
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_client/repos_diff.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_client/repos_diff.c Wed Jan 15 17:47:23 2014
@@ -1365,6 +1365,7 @@ svn_client__get_diff_editor2(const svn_d
   eb->ra_session = ra_session;
 
   eb->revision = revision;
+  eb->target_revision = SVN_INVALID_REVNUM;
   eb->empty_file = NULL;
   eb->empty_hash = apr_hash_make(eb->pool);
   eb->text_deltas = text_deltas;

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/tree.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/tree.c Wed Jan 15 17:47:23 2014
@@ -1743,6 +1743,53 @@ conflict_err(svn_stringbuf_t *conflict_p
                            _("Conflict at '%s'"), path);
 }
 
+/* Compare the directory representations at nodes LHS and RHS and set
+ * *CHANGED to TRUE, if at least one entry has been added or removed them.
+ * Use POOL for temporary allocations.
+ */
+static svn_error_t *
+compare_dir_structure(svn_boolean_t *changed,
+                      dag_node_t *lhs,
+                      dag_node_t *rhs,
+                      apr_pool_t *pool)
+{
+  apr_array_header_t *lhs_entries;
+  apr_array_header_t *rhs_entries;
+  int i;
+
+  SVN_ERR(svn_fs_fs__dag_dir_entries(&lhs_entries, lhs, pool));
+  SVN_ERR(svn_fs_fs__dag_dir_entries(&rhs_entries, rhs, pool));
+
+  /* different number of entries -> some addition / removal */
+  if (lhs_entries->nelts != rhs_entries->nelts)
+    {
+      *changed = TRUE;
+      return SVN_NO_ERROR;
+    }
+
+  /* Since directories are sorted by name, we can simply compare their
+     entries one-by-one without binary lookup etc. */
+  for (i = 0; i < lhs_entries->nelts; ++i)
+    {
+      svn_fs_dirent_t *lhs_entry
+        = APR_ARRAY_IDX(lhs_entries, i, svn_fs_dirent_t *);
+      svn_fs_dirent_t *rhs_entry
+        = APR_ARRAY_IDX(rhs_entries, i, svn_fs_dirent_t *);
+
+      if (strcmp(lhs_entry->name, rhs_entry->name)
+          || !svn_fs_fs__id_part_eq(svn_fs_fs__id_node_id(lhs_entry->id),
+                                    svn_fs_fs__id_node_id(rhs_entry->id))
+          || !svn_fs_fs__id_part_eq(svn_fs_fs__id_copy_id(lhs_entry->id),
+                                    svn_fs_fs__id_copy_id(rhs_entry->id)))
+        {
+          *changed = TRUE;
+          return SVN_NO_ERROR;
+        }
+    }
+
+  *changed = FALSE;
+  return SVN_NO_ERROR;
+}
 
 /* Merge changes between ANCESTOR and SOURCE into TARGET.  ANCESTOR
  * and TARGET must be distinct node revisions.  TARGET_PATH should
@@ -1917,10 +1964,23 @@ merge(svn_stringbuf_t *conflict_p,
        it doesn't do a brute-force comparison on textual contents, so
        it won't do that here either.  Checking to see if the propkey
        atoms are `equal' is enough. */
-    if (! svn_fs_fs__noderev_same_rep_key(tgt_nr->prop_rep, anc_nr->prop_rep))
-      return conflict_err(conflict_p, target_path);
     if (! svn_fs_fs__noderev_same_rep_key(src_nr->prop_rep, anc_nr->prop_rep))
       return conflict_err(conflict_p, target_path);
+
+    /* The directory entries got changed in the repository but the directory
+       properties did not. */
+    if (! svn_fs_fs__noderev_same_rep_key(tgt_nr->prop_rep, anc_nr->prop_rep))
+      {
+        /* There is an incoming prop change for this directory.
+           We will accept it only if the directory changes were mere updates
+           to its entries, i.e. there were no additions or removals.
+           Those could cause update problems to the working copy. */
+        svn_boolean_t changed;
+        SVN_ERR(compare_dir_structure(&changed, source, ancestor, pool));
+
+        if (changed)
+          return conflict_err(conflict_p, target_path);
+      }
   }
 
   /* ### todo: it would be more efficient to simply check for a NULL

Propchange: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
  Merged /subversion/trunk/subversion/libsvn_fs_x:r1556764-1558483

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/tree.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/tree.c Wed Jan 15 17:47:23 2014
@@ -1630,6 +1630,56 @@ conflict_err(svn_stringbuf_t *conflict_p
                            _("Conflict at '%s'"), path);
 }
 
+/* Compare the directory representations at nodes LHS and RHS and set
+ * *CHANGED to TRUE, if at least one entry has been added or removed them.
+ * Use POOL for temporary allocations.
+ */
+static svn_error_t *
+compare_dir_structure(svn_boolean_t *changed,
+                      dag_node_t *lhs,
+                      dag_node_t *rhs,
+                      apr_pool_t *pool)
+{
+  apr_hash_t *lhs_entries;
+  apr_hash_t *rhs_entries;
+  apr_hash_index_t *hi;
+
+  SVN_ERR(svn_fs_x__dag_dir_entries(&lhs_entries, lhs, pool));
+  SVN_ERR(svn_fs_x__dag_dir_entries(&rhs_entries, rhs, pool));
+
+  /* different number of entries -> some addition / removal */
+  if (apr_hash_count(lhs_entries) != apr_hash_count(rhs_entries))
+    {
+      *changed = TRUE;
+      return SVN_NO_ERROR;
+    }
+
+  /* Since the number of dirents is the same, we simply need to do a 
+     one-sided comparison. */
+  for (hi = apr_hash_first(pool, lhs_entries); hi; hi = apr_hash_next(hi))
+    {
+      svn_fs_dirent_t *lhs_entry;
+      svn_fs_dirent_t *rhs_entry;
+      const char *name;
+      apr_ssize_t klen;
+
+      apr_hash_this(hi, (const void **)&name, &klen, (void **)&lhs_entry);
+      rhs_entry = apr_hash_get(rhs_entries, name, klen);
+
+      if (!rhs_entry
+          || !svn_fs_x__id_part_eq(svn_fs_x__id_node_id(lhs_entry->id),
+                                   svn_fs_x__id_node_id(rhs_entry->id))
+          || !svn_fs_x__id_part_eq(svn_fs_x__id_copy_id(lhs_entry->id),
+                                   svn_fs_x__id_copy_id(rhs_entry->id)))
+        {
+          *changed = TRUE;
+          return SVN_NO_ERROR;
+        }
+    }
+
+  *changed = FALSE;
+  return SVN_NO_ERROR;
+}
 
 /* Merge changes between ANCESTOR and SOURCE into TARGET.  ANCESTOR
  * and TARGET must be distinct node revisions.  TARGET_PATH should
@@ -1803,10 +1853,23 @@ merge(svn_stringbuf_t *conflict_p,
        it doesn't do a brute-force comparison on textual contents, so
        it won't do that here either.  Checking to see if the propkey
        atoms are `equal' is enough. */
-    if (! svn_fs_x__noderev_same_rep_key(tgt_nr->prop_rep, anc_nr->prop_rep))
-      return conflict_err(conflict_p, target_path);
     if (! svn_fs_x__noderev_same_rep_key(src_nr->prop_rep, anc_nr->prop_rep))
       return conflict_err(conflict_p, target_path);
+
+    /* The directory entries got changed in the repository but the directory
+       properties did not. */
+    if (! svn_fs_x__noderev_same_rep_key(tgt_nr->prop_rep, anc_nr->prop_rep))
+      {
+        /* There is an incoming prop change for this directory.
+           We will accept it only if the directory changes were mere updates
+           to its entries, i.e. there were no additions or removals.
+           Those could cause update problems to the working copy. */
+        svn_boolean_t changed;
+        SVN_ERR(compare_dir_structure(&changed, source, ancestor, pool));
+
+        if (changed)
+          return conflict_err(conflict_p, target_path);
+      }
   }
 
   /* ### todo: it would be more efficient to simply check for a NULL

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/blame.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/blame.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/blame.c Wed Jan 15 17:47:23 2014
@@ -138,17 +138,20 @@ blame_opened(svn_ra_serf__xml_estate_t *
       apr_pool_t *state_pool = svn_ra_serf__xml_state_pool(xes);
       apr_hash_t *gathered = svn_ra_serf__xml_gather_since(xes, FILE_REV);
       const char *path;
-      const char *rev;
+      const char *rev_str;
       const char *merged_revision;
       svn_txdelta_window_handler_t txdelta;
       void *txdelta_baton;
+      apr_int64_t rev;
 
       path = svn_hash_gets(gathered, "path");
-      rev = svn_hash_gets(gathered, "rev");
+      rev_str = svn_hash_gets(gathered, "rev");
+
+      SVN_ERR(svn_cstring_atoi64(&rev, rev_str));
       merged_revision = svn_hash_gets(gathered, "merged-revision");
 
       SVN_ERR(blame_ctx->file_rev(blame_ctx->file_rev_baton,
-                                  path, SVN_STR_TO_REV(rev),
+                                  path, (svn_revnum_t)rev,
                                   blame_ctx->rev_props,
                                   merged_revision != NULL,
                                   &txdelta, &txdelta_baton,
@@ -370,8 +373,8 @@ svn_ra_serf__get_file_revs(svn_ra_sessio
 
   SVN_ERR(svn_ra_serf__context_run_one(handler, pool));
 
-  return svn_error_trace(
-            svn_ra_serf__error_on_status(handler->sline,
-                                         handler->path,
-                                         handler->location));
+  if (handler->sline.code != 200)
+    return svn_error_trace(svn_ra_serf__unexpected_status(handler));
+
+  return SVN_NO_ERROR;
 }

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/commit.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/commit.c Wed Jan 15 17:47:23 2014
@@ -275,7 +275,7 @@ checkout_node(const char **working_url,
   handler->body_type = "text/xml";
 
   handler->response_handler = svn_ra_serf__expect_empty_body;
-  handler->response_baton = &handler;
+  handler->response_baton = handler;
 
   handler->method = "CHECKOUT";
   handler->path = node_url;
@@ -1712,7 +1712,6 @@ change_dir_prop(void *dir_baton,
       proppatch_target = dir->working_url;
     }
 
-  name = apr_pstrdup(dir->pool, name);
   if (strncmp(name, SVN_PROP_PREFIX, sizeof(SVN_PROP_PREFIX) - 1) == 0)
     {
       ns = SVN_DAV_PROP_NS_SVN;
@@ -1725,13 +1724,12 @@ change_dir_prop(void *dir_baton,
 
   if (value)
     {
-      value = svn_string_dup(value, dir->pool);
       svn_ra_serf__set_prop(dir->changed_props, proppatch_target,
                             ns, name, value, dir->pool);
     }
   else
     {
-      value = svn_string_create_empty(dir->pool);
+      value = svn_string_create_empty(pool);
       svn_ra_serf__set_prop(dir->removed_props, proppatch_target,
                             ns, name, value, dir->pool);
     }
@@ -1820,7 +1818,7 @@ add_file(const char *path,
   else
     {
       /* Ensure our parent directory has been checked out */
-      SVN_ERR(checkout_dir(dir, new_file->pool /* scratch_pool */));
+      SVN_ERR(checkout_dir(dir, scratch_pool));
 
       new_file->url =
         svn_path_url_add_component2(dir->working_url,
@@ -1841,7 +1839,6 @@ add_file(const char *path,
       svn_ra_serf__handler_t *handler;
       apr_uri_t uri;
       const char *req_url;
-      
       apr_status_t status;
 
       /* Create the copy directly as cheap 'does exist/out of date'
@@ -2012,8 +2009,6 @@ change_file_prop(void *file_baton,
   file_context_t *file = file_baton;
   const char *ns;
 
-  name = apr_pstrdup(file->pool, name);
-
   if (strncmp(name, SVN_PROP_PREFIX, sizeof(SVN_PROP_PREFIX) - 1) == 0)
     {
       ns = SVN_DAV_PROP_NS_SVN;
@@ -2026,13 +2021,12 @@ change_file_prop(void *file_baton,
 
   if (value)
     {
-      value = svn_string_dup(value, file->pool);
       svn_ra_serf__set_prop(file->changed_props, file->url,
                             ns, name, value, file->pool);
     }
   else
     {
-      value = svn_string_create_empty(file->pool);
+      value = svn_string_create_empty(pool);
 
       svn_ra_serf__set_prop(file->removed_props, file->url,
                             ns, name, value, file->pool);

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/eagain_bucket.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/eagain_bucket.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/eagain_bucket.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/eagain_bucket.c Wed Jan 15 17:47:23 2014
@@ -88,10 +88,10 @@ eagain_bucket_peek(serf_bucket_t *bucket
 {
   const eagain_baton_t *eab = bucket->data;
 
-  *data = eab->data;
+  *data = eab->data ? eab->data : "";
   *len = eab->remaining;
 
-  return *data == NULL ? APR_EOF : APR_SUCCESS;
+  return APR_SUCCESS;
 }
 
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/get_deleted_rev.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/get_deleted_rev.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/get_deleted_rev.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/get_deleted_rev.c Wed Jan 15 17:47:23 2014
@@ -75,11 +75,13 @@ getdrev_closed(svn_ra_serf__xml_estate_t
                apr_pool_t *scratch_pool)
 {
   drev_context_t *drev_ctx = baton;
+  apr_int64_t rev;
 
   SVN_ERR_ASSERT(leaving_state == VERSION_NAME);
   SVN_ERR_ASSERT(cdata != NULL);
 
-  *drev_ctx->revision_deleted = SVN_STR_TO_REV(cdata->data);
+  SVN_ERR(svn_cstring_atoi64(&rev, cdata->data));
+  *drev_ctx->revision_deleted = (svn_revnum_t)rev;
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/getdate.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/getdate.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/getdate.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/getdate.c Wed Jan 15 17:47:23 2014
@@ -82,11 +82,14 @@ date_closed(svn_ra_serf__xml_estate_t *x
             apr_pool_t *scratch_pool)
 {
   date_context_t *date_ctx = baton;
+  apr_int64_t rev;
 
   SVN_ERR_ASSERT(leaving_state == VERSION_NAME);
   SVN_ERR_ASSERT(cdata != NULL);
 
-  *date_ctx->revision = SVN_STR_TO_REV(cdata->data);
+  SVN_ERR(svn_cstring_atoi64(&rev, cdata->data));
+
+  *date_ctx->revision = (svn_revnum_t)rev;
 
   return SVN_NO_ERROR;
 }
@@ -157,11 +160,13 @@ svn_ra_serf__get_dated_revision(svn_ra_s
 
   SVN_ERR(svn_ra_serf__context_run_one(handler, pool));
 
-  SVN_ERR(svn_ra_serf__error_on_status(handler->sline,
-                                       report_target,
-                                       handler->location));
+  if (handler->sline.code != 200)
+    return svn_error_trace(svn_ra_serf__unexpected_status(handler));
 
-  SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(*revision));
+  if (!SVN_IS_VALID_REVNUM(*revision))
+    return svn_error_create(SVN_ERR_RA_DAV_PROPS_NOT_FOUND, NULL,
+                            _("The REPORT response did not include "
+                              "the requested properties"));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/getlocations.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/getlocations.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/getlocations.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/getlocations.c Wed Jan 15 17:47:23 2014
@@ -94,7 +94,12 @@ getloc_closed(svn_ra_serf__xml_estate_t 
   path = svn_hash_gets(attrs, "path");
   if (revstr != NULL && path != NULL)
     {
-      svn_revnum_t rev = SVN_STR_TO_REV(revstr);
+      apr_int64_t rev_val;
+      svn_revnum_t rev;
+
+      SVN_ERR(svn_cstring_atoi64(&rev_val, revstr));
+      rev = (svn_revnum_t)rev_val;
+
       apr_hash_set(loc_ctx->paths,
                    apr_pmemdup(loc_ctx->pool, &rev, sizeof(rev)), sizeof(rev),
                    apr_pstrdup(loc_ctx->pool, path));

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/getlocationsegments.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/getlocationsegments.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/getlocationsegments.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/getlocationsegments.c Wed Jan 15 17:47:23 2014
@@ -84,6 +84,8 @@ gls_closed(svn_ra_serf__xml_estate_t *xe
   const char *path;
   const char *start_str;
   const char *end_str;
+  apr_int64_t start_val;
+  apr_int64_t end_val;
   svn_location_segment_t segment;
 
   SVN_ERR_ASSERT(leaving_state == SEGMENT);
@@ -95,9 +97,12 @@ gls_closed(svn_ra_serf__xml_estate_t *xe
   /* The transition table said these must exist.  */
   SVN_ERR_ASSERT(start_str && end_str);
 
+  SVN_ERR(svn_cstring_atoi64(&start_val, start_str));
+  SVN_ERR(svn_cstring_atoi64(&end_val, end_str));
+
   segment.path = path;  /* may be NULL  */
-  segment.range_start = SVN_STR_TO_REV(start_str);
-  segment.range_end = SVN_STR_TO_REV(end_str);
+  segment.range_start = (svn_revnum_t)start_val;
+  segment.range_end = (svn_revnum_t)end_val;
   SVN_ERR(gls_ctx->receiver(&segment, gls_ctx->receiver_baton, scratch_pool));
 
   return SVN_NO_ERROR;

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/inherited_props.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/inherited_props.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/inherited_props.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/inherited_props.c Wed Jan 15 17:47:23 2014
@@ -297,7 +297,7 @@ get_iprops_via_more_requests(svn_ra_sess
       SVN_ERR(svn_ra_serf__deliver_props(&rq->handler, rq->props, session,
                                          session->conns[0], rq->urlpath,
                                          rev_marker, "0", all_props,
-                                         NULL, scratch_pool));
+                                         scratch_pool));
 
       /* Allow ignoring authz problems */
       rq->handler->no_fail_on_http_failure_status = TRUE;

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/log.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/log.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/log.c Wed Jan 15 17:47:23 2014
@@ -218,12 +218,14 @@ collect_path(apr_hash_t *paths,
   copyfrom_rev = svn_hash_gets(attrs, "copyfrom-rev");
   if (copyfrom_path && copyfrom_rev)
     {
-      svn_revnum_t rev = SVN_STR_TO_REV(copyfrom_rev);
+      apr_int64_t rev;
 
-      if (SVN_IS_VALID_REVNUM(rev))
+      SVN_ERR(svn_cstring_atoi64(&rev, copyfrom_rev));
+
+      if (SVN_IS_VALID_REVNUM((svn_revnum_t)rev))
         {
           lcp->copyfrom_path = apr_pstrdup(result_pool, copyfrom_path);
-          lcp->copyfrom_rev = rev;
+          lcp->copyfrom_rev = (svn_revnum_t)rev;
         }
     }
 
@@ -307,7 +309,12 @@ log_closed(svn_ra_serf__xml_estate_t *xe
 
       rev_str = svn_hash_gets(attrs, "revision");
       if (rev_str)
-        log_entry->revision = SVN_STR_TO_REV(rev_str);
+        {
+          apr_int64_t rev;
+
+          SVN_ERR(svn_cstring_atoi64(&rev, rev_str));
+          log_entry->revision = (svn_revnum_t)rev;
+        }
       else
         log_entry->revision = SVN_INVALID_REVNUM;
 
@@ -412,7 +419,7 @@ log_closed(svn_ra_serf__xml_estate_t *xe
   return SVN_NO_ERROR;
 }
 
-
+/* Implements svn_ra_serf__request_body_delegate_t */
 static svn_error_t *
 create_log_body(serf_bucket_t **body_bkt,
                 void *baton,

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/merge.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/merge.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/merge.c Wed Jan 15 17:47:23 2014
@@ -171,7 +171,12 @@ merge_closed(svn_ra_serf__xml_estate_t *
 
           rev_str = svn_hash_gets(attrs, "revision");
           if (rev_str)
-            merge_ctx->commit_info->revision = SVN_STR_TO_REV(rev_str);
+            {
+              apr_int64_t rev;
+
+              SVN_ERR(svn_cstring_atoi64(&rev, rev_str));
+              merge_ctx->commit_info->revision = (svn_revnum_t)rev;
+            }
           else
             merge_ctx->commit_info->revision = SVN_INVALID_REVNUM;
 
@@ -327,6 +332,7 @@ merge_lock_token_list(apr_hash_t *lock_t
   svn_ra_serf__add_close_tag_buckets(body, alloc, "S:lock-token-list");
 }
 
+/* Implements svn_ra_serf__request_body_delegate_t */
 static svn_error_t*
 create_merge_body(serf_bucket_t **bkt,
                   void *baton,

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/mergeinfo.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/mergeinfo.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/mergeinfo.c Wed Jan 15 17:47:23 2014
@@ -130,7 +130,7 @@ mergeinfo_closed(svn_ra_serf__xml_estate
   return SVN_NO_ERROR;
 }
 
-
+/* Implements svn_ra_serf__request_body_delegate_t */
 static svn_error_t *
 create_mergeinfo_body(serf_bucket_t **bkt,
                       void *baton,

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/options.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/options.c Wed Jan 15 17:47:23 2014
@@ -64,7 +64,6 @@ typedef struct options_context_t {
   svn_boolean_t headers_processed;
 
   svn_ra_serf__session_t *session;
-  svn_ra_serf__connection_t *conn;
   svn_ra_serf__handler_t *handler;
 
   svn_ra_serf__response_handler_t inner_handler;
@@ -111,7 +110,7 @@ options_closed(svn_ra_serf__xml_estate_t
   return SVN_NO_ERROR;
 }
 
-
+/* Implements svn_ra_serf__request_body_delegate_t */
 static svn_error_t *
 create_options_body(serf_bucket_t **body_bkt,
                     void *baton,
@@ -396,7 +395,6 @@ create_options_req(options_context_t **o
   new_ctx = apr_pcalloc(pool, sizeof(*new_ctx));
   new_ctx->pool = pool;
   new_ctx->session = session;
-  new_ctx->conn = conn;
 
   new_ctx->youngest_rev = SVN_INVALID_REVNUM;
 
@@ -517,7 +515,7 @@ svn_ra_serf__exchange_capabilities(svn_r
   return SVN_NO_ERROR;
 }
 
-
+/* Implements svn_ra_serf__request_body_delegate_t */
 static svn_error_t *
 create_simple_options_body(serf_bucket_t **body_bkt,
                            void *baton,

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/property.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/property.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/property.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/property.c Wed Jan 15 17:47:23 2014
@@ -59,15 +59,8 @@ typedef enum prop_state_e {
  * This structure represents a pending PROPFIND response.
  */
 typedef struct propfind_context_t {
-  /* pool to issue allocations from */
-  apr_pool_t *pool;
-
   svn_ra_serf__handler_t *handler;
 
-  /* associated serf session */
-  svn_ra_serf__session_t *sess;
-  svn_ra_serf__connection_t *conn;
-
   /* the requested path */
   const char *path;
 
@@ -81,12 +74,8 @@ typedef struct propfind_context_t {
   /* the list of requested properties */
   const svn_ra_serf__dav_props_t *find_props;
 
-  /* hash table that will be updated with the properties
-   *
-   * This can be shared between multiple propfind_context_t
-   * structures
-   */
-  apr_hash_t *ret_props;
+  svn_ra_serf__prop_func prop_func;
+  void *prop_func_baton;
 
   /* hash table containing all the properties associated with the
    * "current" <propstat> tag.  These will get copied into RET_PROPS
@@ -94,12 +83,6 @@ typedef struct propfind_context_t {
    * "good"; otherwise, they'll get discarded.
    */
   apr_hash_t *ps_props;
-
-  /* If not-NULL, add us to this list when we're done. */
-  svn_ra_serf__list_t **done_list;
-
-  svn_ra_serf__list_t done_item;
-
 } propfind_context_t;
 
 
@@ -163,24 +146,6 @@ static apr_int64_t parse_status_code(con
   return 0;
 }
 
-
-/* Conforms to svn_ra_serf__path_rev_walker_t  */
-static svn_error_t *
-copy_into_ret_props(void *baton,
-                    const char *path, apr_ssize_t path_len,
-                    const char *ns, apr_ssize_t ns_len,
-                    const char *name, apr_ssize_t name_len,
-                    const svn_string_t *val,
-                    apr_pool_t *pool)
-{
-  propfind_context_t *ctx = baton;
-
-  svn_ra_serf__set_ver_prop(ctx->ret_props, path, ctx->rev, ns, name,
-                            val, ctx->pool);
-  return SVN_NO_ERROR;
-}
-
-
 /* Conforms to svn_ra_serf__xml_opened_t  */
 static svn_error_t *
 propfind_opened(svn_ra_serf__xml_estate_t *xes,
@@ -198,7 +163,7 @@ propfind_opened(svn_ra_serf__xml_estate_
     }
   else if (entered_state == PROPSTAT)
     {
-      ctx->ps_props = apr_hash_make(ctx->pool);
+      ctx->ps_props = apr_hash_make(svn_ra_serf__xml_state_pool(xes));
     }
 
   return SVN_NO_ERROR;
@@ -222,17 +187,10 @@ propfind_closed(svn_ra_serf__xml_estate_
          onto the "done list". External callers will then know this
          request has been completed (tho stray response bytes may still
          arrive).  */
-      if (ctx->done_list)
-        {
-          ctx->done_item.data = ctx->handler;
-          ctx->done_item.next = *ctx->done_list;
-          *ctx->done_list = &ctx->done_item;
-        }
     }
   else if (leaving_state == HREF)
     {
       const char *path;
-      const svn_string_t *val_str;
 
       if (strcmp(ctx->depth, "1") == 0)
         path = svn_urlpath__canonicalize(cdata->data, scratch_pool);
@@ -241,11 +199,10 @@ propfind_closed(svn_ra_serf__xml_estate_
 
       svn_ra_serf__xml_note(xes, RESPONSE, "path", path);
 
-      /* Copy the value into the right pool, then save the HREF.  */
-      val_str = svn_string_dup(cdata, ctx->pool);
-      svn_ra_serf__set_ver_prop(ctx->ret_props,
-                                path, ctx->rev, D_, "href", val_str,
-                                ctx->pool);
+      SVN_ERR(ctx->prop_func(ctx->prop_func_baton,
+                             path,
+                             D_, "href",
+                             cdata, scratch_pool));
     }
   else if (leaving_state == COLLECTION)
     {
@@ -267,7 +224,7 @@ propfind_closed(svn_ra_serf__xml_estate_
     }
   else if (leaving_state == PROPVAL)
     {
-      const char *encoding = svn_hash_gets(attrs, "V:encoding");
+      const char *encoding;
       const svn_string_t *val_str;
       apr_hash_t *gathered;
       const char *path;
@@ -275,7 +232,11 @@ propfind_closed(svn_ra_serf__xml_estate_
       const char *name;
       const char *altvalue;
 
-      if (encoding)
+      if ((altvalue = svn_hash_gets(attrs, "altvalue")) != NULL)
+        {
+          val_str = svn_string_create(altvalue, scratch_pool);
+        }
+      else if ((encoding = svn_hash_gets(attrs, "V:encoding")) != NULL)
         {
           if (strcmp(encoding, "base64") != 0)
             return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA,
@@ -284,12 +245,12 @@ propfind_closed(svn_ra_serf__xml_estate_
                                      encoding);
 
           /* Decode into the right pool.  */
-          val_str = svn_base64_decode_string(cdata, ctx->pool);
+          val_str = svn_base64_decode_string(cdata, scratch_pool);
         }
       else
         {
           /* Copy into the right pool.  */
-          val_str = svn_string_dup(cdata, ctx->pool);
+          val_str = cdata;
         }
 
       /* The current path sits on the RESPONSE state. Gather up all the
@@ -312,16 +273,11 @@ propfind_closed(svn_ra_serf__xml_estate_
         path = ctx->path;
 
       ns = svn_hash_gets(attrs, "ns");
-      name = apr_pstrdup(ctx->pool,
-                         svn_hash_gets(attrs, "name"));
-
-      altvalue = svn_hash_gets(attrs, "altvalue");
-      if (altvalue != NULL)
-        val_str = svn_string_create(altvalue, ctx->pool);
+      name = svn_hash_gets(attrs, "name");
 
       svn_ra_serf__set_ver_prop(ctx->ps_props,
                                 path, ctx->rev, ns, name, val_str,
-                                ctx->pool);
+                                apr_hash_pool_get(ctx->ps_props));
     }
   else
     {
@@ -337,11 +293,12 @@ propfind_closed(svn_ra_serf__xml_estate_
       if (! svn_hash_gets(gathered, "ignore-prop"))
         {
           SVN_ERR(svn_ra_serf__walk_all_paths(ctx->ps_props, ctx->rev,
-                                              copy_into_ret_props, ctx,
+                                              ctx->prop_func,
+                                              ctx->prop_func_baton,
                                               scratch_pool));
         }
 
-      ctx->ps_props = NULL;
+      ctx->ps_props = NULL; /* Allocated in PROPSTAT state pool */
     }
 
   return SVN_NO_ERROR;
@@ -451,6 +408,12 @@ svn_ra_serf__set_ver_prop(apr_hash_t *pr
       svn_hash_sets(path_props, ns, ns_props);
     }
 
+  if (val)
+    {
+      name = apr_pstrdup(pool, name);
+      val = svn_string_dup(val, pool);
+    }
+
   svn_hash_sets(ns_props, name, val);
 }
 
@@ -484,6 +447,7 @@ setup_propfind_headers(serf_bucket_t *he
 #define PROPFIND_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><propfind xmlns=\"DAV:\">"
 #define PROPFIND_TRAILER "</propfind>"
 
+/* Implements svn_ra_serf__request_body_delegate_t */
 static svn_error_t *
 create_propfind_body(serf_bucket_t **bkt,
                      void *setup_baton,
@@ -563,16 +527,16 @@ create_propfind_body(serf_bucket_t **bkt
 
 
 svn_error_t *
-svn_ra_serf__deliver_props(svn_ra_serf__handler_t **propfind_handler,
-                           apr_hash_t *ret_props,
-                           svn_ra_serf__session_t *sess,
-                           svn_ra_serf__connection_t *conn,
-                           const char *path,
-                           svn_revnum_t rev,
-                           const char *depth,
-                           const svn_ra_serf__dav_props_t *find_props,
-                           svn_ra_serf__list_t **done_list,
-                           apr_pool_t *pool)
+svn_ra_serf__deliver_props2(svn_ra_serf__handler_t **propfind_handler,
+                            svn_ra_serf__session_t *sess,
+                            svn_ra_serf__connection_t *conn,
+                            const char *path,
+                            svn_revnum_t rev,
+                            const char *depth,
+                            const svn_ra_serf__dav_props_t *find_props,
+                            svn_ra_serf__prop_func prop_func,
+                            void *prop_func_baton,
+                            apr_pool_t *pool)
 {
   propfind_context_t *new_prop_ctx;
   svn_ra_serf__handler_t *handler;
@@ -580,15 +544,12 @@ svn_ra_serf__deliver_props(svn_ra_serf__
 
   new_prop_ctx = apr_pcalloc(pool, sizeof(*new_prop_ctx));
 
-  new_prop_ctx->pool = apr_hash_pool_get(ret_props);
   new_prop_ctx->path = path;
   new_prop_ctx->find_props = find_props;
-  new_prop_ctx->ret_props = ret_props;
+  new_prop_ctx->prop_func = prop_func;
+  new_prop_ctx->prop_func_baton = prop_func_baton;
   new_prop_ctx->depth = depth;
-  new_prop_ctx->sess = sess;
-  new_prop_ctx->conn = conn;
   new_prop_ctx->rev = rev;
-  new_prop_ctx->done_list = done_list;
 
   if (SVN_IS_VALID_REVNUM(rev))
     {
@@ -617,8 +578,8 @@ svn_ra_serf__deliver_props(svn_ra_serf__
   handler->header_delegate = setup_propfind_headers;
   handler->header_delegate_baton = new_prop_ctx;
 
-  handler->session = new_prop_ctx->sess;
-  handler->conn = new_prop_ctx->conn;
+  handler->session = sess;
+  handler->conn = conn;
 
   new_prop_ctx->handler = handler;
 
@@ -627,6 +588,59 @@ svn_ra_serf__deliver_props(svn_ra_serf__
   return SVN_NO_ERROR;
 }
 
+/* Baton for deliver_prop */
+struct deliver_prop_baton_t
+{
+  apr_pool_t *result_pool;
+  apr_hash_t *prop_vals;
+  svn_revnum_t rev;
+};
+
+/* Implements svn_ra_serf__prop_func for svn_ra_serf__deliver_props */
+static svn_error_t *
+deliver_prop(void *baton,
+             const char *path,
+             const char *ns,
+             const char *name,
+             const svn_string_t *value,
+             apr_pool_t *scratch_pool)
+{
+  struct deliver_prop_baton_t *dpb = baton;
+
+  svn_ra_serf__set_ver_prop(dpb->prop_vals,
+                            path, dpb->rev,
+                            ns, name, value,
+                            dpb->result_pool);
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_serf__deliver_props(svn_ra_serf__handler_t **propfind_handler,
+                           apr_hash_t *prop_vals,
+                           svn_ra_serf__session_t *sess,
+                           svn_ra_serf__connection_t *conn,
+                           const char *url,
+                           svn_revnum_t rev,
+                           const char *depth,
+                           const svn_ra_serf__dav_props_t *lookup_props,
+                           apr_pool_t *pool)
+{
+  struct deliver_prop_baton_t *dpb = apr_pcalloc(pool, sizeof(*dpb));
+
+  dpb->result_pool = apr_hash_pool_get(prop_vals);
+  dpb->prop_vals = prop_vals;
+  dpb->rev = rev;
+
+  return svn_error_trace(svn_ra_serf__deliver_props2(propfind_handler,
+                                                     sess, conn,
+                                                     url, rev,
+                                                     depth,
+                                                     lookup_props,
+                                                     deliver_prop, dpb,
+                                                     pool));
+}
+
+
 
 /*
  * This helper function will block until the PROP_CTX indicates that is done
@@ -663,7 +677,7 @@ svn_ra_serf__retrieve_props(apr_hash_t *
   *results = apr_hash_make(result_pool);
 
   SVN_ERR(svn_ra_serf__deliver_props(&handler, *results, sess, conn, url,
-                                     rev, depth, props, NULL, result_pool));
+                                     rev, depth, props, result_pool));
   SVN_ERR(svn_ra_serf__wait_for_props(handler, scratch_pool));
 
   return SVN_NO_ERROR;
@@ -794,29 +808,26 @@ svn_ra_serf__walk_all_paths(apr_hash_t *
     {
       void *path_props;
       const void *path_name;
-      apr_ssize_t path_len;
       apr_hash_index_t *ns_hi;
 
-      apr_hash_this(path_hi, &path_name, &path_len, &path_props);
+      apr_hash_this(path_hi, &path_name, NULL, &path_props);
       for (ns_hi = apr_hash_first(pool, path_props); ns_hi;
            ns_hi = apr_hash_next(ns_hi))
         {
           void *ns_val;
           const void *ns_name;
-          apr_ssize_t ns_len;
           apr_hash_index_t *name_hi;
-          apr_hash_this(ns_hi, &ns_name, &ns_len, &ns_val);
+          apr_hash_this(ns_hi, &ns_name, NULL, &ns_val);
           for (name_hi = apr_hash_first(pool, ns_val); name_hi;
                name_hi = apr_hash_next(name_hi))
             {
               void *prop_val;
               const void *prop_name;
-              apr_ssize_t prop_len;
 
-              apr_hash_this(name_hi, &prop_name, &prop_len, &prop_val);
+              apr_hash_this(name_hi, &prop_name, NULL, &prop_val);
               /* use a subpool? */
-              SVN_ERR(walker(baton, path_name, path_len, ns_name, ns_len,
-                             prop_name, prop_len, prop_val, pool));
+              SVN_ERR(walker(baton, path_name, ns_name, prop_name, prop_val,
+                             pool));
             }
         }
     }

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/ra_serf.h?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/ra_serf.h Wed Jan 15 17:47:23 2014
@@ -271,26 +271,6 @@ typedef struct svn_ra_serf__dav_props_t 
   const char *name;
 } svn_ra_serf__dav_props_t;
 
-/*
- * Structure which represents an XML namespace.
- */
-typedef struct ns_t {
-  /* The assigned name. */
-  const char *xmlns;
-  /* The full URL for this namespace. */
-  const char *url;
-  /* The next namespace in our list. */
-  struct ns_t *next;
-} svn_ra_serf__ns_t;
-
-/*
- * An incredibly simple list.
- */
-typedef struct ra_serf_list_t {
-  void *data;
-  struct ra_serf_list_t *next;
-} svn_ra_serf__list_t;
-
 /** DAV property sets **/
 
 static const svn_ra_serf__dav_props_t base_props[] =
@@ -460,6 +440,7 @@ typedef struct svn_ra_serf__handler_t {
 
   /* Has the request/response been completed?  */
   svn_boolean_t done;
+  svn_boolean_t scheduled; /* Is the request scheduled in a context */
 
   /* If we captured an error from the server, then this will be non-NULL.
      It will be allocated from HANDLER_POOL.  */
@@ -532,7 +513,6 @@ typedef struct svn_ra_serf__handler_t {
   /* Pool for allocating SLINE.REASON and LOCATION. If this pool is NULL,
      then the requestor does not care about SLINE and LOCATION.  */
   apr_pool_t *handler_pool;
-
 } svn_ra_serf__handler_t;
 
 
@@ -553,114 +533,6 @@ svn_ra_serf__context_run_one(svn_ra_serf
  */
 void svn_ra_serf__request_create(svn_ra_serf__handler_t *handler);
 
-/* XML helper callbacks. */
-
-typedef struct svn_ra_serf__xml_state_t {
-  /* A numeric value that represents the current state in parsing.
-   *
-   * Value 0 is reserved for use as the default state.
-   */
-  int current_state;
-
-  /* Private pointer set by the parsing code. */
-  void *private;
-
-  /* Allocations should be made in this pool to match the lifetime of the
-   * state.
-   */
-  apr_pool_t *pool;
-
-  /* The currently-declared namespace for this state. */
-  svn_ra_serf__ns_t *ns_list;
-
-  /* Our previous states. */
-  struct svn_ra_serf__xml_state_t *prev;
-} svn_ra_serf__xml_state_t;
-
-/* Forward declaration of the XML parser structure. */
-typedef struct svn_ra_serf__xml_parser_t svn_ra_serf__xml_parser_t;
-
-/* Callback invoked with @a baton by our XML @a parser when an element with
- * the @a name containing @a attrs is opened.
- */
-typedef svn_error_t *
-(*svn_ra_serf__xml_start_element_t)(svn_ra_serf__xml_parser_t *parser,
-                                    svn_ra_serf__dav_props_t name,
-                                    const char **attrs,
-                                    apr_pool_t *scratch_pool);
-
-/* Callback invoked with @a baton by our XML @a parser when an element with
- * the @a name is closed.
- */
-typedef svn_error_t *
-(*svn_ra_serf__xml_end_element_t)(svn_ra_serf__xml_parser_t *parser,
-                                  svn_ra_serf__dav_props_t name,
-                                  apr_pool_t *scratch_pool);
-
-/* Callback invoked with @a baton by our XML @a parser when a CDATA portion
- * of @a data with size @a len is encountered.
- *
- * This may be invoked multiple times for the same tag.
- */
-typedef svn_error_t *
-(*svn_ra_serf__xml_cdata_chunk_handler_t)(svn_ra_serf__xml_parser_t *parser,
-                                          const char *data,
-                                          apr_size_t len,
-                                          apr_pool_t *scratch_pool);
-
-/*
- * Helper structure associated with handle_xml_parser handler that will
- * specify how an XML response will be processed.
- */
-struct svn_ra_serf__xml_parser_t {
-  /* Temporary allocations should be made in this pool. */
-  apr_pool_t *pool;
-
-  /* What kind of response are we parsing? If set, this should typically
-     define the report name.  */
-  const char *response_type;
-
-  /* Caller-specific data passed to the start, end, cdata callbacks.  */
-  void *user_data;
-
-  /* Callback invoked when a tag is opened. */
-  svn_ra_serf__xml_start_element_t start;
-
-  /* Callback invoked when a tag is closed. */
-  svn_ra_serf__xml_end_element_t end;
-
-  /* Callback invoked when a cdata chunk is received. */
-  svn_ra_serf__xml_cdata_chunk_handler_t cdata;
-
-  /* Our associated expat-based XML parser. */
-  XML_Parser xmlp;
-
-  /* Our current state. */
-  svn_ra_serf__xml_state_t *state;
-
-  /* Our previously used states (will be reused). */
-  svn_ra_serf__xml_state_t *free_state;
-
-  /* If non-NULL, this value will be set to TRUE when the response is
-   * completed.
-   */
-  svn_boolean_t *done;
-
-  /* If non-NULL, when this parser completes, it will add done_item to
-   * the list.
-   */
-  svn_ra_serf__list_t **done_list;
-
-  /* A pointer to the item that will be inserted into the list upon
-   * completeion.
-   */
-  svn_ra_serf__list_t *done_item;
-
-  /* If an error occurred, this value will be non-NULL. */
-  svn_error_t *error;
-};
-
-
 /* v2 of the XML parsing functions  */
 
 /* The XML parsing context.  */
@@ -856,29 +728,6 @@ svn_ra_serf__xml_note(svn_ra_serf__xml_e
 apr_pool_t *
 svn_ra_serf__xml_state_pool(svn_ra_serf__xml_estate_t *xes);
 
-
-/* Any XML parser may be used. When an opening tag is seen, call this
-   function to feed the information into XMLCTX.  */
-svn_error_t *
-svn_ra_serf__xml_cb_start(svn_ra_serf__xml_context_t *xmlctx,
-                          const char *raw_name,
-                          const char *const *attrs);
-
-
-/* When a close tag is seen, call this function to feed the information
-   into XMLCTX.  */
-svn_error_t *
-svn_ra_serf__xml_cb_end(svn_ra_serf__xml_context_t *xmlctx,
-                        const char *raw_name);
-
-
-/* When cdata is parsed by the wrapping XML parser, call this function to
-   feed the cdata into the XMLCTX.  */
-svn_error_t *
-svn_ra_serf__xml_cb_cdata(svn_ra_serf__xml_context_t *xmlctx,
-                          const char *data,
-                          apr_size_t len);
-
 /*
  * Parses a server-side error message into a local Subversion error.
  */
@@ -982,23 +831,6 @@ svn_error_t *
 svn_ra_serf__server_error_create(svn_ra_serf__handler_t *handler,
                                  apr_pool_t *scratch_pool);
 
-
-/*
- * This function will feed the RESPONSE body into XMLP.  When parsing is
- * completed (i.e. an EOF is received), *DONE is set to TRUE.
- * Implements svn_ra_serf__response_handler_t.
- *
- * If an error occurs during processing RESP_ERR is invoked with the
- * RESP_ERR_BATON.
- *
- * Temporary allocations are made in POOL.
- */
-svn_error_t *
-svn_ra_serf__handle_xml_parser(serf_request_t *request,
-                               serf_bucket_t *response,
-                               void *handler_baton,
-                               apr_pool_t *pool);
-
 /* serf_response_handler_t implementation that completely discards
  * the response.
  *
@@ -1011,22 +843,6 @@ svn_ra_serf__response_discard_handler(se
                                       apr_pool_t *pool);
 
 
-/** XML helper functions. **/
-
-/*
- * Advance the internal XML @a parser to the @a state.
- */
-void
-svn_ra_serf__xml_push_state(svn_ra_serf__xml_parser_t *parser,
-                            int state);
-
-/*
- * Return to the previous internal XML @a parser state.
- */
-void
-svn_ra_serf__xml_pop_state(svn_ra_serf__xml_parser_t *parser);
-
-
 /*
  * Add the appropriate serf buckets to @a agg_bucket represented by
  * the XML * @a tag and @a value.
@@ -1089,32 +905,19 @@ void
 svn_ra_serf__add_cdata_len_buckets(serf_bucket_t *agg_bucket,
                                    serf_bucket_alloc_t *bkt_alloc,
                                    const char *data, apr_size_t len);
-/*
- * Look up the @a attrs array for namespace definitions and add each one
- * to the @a ns_list of namespaces.
- *
- * New namespaces will be allocated in RESULT_POOL.
- */
-void
-svn_ra_serf__define_ns(svn_ra_serf__ns_t **ns_list,
-                       const char *const *attrs,
-                       apr_pool_t *result_pool);
-
-/*
- * Look up @a name in the @a ns_list list for previously declared namespace
- * definitions.
- *
- * Return (in @a *returned_prop_name) a #svn_ra_serf__dav_props_t tuple
- * representing the expanded name.
- */
-void
-svn_ra_serf__expand_ns(svn_ra_serf__dav_props_t *returned_prop_name,
-                       const svn_ra_serf__ns_t *ns_list,
-                       const char *name);
 
 
 /** PROPFIND-related functions **/
 
+/* Callback used via svn_ra_serf__deliver_props2 */
+typedef svn_error_t *
+(*svn_ra_serf__prop_func)(void *baton,
+                          const char *path,
+                          const char *ns,
+                          const char *name,
+                          const svn_string_t *value,
+                          apr_pool_t *scratch_pool);
+
 /*
  * This function will deliver a PROP_CTX PROPFIND request in the SESS
  * serf context for the properties listed in LOOKUP_PROPS at URL for
@@ -1132,9 +935,28 @@ svn_ra_serf__deliver_props(svn_ra_serf__
                            svn_revnum_t rev,
                            const char *depth,
                            const svn_ra_serf__dav_props_t *lookup_props,
-                           svn_ra_serf__list_t **done_list,
                            apr_pool_t *pool);
 
+
+/*
+ * This function will deliver a PROP_CTX PROPFIND request in the SESS
+ * serf context for the properties listed in LOOKUP_PROPS at URL for
+ * DEPTH ("0","1","infinity").
+ *
+ * This function will not block waiting for the response. Callers are
+ * expected to call svn_ra_serf__wait_for_props().
+ */
+svn_error_t *
+svn_ra_serf__deliver_props2(svn_ra_serf__handler_t **propfind_handler,
+                            svn_ra_serf__session_t *sess,
+                            svn_ra_serf__connection_t *conn,
+                            const char *path,
+                            svn_revnum_t rev,
+                            const char *depth,
+                            const svn_ra_serf__dav_props_t *find_props,
+                            svn_ra_serf__prop_func prop_func,
+                            void *prop_func_baton,
+                            apr_pool_t *pool);
 /*
  * This helper function will block until PROPFIND_HANDLER indicates that is
  * done or another error is returned.
@@ -1246,9 +1068,9 @@ svn_ra_serf__walk_node_props(apr_hash_t 
 
 typedef svn_error_t *
 (*svn_ra_serf__path_rev_walker_t)(void *baton,
-                                  const char *path, apr_ssize_t path_len,
-                                  const char *ns, apr_ssize_t ns_len,
-                                  const char *name, apr_ssize_t name_len,
+                                  const char *path,
+                                  const char *ns,
+                                  const char *name,
                                   const svn_string_t *val,
                                   apr_pool_t *pool);
 svn_error_t *
@@ -1521,6 +1343,22 @@ svn_ra_serf__get_log(svn_ra_session_t *s
                      void *receiver_baton,
                      apr_pool_t *pool);
 
+/* Implements svn_ra__vtable_t.check_path(). */
+svn_error_t *
+svn_ra_serf__check_path(svn_ra_session_t *ra_session,
+                        const char *rel_path,
+                        svn_revnum_t revision,
+                        svn_node_kind_t *kind,
+                        apr_pool_t *pool);
+
+/* Implements svn_ra__vtable_t.stat(). */
+svn_error_t *
+svn_ra_serf__stat(svn_ra_session_t *ra_session,
+                  const char *rel_path,
+                  svn_revnum_t revision,
+                  svn_dirent_t **dirent,
+                  apr_pool_t *pool);
+
 /* Implements svn_ra__vtable_t.get_locations(). */
 svn_error_t *
 svn_ra_serf__get_locations(svn_ra_session_t *session,
@@ -1639,6 +1477,17 @@ svn_ra_serf__get_file(svn_ra_session_t *
                       apr_hash_t **props,
                       apr_pool_t *pool);
 
+/* Implements svn_ra__vtable_t.get_dir(). */
+svn_error_t *
+svn_ra_serf__get_dir(svn_ra_session_t *ra_session,
+                     apr_hash_t **dirents,
+                     svn_revnum_t *fetched_rev,
+                     apr_hash_t **ret_props,
+                     const char *rel_path,
+                     svn_revnum_t revision,
+                     apr_uint32_t dirent_fields,
+                     apr_pool_t *result_pool);
+
 /* Implements svn_ra__vtable_t.change_rev_prop(). */
 svn_error_t *
 svn_ra_serf__change_rev_prop(svn_ra_session_t *session,

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/replay.c?rev=1558485&r1=1558484&r2=1558485&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/replay.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/replay.c Wed Jan 15 17:47:23 2014
@@ -112,6 +112,14 @@ static const svn_ra_serf__xml_transition
   { 0 }
 };
 
+/*
+ * An incredibly simple list.
+ */
+typedef struct ra_serf_list_t {
+  void *data;
+  struct ra_serf_list_t *next;
+} svn_ra_serf__list_t;
+
 /* Per directory/file state */
 typedef struct replay_node_t {
   apr_pool_t *pool; /* pool allocating this node's data */
@@ -501,6 +509,7 @@ replay_done(serf_request_t *request,
   return SVN_NO_ERROR;
 }
 
+/* Implements svn_ra_serf__request_body_delegate_t */
 static svn_error_t *
 create_replay_body(serf_bucket_t **bkt,
                    void *baton,
@@ -734,7 +743,6 @@ svn_ra_serf__replay_range(svn_ra_session
                                              replay_ctx->revprop_target,
                                              replay_ctx->revprop_rev,
                                              "0", all_props,
-                                             NULL,
                                              replay_ctx->pool));
 
           /* Spin up the serf request for the PROPFIND.  */



Mime
View raw message