You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/12/19 04:27:11 UTC

svn commit: r1423749 - in /subversion/branches/in-repo-authz: ./ subversion/bindings/cxxhl/include/svncxxhl/ subversion/bindings/cxxhl/src/ subversion/bindings/cxxhl/tests/ subversion/include/ subversion/include/private/ subversion/libsvn_fs_fs/ subver...

Author: breser
Date: Wed Dec 19 03:27:09 2012
New Revision: 1423749

URL: http://svn.apache.org/viewvc?rev=1423749&view=rev
Log:
Sync the 'in-repo-authz' branch with recent trunk changes.
(Merged /subversion/trunk:r1423201-r1423748.)


Added:
    subversion/branches/in-repo-authz/subversion/bindings/cxxhl/tests/
      - copied from r1423748, subversion/trunk/subversion/bindings/cxxhl/tests/
Modified:
    subversion/branches/in-repo-authz/   (props changed)
    subversion/branches/in-repo-authz/build.conf
    subversion/branches/in-repo-authz/configure.ac
    subversion/branches/in-repo-authz/get-deps.sh
    subversion/branches/in-repo-authz/subversion/bindings/cxxhl/include/svncxxhl/exception.hpp
    subversion/branches/in-repo-authz/subversion/bindings/cxxhl/src/exception.cpp
    subversion/branches/in-repo-authz/subversion/include/private/svn_mutex.h
    subversion/branches/in-repo-authz/subversion/include/private/svn_named_atomic.h
    subversion/branches/in-repo-authz/subversion/include/private/svn_sqlite.h
    subversion/branches/in-repo-authz/subversion/include/svn_delta.h
    subversion/branches/in-repo-authz/subversion/include/svn_io.h
    subversion/branches/in-repo-authz/subversion/include/svn_pools.h
    subversion/branches/in-repo-authz/subversion/include/svn_props.h
    subversion/branches/in-repo-authz/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/in-repo-authz/subversion/libsvn_subr/opt.c
    subversion/branches/in-repo-authz/subversion/libsvn_subr/properties.c
    subversion/branches/in-repo-authz/subversion/libsvn_subr/sqlite.c
    subversion/branches/in-repo-authz/subversion/libsvn_wc/props.c
    subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_pristine.c
    subversion/branches/in-repo-authz/subversion/svnrdump/dump_editor.c
    subversion/branches/in-repo-authz/subversion/svnrdump/load_editor.c
    subversion/branches/in-repo-authz/subversion/svnrdump/svnrdump.h
    subversion/branches/in-repo-authz/subversion/svnrdump/util.c
    subversion/branches/in-repo-authz/subversion/tests/cmdline/svnrdump_tests.py

Propchange: subversion/branches/in-repo-authz/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1423201-1423748

Modified: subversion/branches/in-repo-authz/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/build.conf?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/build.conf (original)
+++ subversion/branches/in-repo-authz/build.conf Wed Dec 19 03:27:09 2012
@@ -59,6 +59,8 @@ private-built-includes =
         subversion/bindings/javahl/include/org_apache_subversion_javahl_types_Version.h
         subversion/bindings/javahl/include/org_apache_subversion_javahl_types_Revision.h
         subversion/bindings/javahl/include/org_apache_subversion_javahl_callback_UserPasswordCallback.h
+        subversion/svn/svn-help.inc
+        subversion/svn/svn-help.man
 
 
 test-scripts =
@@ -174,7 +176,7 @@ manpages = subversion/svnversion/svnvers
 description = Subversion remote repository dumper and loader
 type = exe
 path = subversion/svnrdump
-libs = libsvn_client libsvn_ra libsvn_repos libsvn_delta libsvn_subr apr
+libs = libsvn_client libsvn_ra libsvn_repos libsvn_delta libsvn_subr aprutil apr
 install = bin
 manpages = subversion/svnrdump/svnrdump.1
 
@@ -640,6 +642,16 @@ msvc-static = yes
 compile-cmd = $(COMPILE_CXXHL_CXX)
 link-cmd = $(LINK_CXX_LIB)
 
+[cxxhl-tests]
+description = Unit tests for Subversion C++ HighLevel bindings
+type = exe
+path = subversion/bindings/cxxhl
+libs = libsvncxxhl libsvn_subr
+sources = tests/*.cpp
+install = tests
+compile-cmd = $(COMPILE_CXXHL_CXX)
+link-cmd = $(LINK_CXX)
+
 # ----------------------------------------------------------------------------
 #
 # TESTING TARGETS

Modified: subversion/branches/in-repo-authz/configure.ac
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/configure.ac?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/configure.ac (original)
+++ subversion/branches/in-repo-authz/configure.ac Wed Dec 19 03:27:09 2012
@@ -149,7 +149,7 @@ SVN_FIND_APACHE(20020903)
 dnl Search for SQLite
 SQLITE_MINIMUM_VER="3.7.12"
 SQLITE_RECOMMENDED_VER="3.7.15"
-SQLITE_URL="http://www.sqlite.org/sqlite-amalgamation-$(printf %u%02u%02u%02u $(echo ${SQLITE_RECOMMENDED_VER} | sed -e 's/\./ /g')).zip"
+SQLITE_URL="http://www.sqlite.org/sqlite-amalgamation-$(printf %d%02d%02d%02d $(echo ${SQLITE_RECOMMENDED_VER} | sed -e 's/\./ /g')).zip"
 
 SVN_LIB_SQLITE(${SQLITE_MINIMUM_VER}, ${SQLITE_RECOMMENDED_VER},
                ${SQLITE_URL})

Modified: subversion/branches/in-repo-authz/get-deps.sh
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/get-deps.sh?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/get-deps.sh (original)
+++ subversion/branches/in-repo-authz/get-deps.sh Wed Dec 19 03:27:09 2012
@@ -28,7 +28,7 @@ APR_UTIL=apr-util-1.5.1
 SERF=serf-1.1.1
 ZLIB=zlib-1.2.7
 SQLITE_VERSION=3.7.15
-SQLITE=sqlite-amalgamation-$(printf %u%02u%02u%02u $(echo $SQLITE_VERSION | sed -e 's/\./ /g'))
+SQLITE=sqlite-amalgamation-$(printf %d%02d%02d%02d $(echo $SQLITE_VERSION | sed -e 's/\./ /g'))
 
 HTTPD=httpd-2.4.3
 APR_ICONV=apr-iconv-1.2.1

Modified: subversion/branches/in-repo-authz/subversion/bindings/cxxhl/include/svncxxhl/exception.hpp
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/bindings/cxxhl/include/svncxxhl/exception.hpp?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/bindings/cxxhl/include/svncxxhl/exception.hpp (original)
+++ subversion/branches/in-repo-authz/subversion/bindings/cxxhl/include/svncxxhl/exception.hpp Wed Dec 19 03:27:09 2012
@@ -29,16 +29,23 @@
 #define SVN_CXXHL_EXCEPTION_HPP
 
 #include <exception>
+#include <string>
+#include <utility>
+#include <vector>
 
 #include "svncxxhl/_compat.hpp"
 
+// Forward declaration of implementation-specific structure
+struct svn_error_t;
+
 namespace subversion {
 namespace cxxhl {
 
 namespace compat {} // Announce the compat namespace for shared_ptr lookup
 
 namespace detail {
-struct error_description;
+// Forward declaration of implementation-specific structure
+class error_description;
 } // namespace detail
 
 namespace version_1_9_dev {
@@ -48,33 +55,74 @@ class error : public std::exception
 public:
   typedef compat::shared_ptr<error> shared_ptr;
 
-  error(const char* description, int errno);
-  error(const char* description, int errno, shared_ptr nested);
+  error(const char* description, int error_code);
+  error(const char* description, int error_code, shared_ptr nested_error);
 
   error(const error& that) throw();
   error& operator=(const error& that) throw();
   virtual ~error() throw();
 
+  /**
+   * Returns the error code associated with the exception.
+   */
   virtual int code() const throw() { return m_errno; }
-  virtual const char* what() const throw();
+
+  /**
+   * Returns a shared pointer to the nested exception object, if any.
+   */
   virtual shared_ptr nested() const throw() { return m_nested; }
 
-private:
-  int m_errno;                ///< The (SVN or APR) error code
-  shared_ptr m_nested;        ///< Optional pointer to nessted error
+  /// Returns the message associated with this exception object.
+  virtual const char* what() const throw();
 
-  /// Error message; will be @c NULL if this is a trace link.
-  detail::error_description* m_description;
+  /**
+   * Error message description.
+   *
+   * The first element of this pair is the error code, the second the
+   * associated error message. If the error code is 0, the message
+   * describes the location in the source code where the error was
+   * generated from.
+   */
+  typedef std::pair<int, std::string> message;
 
   /**
-   * The location of the error in @a m_loc_file at @a m_loc_line.
+   * The list of messages associated with an error.
+   */
+  typedef std::vector<message> message_list;
+
+  /**
+   * Returns the complete list of error messages, including those from
+   * nested exceptions.
+   */
+  virtual message_list messages() const
+    {
+      return compile_messages(false);
+    }
+
+  /**
+   * Like error::messages(), but includes debugging traceback.
    *
-   * @a m_loc_file will be @c NULL if the location is not available
-   * (i.e., if the wrapped Subversion library was not compiled in
-   * maintaner mode.
+   * @note
+   * Traceback is only available if the Subversion libraries were
+   * compiled with tracing enabled.
    */
-  const char* m_loc_file;
-  int m_loc_line;
+  virtual message_list traced_messages() const
+    {
+      return compile_messages(true);
+    }
+
+public:
+  /** Used internally by the implementation. */
+  static void throw_svn_error(svn_error_t*);
+
+private:
+  error(int error_code, detail::error_description* description) throw();
+  std::vector<message> compile_messages(bool show_traces) const;
+
+  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::error_description* m_description;
 };
 
 class canceled : public error {};

Modified: subversion/branches/in-repo-authz/subversion/bindings/cxxhl/src/exception.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/bindings/cxxhl/src/exception.cpp?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/bindings/cxxhl/src/exception.cpp (original)
+++ subversion/branches/in-repo-authz/subversion/bindings/cxxhl/src/exception.cpp Wed Dec 19 03:27:09 2012
@@ -21,14 +21,19 @@
  * @endcopyright
  */
 
-#include <csignal>
+#include <algorithm>
 #include <cstddef>
 #include <cstring>
 #include <new>
+#include <sstream>
 
 #include "svncxxhl/exception.hpp"
 
 #include "svn_error.h"
+#include "svn_utf.h"
+#include "private/svn_atomic.h"
+#include "private/svn_error_private.h"
+#include "svn_private_config.h"
 #undef TRUE
 #undef FALSE
 
@@ -37,28 +42,72 @@ namespace cxxhl {
 
 namespace detail {
 
-struct error_description
+class error_description
 {
-  volatile std::sig_atomic_t m_refcount;
-  char m_message[1];
+public:
+  static error_description* create(const char* message,
+                                   const char *loc_file, long loc_line,
+                                   bool trace_link)
+    {
+      bool empty_message = (message == NULL);
+      const std::size_t length = (empty_message ? 0 : std::strlen(message));
+      void *memblock = ::operator new(length + sizeof(error_description));
+
+      error_description* description = new(memblock) error_description(
+          loc_file, loc_line, trace_link, empty_message);
+      if (length)
+        std::memcpy(description->m_message, message, length);
+      description->m_message[length] = 0;
+      return description;
+    }
 
-  static error_description* create(const char* message) throw(std::bad_alloc)
+  static error_description* create(const char* message)
     {
-      const std::size_t len = std::strlen(message);
-      void *memblock = ::operator new(len + sizeof(error_description));
+      return create(message, NULL, 0, false);
+    }
 
-      error_description* err = new(memblock) error_description;
-      std::memcpy(err->m_message, message, len);
-      err->m_message[len] = 0;
-      err->m_refcount = 0;
-      return err;
+  error_description* reference() throw()
+    {
+      if (this)
+        svn_atomic_inc(&m_refcount);
+      return this;
     }
 
-  static void destroy(error_description* message) throw()
+  error_description* dereference() throw()
     {
-      // TODO: DEBUG assert(message->m_refcount == 0)
-      ::operator delete(message, std::nothrow);
+      if (this && 0 == svn_atomic_dec(&m_refcount))
+        {
+          this->~error_description();
+          ::operator delete(this, std::nothrow);
+          return NULL;
+        }
+      return this;
     }
+
+  const char* what() const throw() { return (m_empty ? NULL : m_message); }
+  const char* file() const throw() { return m_loc_file; }
+  long line() const throw() { return m_loc_line; }
+  bool trace() const throw() { return m_trace; }
+
+private:
+  error_description(const char *loc_file, long loc_line,
+                    bool trace_link, bool empty_message) throw()
+    : m_loc_file(loc_file),
+      m_loc_line(loc_line),
+      m_trace(trace_link),
+      m_empty(empty_message),
+      m_refcount(0)
+    {}
+
+  ~error_description() throw() {}
+
+  const char* m_loc_file;
+  long m_loc_line;
+  bool m_trace;
+  bool m_empty;
+
+  volatile svn_atomic_t m_refcount;
+  char m_message[1];
 };
 
 } // namespace detail
@@ -68,27 +117,21 @@ namespace version_1_9_dev {
 
 error::error(const char* description, int error_code)
   : m_errno(error_code),
-    m_description(detail::error_description::create(description))
-{
-  ++m_description->m_refcount;
-}
+    m_description(detail::error_description::create(description)->reference())
+{}
 
 error::error(const char* description, int error_code,
              error::shared_ptr nested_error)
   : m_errno(error_code),
     m_nested(nested_error),
-    m_description(detail::error_description::create(description))
-{
-  ++m_description->m_refcount;
-}
+    m_description(detail::error_description::create(description)->reference())
+{}
 
 error::error(const error& that) throw()
   : m_errno(that.m_errno),
     m_nested(that.m_nested),
-    m_description(that.m_description)
-{
-  ++m_description->m_refcount;
-}
+    m_description(that.m_description->reference())
+{}
 
 error& error::operator=(const error& that) throw()
 {
@@ -104,13 +147,160 @@ error& error::operator=(const error& tha
 
 error::~error() throw()
 {
-  if (!--m_description->m_refcount)
-    detail::error_description::destroy(m_description);
+  m_description->dereference();
 }
 
 const char* error::what() const throw()
 {
-  return m_description->m_message;
+  return m_description->what();
+}
+
+error::error(int error_code, detail::error_description* description) throw()
+  : m_errno(error_code),
+    m_description(description)
+{}
+
+void error::throw_svn_error(svn_error_t* err)
+{
+  detail::error_description* description = NULL;
+  try
+    {
+      // Be very careful when creating the error descriptions, so that
+      // the exception unwinder can free them if an allocation fails.
+      // The private constructor does not increment the refcount
+      // precisely for this reason.
+      description = detail::error_description::create(
+          err->message, err->file, err->line,
+          svn_error__is_tracing_link(err));
+      description->reference();
+      error converted = error(err->apr_err, description);
+      description = NULL;
+
+      svn_error_t *prev = err;
+      error* current = &converted;
+      for (err = err->child; err; prev = err, err = err->child)
+        {
+          svn_error_clear(prev);
+          description = detail::error_description::create(
+              err->message, err->file, err->line,
+              svn_error__is_tracing_link(err));
+          description->reference();
+          current->m_nested.reset(new error(err->apr_err, description));
+          description = NULL;
+          current = current->m_nested.get();
+        }
+      svn_error_clear(prev);
+      throw converted;
+    }
+  catch (...)
+    {
+      description->dereference();
+      throw;
+    }
+}
+
+
+namespace {
+void handle_one_error(error::message_list& ml, bool show_traces,
+                      int error_code, detail::error_description* descr,
+                      apr_pool_t* pool)
+{
+  if (show_traces && descr->file())
+    {
+      const char* file_utf8 = NULL;
+      svn_error_t* err =
+        svn_utf_cstring_to_utf8(&file_utf8, descr->file(), pool);
+      if (err)
+        {
+          svn_error_clear(err);
+          file_utf8 = NULL;
+        }
+      std::ostringstream buffer;
+      if (file_utf8)
+        buffer << file_utf8 << ':' << descr->line();
+      else
+        buffer << "svn:<undefined>";
+      buffer << ": (apr_err=" << error_code << ')';
+      ml.push_back(error::message(0, buffer.str()));
+    }
+
+  if (descr->trace())
+    return;
+
+  const char *description = descr->what();
+  if (!description)
+    {
+      char errorbuf[512];
+
+      // Is this a Subversion-specific error code?
+      if (error_code > APR_OS_START_USEERR
+          && error_code <= APR_OS_START_CANONERR)
+        description = svn_strerror(error_code, errorbuf, sizeof(errorbuf));
+      // Otherwise, this must be an APR error code.
+      else
+        {
+          svn_error_t* err = svn_utf_cstring_to_utf8(
+              &description,
+              apr_strerror(error_code, errorbuf, sizeof(errorbuf)),
+              pool);
+          if (err)
+            {
+              svn_error_clear(err);
+              description = _("Can't recode error string from APR");
+            }
+        }
+    }
+  ml.push_back(error::message(error_code, std::string(description)));
+}
+} // anonymous namespace
+
+error::message_list error::compile_messages(bool show_traces) const
+{
+  // Determine the maximum size of the returned list
+  message_list::size_type max_length = 0;
+  for (const error* err = this; err; err = err->m_nested.get())
+    {
+      if (show_traces && m_description->file())
+        ++max_length;                   // We will display an error location
+      if (!m_description->trace())
+        ++max_length;                   // Traces do not emit a message line
+    }
+  message_list ml;
+  ml.reserve(max_length);
+
+  // This vector holds a list of all error codes that we've printed
+  // the generic description for.  See svn_handle_error2 for details.
+  std::vector<int> empties;
+  empties.reserve(max_length);
+
+  apr_pool_t* pool = NULL;
+  apr_pool_create(&pool, NULL);
+  try
+    {
+      for (const error* err = this; err; err = err->m_nested.get())
+        {
+          if (!err->m_description->what())
+            {
+              // Non-specific messages are printed only once.
+              std::vector<int>::iterator it = std::find(
+                  empties.begin(), empties.end(), err->m_errno);
+              if (it != empties.end())
+                continue;
+              empties.push_back(err->m_errno);
+            }
+          handle_one_error(ml, show_traces,
+                           err->m_errno, err->m_description,
+                           pool);
+        }
+    }
+  catch (...)
+    {
+      apr_pool_destroy(pool);
+      throw;
+    }
+
+  apr_pool_destroy(pool);
+  return ml;
 }
 
 } // namespace version_1_9_dev

Modified: subversion/branches/in-repo-authz/subversion/include/private/svn_mutex.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/private/svn_mutex.h?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/private/svn_mutex.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/private/svn_mutex.h Wed Dec 19 03:27:09 2012
@@ -57,8 +57,8 @@ typedef void svn_mutex__t;
 
 /** Initialize the @a *mutex. If @a mutex_required is TRUE, the mutex will
  * actually be created with a lifetime defined by @a result_pool. Otherwise,
- * the pointer will be set to @c NULL and @ref svn_mutex__lock as well as
- * @ref svn_mutex__unlock will be no-ops.
+ * the pointer will be set to @c NULL and svn_mutex__lock() as well as
+ * svn_mutex__unlock() will be no-ops.
  *
  * If threading is not supported by APR, this function is a no-op.
  */
@@ -67,27 +67,27 @@ svn_mutex__init(svn_mutex__t **mutex,
                 svn_boolean_t mutex_required,
                 apr_pool_t *result_pool);
 
-/** Acquire the @a mutex, if that has been enabled in @ref svn_mutex__init.
- * Make sure to call @ref svn_mutex__unlock some time later in the same
+/** Acquire the @a mutex, if that has been enabled in svn_mutex__init().
+ * Make sure to call svn_mutex__unlock() some time later in the same
  * thread to release the mutex again. Recursive locking are not supported.
  *
- * @note You should use @ref SVN_MUTEX__WITH_LOCK instead of explicit lock
+ * @note You should use #SVN_MUTEX__WITH_LOCK instead of explicit lock
  * aquisition and release.
  */
 svn_error_t *
 svn_mutex__lock(svn_mutex__t *mutex);
 
-/** Release the @a mutex, previously acquired using @ref svn_mutex__lock
- * that has been enabled in @ref svn_mutex__init.
+/** Release the @a mutex, previously acquired using svn_mutex__lock()
+ * that has been enabled in svn_mutex__init().
  *
  * Since this is often used as part of the calling function's exit
  * sequence, we accept that function's current return code in @a err.
- * If it is not @ref SVN_NO_ERROR, it will be used as the return value -
+ * If it is not #SVN_NO_ERROR, it will be used as the return value -
  * irrespective of the possible internal failures during unlock. If @a err
- * is @ref SVN_NO_ERROR, internal failures of this function will be
+ * is #SVN_NO_ERROR, internal failures of this function will be
  * reported in the return value.
  *
- * @note You should use @ref SVN_MUTEX__WITH_LOCK instead of explicit lock
+ * @note You should use #SVN_MUTEX__WITH_LOCK instead of explicit lock
  * aquisition and release.
  */
 svn_error_t *
@@ -96,9 +96,9 @@ svn_mutex__unlock(svn_mutex__t *mutex,
 
 /** Aquires the @a mutex, executes the expression @a expr and finally
  * releases the @a mutex. If any of these steps fail, the function using
- * this macro will return an @ref svn_error_t. This macro guarantees that
+ * this macro will return an #svn_error_t. This macro guarantees that
  * the @a mutex will always be unlocked again if it got locked successfully
- * locked by the first step.
+ * by the first step.
  *
  * @note Prefer using this macro instead of explicit lock aquisition and
  * release.

Modified: subversion/branches/in-repo-authz/subversion/include/private/svn_named_atomic.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/private/svn_named_atomic.h?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/private/svn_named_atomic.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/private/svn_named_atomic.h Wed Dec 19 03:27:09 2012
@@ -100,7 +100,7 @@ svn_atomic_namespace__cleanup(const char
  * be set to @c NULL. Otherwise, a new atomic will be created, its value
  * set to 0 and the access structure be returned in @a *atomic.
  *
- * Note that @a name must not exceed @ref SVN_NAMED_ATOMIC__MAX_NAME_LENGTH
+ * Note that @a name must not exceed #SVN_NAMED_ATOMIC__MAX_NAME_LENGTH
  * characters and an error will be returned if the specified name is longer
  * than supported.
  *

Modified: subversion/branches/in-repo-authz/subversion/include/private/svn_sqlite.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/private/svn_sqlite.h?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/private/svn_sqlite.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/private/svn_sqlite.h Wed Dec 19 03:27:09 2012
@@ -380,6 +380,39 @@ svn_error_t *
 svn_sqlite__reset(svn_sqlite__stmt_t *stmt);
 
 
+/* Begin a transaction in DB. */
+svn_error_t *
+svn_sqlite__begin_transaction(svn_sqlite__db_t *db);
+
+/* Like svn_sqlite__begin_transaction(), but takes out a 'RESERVED' lock
+   immediately, instead of using the default deferred locking scheme. */
+svn_error_t *
+svn_sqlite__begin_immediate_transaction(svn_sqlite__db_t *db);
+
+/* Commit the current transaction in DB if ERR is SVN_NO_ERROR, otherwise
+ * roll back the transaction.  Return a composition of ERR and any error
+ * that may occur during the commit or roll-back. */
+svn_error_t *
+svn_sqlite__finish_transaction(svn_sqlite__db_t *db,
+                               svn_error_t *err);
+
+/* Evaluate the expression EXPR within a transaction.
+ *
+ * Begin a transaction in DB; evaluate the expression EXPR, which would
+ * typically be a function call that does some work in DB; finally commit
+ * the transaction if EXPR evaluated to SVN_NO_ERROR, otherwise roll back
+ * the transaction.
+ */
+#define SVN_SQLITE__WITH_TXN(expr, db)                                        \
+  do {                                                                        \
+    svn_sqlite__db_t *svn_sqlite__db = (db);                                  \
+    svn_error_t *svn_sqlite__err;                                             \
+                                                                              \
+    SVN_ERR(svn_sqlite__begin_transaction(svn_sqlite__db));                   \
+    svn_sqlite__err = (expr);                                                 \
+    SVN_ERR(svn_sqlite__finish_transaction(svn_sqlite__db, svn_sqlite__err)); \
+  } while (0)
+
 /* Callback function to for use with svn_sqlite__with_transaction(). */
 typedef svn_error_t *(*svn_sqlite__transaction_callback_t)(
   void *baton, svn_sqlite__db_t *db, apr_pool_t *scratch_pool);
@@ -394,6 +427,18 @@ svn_sqlite__with_transaction(svn_sqlite_
                              svn_sqlite__transaction_callback_t cb_func,
                              void *cb_baton, apr_pool_t *scratch_pool);
 
+/* Like SVN_SQLITE__WITH_TXN(), but takes out a 'RESERVED' lock
+   immediately, instead of using the default deferred locking scheme. */
+#define SVN_SQLITE__WITH_IMMEDIATE_TXN(expr, db)                              \
+  do {                                                                        \
+    svn_sqlite__db_t *svn_sqlite__db = (db);                                  \
+    svn_error_t *svn_sqlite__err;                                             \
+                                                                              \
+    SVN_ERR(svn_sqlite__begin_immediate_transaction(svn_sqlite__db));         \
+    svn_sqlite__err = (expr);                                                 \
+    SVN_ERR(svn_sqlite__finish_transaction(svn_sqlite__db, svn_sqlite__err)); \
+  } while (0)
+
 /* Like svn_sqlite__with_transaction(), but takes out a 'RESERVED' lock
    immediately, instead of using the default deferred locking scheme. */
 svn_error_t *

Modified: subversion/branches/in-repo-authz/subversion/include/svn_delta.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/svn_delta.h?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/svn_delta.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/svn_delta.h Wed Dec 19 03:27:09 2012
@@ -368,7 +368,7 @@ svn_txdelta_md5_digest(svn_txdelta_strea
  * @a source and @a target are both readable generic streams.  When we call
  * svn_txdelta_next_window() on @a *stream, it will read from @a source and
  * @a target to gather as much data as it needs.  If @a calculate_checksum
- * is set, you may call @ref svn_txdelta_md5_digest to get an MD5 checksum
+ * is set, you may call svn_txdelta_md5_digest() to get an MD5 checksum
  * for @a target.
  *
  * Do any necessary allocation in a sub-pool of @a pool.

Modified: subversion/branches/in-repo-authz/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/svn_io.h?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/svn_io.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/svn_io.h Wed Dec 19 03:27:09 2012
@@ -724,7 +724,7 @@ svn_io_file_lock2(const char *lock_file,
  * is not available: throw an error instead.
  *
  * Lock will be automatically released when @a pool is cleared or destroyed.
- * You may also explicitly call @ref svn_io_unlock_open_file.
+ * You may also explicitly call svn_io_unlock_open_file().
  * Use @a pool for memory allocations. @a pool must be the pool that
  * @a lockfile_handle has been created in or one of its sub-pools.
  *

Modified: subversion/branches/in-repo-authz/subversion/include/svn_pools.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/svn_pools.h?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/svn_pools.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/svn_pools.h Wed Dec 19 03:27:09 2012
@@ -87,7 +87,7 @@ svn_pool_create_ex_debug(pool, allocator
 #define svn_pool_destroy apr_pool_destroy
 
 /** Return a new allocator.  This function limits the unused memory in the
- * new allocator to @ref SVN_ALLOCATOR_RECOMMENDED_MAX_FREE and ensures
+ * new allocator to #SVN_ALLOCATOR_RECOMMENDED_MAX_FREE and ensures
  * proper synchronization if the allocator is used by multiple threads.
  *
  * If your application uses multiple threads, creating a separate allocator

Modified: subversion/branches/in-repo-authz/subversion/include/svn_props.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/svn_props.h?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/svn_props.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/svn_props.h Wed Dec 19 03:27:09 2012
@@ -110,7 +110,7 @@ typedef struct svn_prop_inherited_item_t
  * @since New in 1.5.
  */
 apr_array_header_t *
-svn_prop_hash_to_array(apr_hash_t *hash,
+svn_prop_hash_to_array(const apr_hash_t *hash,
                        apr_pool_t *pool);
 
 /**
@@ -133,7 +133,7 @@ svn_prop_array_to_hash(const apr_array_h
  * @since New in 1.6.
  */
 apr_hash_t *
-svn_prop_hash_dup(apr_hash_t *hash,
+svn_prop_hash_dup(const apr_hash_t *hash,
                   apr_pool_t *pool);
 
 /**
@@ -144,7 +144,7 @@ svn_prop_hash_dup(apr_hash_t *hash,
  * @since New in 1.7.
  */
 const char *
-svn_prop_get_value(apr_hash_t *properties,
+svn_prop_get_value(const apr_hash_t *properties,
                    const char *prop_name);
 
 /**
@@ -317,8 +317,8 @@ svn_categorize_props(const apr_array_hea
  */
 svn_error_t *
 svn_prop_diffs(apr_array_header_t **propdiffs,
-               apr_hash_t *target_props,
-               apr_hash_t *source_props,
+               const apr_hash_t *target_props,
+               const apr_hash_t *source_props,
                apr_pool_t *pool);
 
 

Modified: subversion/branches/in-repo-authz/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_fs_fs/fs_fs.c?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_fs_fs/fs_fs.c Wed Dec 19 03:27:09 2012
@@ -8560,23 +8560,6 @@ write_reps_to_cache(svn_fs_t *fs,
   return SVN_NO_ERROR;
 }
 
-/* Implements svn_sqlite__transaction_callback_t. */
-static svn_error_t *
-commit_sqlite_txn_callback(void *baton, svn_sqlite__db_t *db,
-                           apr_pool_t *scratch_pool)
-{
-  struct commit_baton *cb = baton;
-
-  /* Write new entries to the rep-sharing database.
-   *
-   * We use an sqlite transcation to speed things up;
-   * see <http://www.sqlite.org/faq.html#q19>.
-   */
-  SVN_ERR(write_reps_to_cache(cb->fs, cb->reps_to_cache, scratch_pool));
-
-  return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_fs_fs__commit(svn_revnum_t *new_rev_p,
                   svn_fs_t *fs,
@@ -8611,9 +8594,15 @@ svn_fs_fs__commit(svn_revnum_t *new_rev_
   if (ffd->rep_sharing_allowed)
     {
       SVN_ERR(svn_fs_fs__open_rep_cache(fs, pool));
-      SVN_ERR(svn_sqlite__with_transaction(ffd->rep_cache_db,
-                                           commit_sqlite_txn_callback,
-                                           &cb, pool));
+
+      /* Write new entries to the rep-sharing database.
+       *
+       * We use an sqlite transaction to speed things up;
+       * see <http://www.sqlite.org/faq.html#q19>.
+       */
+      SVN_SQLITE__WITH_TXN(
+        write_reps_to_cache(fs, cb.reps_to_cache, pool),
+        ffd->rep_cache_db);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/in-repo-authz/subversion/libsvn_subr/opt.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_subr/opt.c?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_subr/opt.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_subr/opt.c Wed Dec 19 03:27:09 2012
@@ -34,10 +34,6 @@
 #include <apr_lib.h>
 #include <apr_file_info.h>
 
-#ifndef WIN32
-#include <unistd.h>
-#endif
-
 #include "svn_cmdline.h"
 #include "svn_version.h"
 #include "svn_types.h"

Modified: subversion/branches/in-repo-authz/subversion/libsvn_subr/properties.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_subr/properties.c?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_subr/properties.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_subr/properties.c Wed Dec 19 03:27:09 2012
@@ -244,8 +244,8 @@ svn_categorize_props(const apr_array_hea
 
 svn_error_t *
 svn_prop_diffs(apr_array_header_t **propdiffs,
-               apr_hash_t *target_props,
-               apr_hash_t *source_props,
+               const apr_hash_t *target_props,
+               const apr_hash_t *source_props,
                apr_pool_t *pool)
 {
   apr_hash_index_t *hi;
@@ -257,7 +257,8 @@ svn_prop_diffs(apr_array_header_t **prop
 
   /* Loop over SOURCE_PROPS and examine each key.  This will allow us to
      detect any `deletion' events or `set-modification' events.  */
-  for (hi = apr_hash_first(pool, source_props); hi; hi = apr_hash_next(hi))
+  for (hi = apr_hash_first(pool, (apr_hash_t *)source_props); hi;
+       hi = apr_hash_next(hi))
     {
       const void *key;
       apr_ssize_t klen;
@@ -269,7 +270,7 @@ svn_prop_diffs(apr_array_header_t **prop
       propval1 = val;
 
       /* Does property name exist in TARGET_PROPS? */
-      propval2 = apr_hash_get(target_props, key, klen);
+      propval2 = apr_hash_get((apr_hash_t *)target_props, key, klen);
 
       if (propval2 == NULL)
         {
@@ -289,7 +290,8 @@ svn_prop_diffs(apr_array_header_t **prop
 
   /* Loop over TARGET_PROPS and examine each key.  This allows us to
      detect `set-creation' events */
-  for (hi = apr_hash_first(pool, target_props); hi; hi = apr_hash_next(hi))
+  for (hi = apr_hash_first(pool, (apr_hash_t *)target_props); hi;
+       hi = apr_hash_next(hi))
     {
       const void *key;
       apr_ssize_t klen;
@@ -301,7 +303,7 @@ svn_prop_diffs(apr_array_header_t **prop
       propval = val;
 
       /* Does property name exist in SOURCE_PROPS? */
-      if (NULL == apr_hash_get(source_props, key, klen))
+      if (NULL == apr_hash_get((apr_hash_t *)source_props, key, klen))
         {
           /* Add a set (creation) event to the array */
           svn_prop_t *p = apr_array_push(ary);
@@ -354,13 +356,16 @@ svn_prop_array_dup(const apr_array_heade
 }
 
 apr_array_header_t *
-svn_prop_hash_to_array(apr_hash_t *hash, apr_pool_t *pool)
+svn_prop_hash_to_array(const apr_hash_t *hash,
+                       apr_pool_t *pool)
 {
   apr_hash_index_t *hi;
-  apr_array_header_t *array = apr_array_make(pool, apr_hash_count(hash),
+  apr_array_header_t *array = apr_array_make(pool,
+                                             apr_hash_count((apr_hash_t *)hash),
                                              sizeof(svn_prop_t));
 
-  for (hi = apr_hash_first(pool, hash); hi; hi = apr_hash_next(hi))
+  for (hi = apr_hash_first(pool, (apr_hash_t *)hash); hi;
+       hi = apr_hash_next(hi))
     {
       const void *key;
       void *val;
@@ -376,13 +381,14 @@ svn_prop_hash_to_array(apr_hash_t *hash,
 }
 
 apr_hash_t *
-svn_prop_hash_dup(apr_hash_t *hash,
+svn_prop_hash_dup(const apr_hash_t *hash,
                   apr_pool_t *pool)
 {
   apr_hash_index_t *hi;
   apr_hash_t *new_hash = apr_hash_make(pool);
 
-  for (hi = apr_hash_first(pool, hash); hi; hi = apr_hash_next(hi))
+  for (hi = apr_hash_first(pool, (apr_hash_t *)hash); hi;
+       hi = apr_hash_next(hi))
     {
       const void *key;
       apr_ssize_t klen;
@@ -465,7 +471,7 @@ svn_prop_name_is_valid(const char *prop_
 }
 
 const char *
-svn_prop_get_value(apr_hash_t *props,
+svn_prop_get_value(const apr_hash_t *props,
                    const char *prop_name)
 {
   svn_string_t *str;
@@ -473,7 +479,7 @@ svn_prop_get_value(apr_hash_t *props,
   if (!props)
     return NULL;
 
-  str = apr_hash_get(props, prop_name, APR_HASH_KEY_STRING);
+  str = apr_hash_get((apr_hash_t *)props, prop_name, APR_HASH_KEY_STRING);
 
   if (str)
     return str->data;

Modified: subversion/branches/in-repo-authz/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_subr/sqlite.c?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_subr/sqlite.c Wed Dec 19 03:27:09 2012
@@ -992,18 +992,33 @@ reset_all_statements(svn_sqlite__db_t *d
   return err;
 }
 
-/* The body of svn_sqlite__with_transaction() and
-   svn_sqlite__with_immediate_transaction(), which see. */
-static svn_error_t *
-with_transaction(svn_sqlite__db_t *db,
-                 svn_sqlite__transaction_callback_t cb_func,
-                 void *cb_baton,
-                 apr_pool_t *scratch_pool /* NULL allowed */)
+svn_error_t *
+svn_sqlite__begin_transaction(svn_sqlite__db_t *db)
 {
   svn_sqlite__stmt_t *stmt;
-  svn_error_t *err;
 
-  err = cb_func(cb_baton, db, scratch_pool);
+  SVN_ERR(get_internal_statement(&stmt, db,
+                                 STMT_INTERNAL_BEGIN_TRANSACTION));
+  SVN_ERR(svn_sqlite__step_done(stmt));
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_sqlite__begin_immediate_transaction(svn_sqlite__db_t *db)
+{
+  svn_sqlite__stmt_t *stmt;
+
+  SVN_ERR(get_internal_statement(&stmt, db,
+                                 STMT_INTERNAL_BEGIN_IMMEDIATE_TRANSACTION));
+  SVN_ERR(svn_sqlite__step_done(stmt));
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_sqlite__finish_transaction(svn_sqlite__db_t *db,
+                               svn_error_t *err)
+{
+  svn_sqlite__stmt_t *stmt;
 
   /* Commit or rollback the sqlite transaction. */
   if (err)
@@ -1056,12 +1071,8 @@ svn_sqlite__with_transaction(svn_sqlite_
                              void *cb_baton,
                              apr_pool_t *scratch_pool /* NULL allowed */)
 {
-  svn_sqlite__stmt_t *stmt;
-  SVN_ERR(get_internal_statement(&stmt, db,
-                                 STMT_INTERNAL_BEGIN_TRANSACTION));
-  SVN_ERR(svn_sqlite__step_done(stmt));
-  return svn_error_trace(with_transaction(db, cb_func, cb_baton,
-                                          scratch_pool));
+  SVN_SQLITE__WITH_TXN(cb_func(cb_baton, db, scratch_pool), db);
+  return SVN_NO_ERROR;
 }
 
 svn_error_t *
@@ -1071,12 +1082,8 @@ svn_sqlite__with_immediate_transaction(
   void *cb_baton,
   apr_pool_t *scratch_pool /* NULL allowed */)
 {
-  svn_sqlite__stmt_t *stmt;
-  SVN_ERR(get_internal_statement(&stmt, db,
-                                 STMT_INTERNAL_BEGIN_IMMEDIATE_TRANSACTION));
-  SVN_ERR(svn_sqlite__step_done(stmt));
-  return svn_error_trace(with_transaction(db, cb_func, cb_baton,
-                                          scratch_pool));
+  SVN_SQLITE__WITH_IMMEDIATE_TXN(cb_func(cb_baton, db, scratch_pool), db);
+  return SVN_NO_ERROR;
 }
 
 svn_error_t *

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/props.c?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/props.c Wed Dec 19 03:27:09 2012
@@ -1573,12 +1573,15 @@ validate_prop_against_node_kind(const ch
 
 
 struct getter_baton {
+  const svn_string_t *mime_type;
   const char *local_abspath;
-  svn_wc__db_t *db;
 };
 
 
-/* */
+/* Provide the MIME_TYPE and/or push the content to STREAM for the file
+ * referenced by (getter_baton *) BATON.
+ *
+ * Implements svn_wc_canonicalize_svn_prop_get_file_t. */
 static svn_error_t *
 get_file_for_validation(const svn_string_t **mime_type,
                         svn_stream_t *stream,
@@ -1588,18 +1591,15 @@ get_file_for_validation(const svn_string
   struct getter_baton *gb = baton;
 
   if (mime_type)
-    SVN_ERR(svn_wc__internal_propget(mime_type, gb->db, gb->local_abspath,
-                                     SVN_PROP_MIME_TYPE, pool, pool));
+    *mime_type = gb->mime_type;
 
   if (stream)
     {
       svn_stream_t *read_stream;
 
-      /* Open GB->LOCAL_ABSPATH. */
+      /* Copy the text of GB->LOCAL_ABSPATH into STREAM. */
       SVN_ERR(svn_stream_open_readonly(&read_stream, gb->local_abspath,
                                        pool, pool));
-
-      /* Copy from the file into the translating stream. */
       SVN_ERR(svn_stream_copy3(read_stream, svn_stream_disown(stream, pool),
                                NULL, NULL, pool));
     }
@@ -1608,7 +1608,16 @@ get_file_for_validation(const svn_string
 }
 
 
-/* */
+/* Validate that a file has a 'non-binary' MIME type and contains
+ * self-consistent line endings.  If not, then return an error.
+ *
+ * Call GETTER (which must not be NULL) with GETTER_BATON to get the
+ * file's MIME type and/or content.  If the MIME type is non-null and
+ * is categorized as 'binary' then return an error and do not request
+ * the file content.
+ *
+ * Use PATH (a local path or a URL) only for error messages.
+ */
 static svn_error_t *
 validate_eol_prop_against_file(const char *path,
                                svn_wc_canonicalize_svn_prop_get_file_t getter,
@@ -1670,6 +1679,10 @@ do_propset(svn_wc__db_t *db,
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
+  SVN_ERR_W(svn_wc__db_read_props(&prophash, db, local_abspath,
+                                  scratch_pool, scratch_pool),
+            _("Failed to load current properties"));
+
   /* Setting an inappropriate property is not allowed (unless
      overridden by 'skip_checks', in some circumstances).  Deleting an
      inappropriate property is allowed, however, since older clients
@@ -1680,8 +1693,9 @@ do_propset(svn_wc__db_t *db,
       const svn_string_t *new_value;
       struct getter_baton gb;
 
+      gb.mime_type = apr_hash_get(prophash,
+                                  SVN_PROP_MIME_TYPE, APR_HASH_KEY_STRING);
       gb.local_abspath = local_abspath;
-      gb.db = db;
 
       SVN_ERR(svn_wc_canonicalize_svn_prop(&new_value, name, value,
                                            local_abspath, kind,
@@ -1699,10 +1713,6 @@ do_propset(svn_wc__db_t *db,
                                                scratch_pool, scratch_pool));
     }
 
-  SVN_ERR_W(svn_wc__db_read_props(&prophash, db, local_abspath,
-                                  scratch_pool, scratch_pool),
-            _("Failed to load current properties"));
-
   /* If we're changing this file's list of expanded keywords, then
    * we'll need to invalidate its text timestamp, since keyword
    * expansion affects the comparison of working file to text base.

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_pristine.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_pristine.c?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_pristine.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_pristine.c Wed Dec 19 03:27:09 2012
@@ -288,20 +288,6 @@ svn_wc__db_pristine_get_tempdir(const ch
 }
 
 
-/* Data for pristine_install_txn(). */
-typedef struct pristine_install_baton_t
-{
-  /* The path to the source file that is to be moved into place. */
-  const char *tempfile_abspath;
-  /* The target path for the file (within the pristine store). */
-  const char *pristine_abspath;
-  /* The pristine text's SHA-1 checksum. */
-  const svn_checksum_t *sha1_checksum;
-  /* The pristine text's MD-5 checksum. */
-  const svn_checksum_t *md5_checksum;
-} pristine_install_baton_t;
-
-
 /* Install the pristine text described by BATON into the pristine store of
  * SDB.  If it is already stored then just delete the new file
  * BATON->tempfile_abspath.
@@ -312,11 +298,17 @@ typedef struct pristine_install_baton_t
  * Implements 'notes/wc-ng/pristine-store' section A-3(a).
  * Implements svn_sqlite__transaction_callback_t. */
 static svn_error_t *
-pristine_install_txn(void *baton,
-                     svn_sqlite__db_t *sdb,
+pristine_install_txn(svn_sqlite__db_t *sdb,
+                     /* The path to the source file that is to be moved into place. */
+                     const char *tempfile_abspath,
+                     /* The target path for the file (within the pristine store). */
+                     const char *pristine_abspath,
+                     /* The pristine text's SHA-1 checksum. */
+                     const svn_checksum_t *sha1_checksum,
+                     /* The pristine text's MD-5 checksum. */
+                     const svn_checksum_t *md5_checksum,
                      apr_pool_t *scratch_pool)
 {
-  pristine_install_baton_t *b = baton;
   apr_finfo_t finfo;
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
@@ -325,7 +317,7 @@ pristine_install_txn(void *baton,
   /* If this pristine text is already present in the store, just keep it:
    * delete the new one and return. */
   SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_SELECT_PRISTINE));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, b->sha1_checksum, scratch_pool));
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   SVN_ERR(svn_sqlite__reset(stmt));
   if (have_row)
@@ -335,30 +327,30 @@ pristine_install_txn(void *baton,
        * ### We could check much more. */
       {
         apr_finfo_t finfo1, finfo2;
-        SVN_ERR(svn_io_stat(&finfo1, b->tempfile_abspath, APR_FINFO_SIZE,
+        SVN_ERR(svn_io_stat(&finfo1, tempfile_abspath, APR_FINFO_SIZE,
                             scratch_pool));
-        SVN_ERR(svn_io_stat(&finfo2, b->pristine_abspath, APR_FINFO_SIZE,
+        SVN_ERR(svn_io_stat(&finfo2, pristine_abspath, APR_FINFO_SIZE,
                             scratch_pool));
         if (finfo1.size != finfo2.size)
           {
             return svn_error_createf(
               SVN_ERR_WC_CORRUPT_TEXT_BASE, NULL,
               _("New pristine text '%s' has different size: %ld versus %ld"),
-              svn_checksum_to_cstring_display(b->sha1_checksum, scratch_pool),
+              svn_checksum_to_cstring_display(sha1_checksum, scratch_pool),
               (long int)finfo1.size, (long int)finfo2.size);
           }
       }
 #endif
 
       /* Remove the temp file: it's already there */
-      SVN_ERR(svn_io_remove_file2(b->tempfile_abspath,
+      SVN_ERR(svn_io_remove_file2(tempfile_abspath,
                                   FALSE /* ignore_enoent */, scratch_pool));
       return SVN_NO_ERROR;
     }
 
   /* Move the file to its target location.  (If it is already there, it is
    * an orphan file and it doesn't matter if we overwrite it.) */
-  err = svn_io_file_rename(b->tempfile_abspath, b->pristine_abspath,
+  err = svn_io_file_rename(tempfile_abspath, pristine_abspath,
                            scratch_pool);
 
   /* Maybe the directory doesn't exist yet? */
@@ -366,7 +358,7 @@ pristine_install_txn(void *baton,
     {
       svn_error_t *err2;
 
-      err2 = svn_io_dir_make(svn_dirent_dirname(b->pristine_abspath,
+      err2 = svn_io_dir_make(svn_dirent_dirname(pristine_abspath,
                                                 scratch_pool),
                              APR_OS_DEFAULT, scratch_pool);
 
@@ -377,19 +369,19 @@ pristine_install_txn(void *baton,
         /* We could create a directory: retry install */
         svn_error_clear(err);
 
-      SVN_ERR(svn_io_file_rename(b->tempfile_abspath, b->pristine_abspath,
+      SVN_ERR(svn_io_file_rename(tempfile_abspath, pristine_abspath,
                            scratch_pool));
     }
   else
     SVN_ERR(err);
 
-  SVN_ERR(svn_io_stat(&finfo, b->pristine_abspath, APR_FINFO_SIZE,
+  SVN_ERR(svn_io_stat(&finfo, pristine_abspath, APR_FINFO_SIZE,
                       scratch_pool));
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
                                     STMT_INSERT_PRISTINE));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, b->sha1_checksum, scratch_pool));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 2, b->md5_checksum, scratch_pool));
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 2, md5_checksum, scratch_pool));
   SVN_ERR(svn_sqlite__bind_int64(stmt, 3, finfo.size));
   SVN_ERR(svn_sqlite__insert(NULL, stmt));
 
@@ -407,7 +399,7 @@ svn_wc__db_pristine_install(svn_wc__db_t
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
   const char *wri_abspath;
-  struct pristine_install_baton_t b;
+  const char *pristine_abspath;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(tempfile_abspath));
   SVN_ERR_ASSERT(sha1_checksum != NULL);
@@ -429,19 +421,18 @@ svn_wc__db_pristine_install(svn_wc__db_t
                               wri_abspath, scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
-  b.tempfile_abspath = tempfile_abspath;
-  b.sha1_checksum = sha1_checksum;
-  b.md5_checksum = md5_checksum;
-
-  SVN_ERR(get_pristine_fname(&b.pristine_abspath, wcroot->abspath,
+  SVN_ERR(get_pristine_fname(&pristine_abspath, wcroot->abspath,
                              sha1_checksum,
                              scratch_pool, scratch_pool));
 
   /* Ensure the SQL txn has at least a 'RESERVED' lock before we start looking
    * at the disk, to ensure no concurrent pristine install/delete txn. */
-  SVN_ERR(svn_sqlite__with_immediate_transaction(wcroot->sdb,
-                                                 pristine_install_txn, &b,
-                                                 scratch_pool));
+  SVN_SQLITE__WITH_IMMEDIATE_TXN(
+    pristine_install_txn(wcroot->sdb,
+                         tempfile_abspath, pristine_abspath,
+                         sha1_checksum, md5_checksum,
+                         scratch_pool),
+    wcroot->sdb);
 
   return SVN_NO_ERROR;
 }
@@ -531,8 +522,15 @@ struct pristine_transfer_baton
   svn_cancel_func_t cancel_func;
   void * cancel_baton;
 
-  /* pristine install baton, filled from pristine_transfer() */
-  struct pristine_install_baton_t ib;
+  /* The following fields are filled in by pristine_transfer(). */
+  /* The path to the source file that is to be moved into place. */
+  const char *tempfile_abspath;
+  /* The target path for the file (within the pristine store). */
+  const char *pristine_abspath;
+  /* The pristine text's SHA-1 checksum. */
+  const svn_checksum_t *sha1_checksum;
+  /* The pristine text's MD-5 checksum. */
+  const svn_checksum_t *md5_checksum;
 };
 
 /* Transaction implementation of svn_wc__db_pristine_transfer().
@@ -555,8 +553,12 @@ pristine_transfer(void *baton, svn_wc__d
                                   pristine_transfer, tb, scratch_pool));
 
       /* And do the final install, while we still have the dst lock */
-      if (tb->ib.tempfile_abspath)
-        SVN_ERR(pristine_install_txn(&(tb->ib), tb->dst_wcroot->sdb,
+      if (tb->tempfile_abspath)
+        SVN_ERR(pristine_install_txn(tb->dst_wcroot->sdb,
+                                     tb->tempfile_abspath,
+                                     tb->pristine_abspath,
+                                     tb->sha1_checksum,
+                                     tb->md5_checksum,
                                      scratch_pool));
       return SVN_NO_ERROR;
     }
@@ -564,7 +566,7 @@ pristine_transfer(void *baton, svn_wc__d
   /* We have a lock on tb->dst_wcroot and tb->src_wcroot */
 
   /* Get the right checksum if it wasn't passed */
-  if (!tb->ib.sha1_checksum)
+  if (!tb->sha1_checksum)
     {
       SVN_ERR(svn_sqlite__get_statement(&stmt, tb->src_wcroot->sdb,
                                         STMT_SELECT_NODE_INFO));
@@ -575,19 +577,19 @@ pristine_transfer(void *baton, svn_wc__d
       SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
       if (have_row)
-        SVN_ERR(svn_sqlite__column_checksum(&(tb->ib.sha1_checksum), stmt, 6,
+        SVN_ERR(svn_sqlite__column_checksum(&(tb->sha1_checksum), stmt, 6,
                                             scratch_pool));
 
       SVN_ERR(svn_sqlite__reset(stmt));
 
-      if (!tb->ib.sha1_checksum)
+      if (!tb->sha1_checksum)
         return SVN_NO_ERROR; /* Nothing to transfer */
     }
 
   /* Check if we have the pristine in the destination wcroot */
   SVN_ERR(svn_sqlite__get_statement(&stmt, tb->dst_wcroot->sdb,
                                     STMT_SELECT_PRISTINE));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, tb->ib.sha1_checksum,
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, tb->sha1_checksum,
                                     scratch_pool));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   SVN_ERR(svn_sqlite__reset(stmt));
@@ -599,7 +601,7 @@ pristine_transfer(void *baton, svn_wc__d
   /* Verify if the pristine actually exists and get the MD5 in one query */
   SVN_ERR(svn_sqlite__get_statement(&stmt, tb->src_wcroot->sdb,
                                     STMT_SELECT_PRISTINE));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, tb->ib.sha1_checksum,
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, tb->sha1_checksum,
                                     scratch_pool));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
@@ -609,9 +611,9 @@ pristine_transfer(void *baton, svn_wc__d
                                _("The pristine text with checksum '%s' was "
                                  "not found"),
                                svn_checksum_to_cstring_display(
-                                        tb->ib.sha1_checksum, scratch_pool));
+                                        tb->sha1_checksum, scratch_pool));
     }
-  SVN_ERR(svn_sqlite__column_checksum(&(tb->ib.md5_checksum), stmt, 0,
+  SVN_ERR(svn_sqlite__column_checksum(&(tb->md5_checksum), stmt, 0,
                                       scratch_pool));
   SVN_ERR(svn_sqlite__reset(stmt));
 
@@ -631,7 +633,7 @@ pristine_transfer(void *baton, svn_wc__d
                                    scratch_pool, scratch_pool));
 
     SVN_ERR(get_pristine_fname(&src_abspath, tb->src_wcroot->abspath,
-                               tb->ib.sha1_checksum,
+                               tb->sha1_checksum,
                                scratch_pool, scratch_pool));
 
     SVN_ERR(svn_stream_open_readonly(&src_stream, src_abspath,
@@ -645,11 +647,11 @@ pristine_transfer(void *baton, svn_wc__d
     /* And now set the right information to install once we leave the
        src transaction */
 
-    SVN_ERR(get_pristine_fname(&(tb->ib.pristine_abspath),
+    SVN_ERR(get_pristine_fname(&(tb->pristine_abspath),
                                tb->dst_wcroot->abspath,
-                               tb->ib.sha1_checksum,
+                               tb->sha1_checksum,
                                scratch_pool, scratch_pool));
-    tb->ib.tempfile_abspath = tmp_abspath;
+    tb->tempfile_abspath = tmp_abspath;
   }
   return SVN_NO_ERROR;
 }
@@ -730,17 +732,8 @@ remove_file(const char *file_abspath,
   return SVN_NO_ERROR;
 }
 
-/* Data for pristine_remove_if_unreferenced_txn(). */
-typedef struct pristine_remove_baton_t
-{
-  svn_wc__db_wcroot_t *wcroot;
-  /* The pristine text's SHA-1 checksum. */
-  const svn_checksum_t *sha1_checksum;
-  /* The path to the pristine file (within the pristine store). */
-  const char *pristine_abspath;
-} pristine_remove_baton_t;
-
-/* If the pristine text referenced by BATON in SDB has a reference count of
+/* If the pristine text referenced by SHA1_CHECKSUM in WCROOT/SDB, whose path
+ * within the pristine store is PRISTINE_ABSPATH, has a reference count of
  * zero, delete it (both the database row and the disk file).
  *
  * This function expects to be executed inside a SQLite txn that has already
@@ -748,18 +741,19 @@ typedef struct pristine_remove_baton_t
  *
  * Implements svn_sqlite__transaction_callback_t. */
 static svn_error_t *
-pristine_remove_if_unreferenced_txn(void *baton,
-                                    svn_sqlite__db_t *sdb,
+pristine_remove_if_unreferenced_txn(svn_sqlite__db_t *sdb,
+                                    svn_wc__db_wcroot_t *wcroot,
+                                    const svn_checksum_t *sha1_checksum,
+                                    const char *pristine_abspath,
                                     apr_pool_t *scratch_pool)
 {
-  pristine_remove_baton_t *b = baton;
   svn_sqlite__stmt_t *stmt;
   int affected_rows;
 
   /* Remove the DB row, if refcount is 0. */
   SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
                                     STMT_DELETE_PRISTINE_IF_UNREFERENCED));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, b->sha1_checksum, scratch_pool));
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
   SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
 
   /* If we removed the DB row, then remove the file. */
@@ -774,7 +768,7 @@ pristine_remove_if_unreferenced_txn(void
       svn_boolean_t ignore_enoent = TRUE;
 #endif
 
-      SVN_ERR(remove_file(b->pristine_abspath, b->wcroot, ignore_enoent,
+      SVN_ERR(remove_file(pristine_abspath, wcroot, ignore_enoent,
                           scratch_pool));
     }
 
@@ -791,17 +785,17 @@ pristine_remove_if_unreferenced(svn_wc__
                                 const svn_checksum_t *sha1_checksum,
                                 apr_pool_t *scratch_pool)
 {
-  pristine_remove_baton_t b;
+  const char *pristine_abspath;
 
-  b.wcroot = wcroot;
-  b.sha1_checksum = sha1_checksum;
-  SVN_ERR(get_pristine_fname(&b.pristine_abspath, wcroot->abspath,
+  SVN_ERR(get_pristine_fname(&pristine_abspath, wcroot->abspath,
                              sha1_checksum, scratch_pool, scratch_pool));
 
   /* Ensure the SQL txn has at least a 'RESERVED' lock before we start looking
    * at the disk, to ensure no concurrent pristine install/delete txn. */
-  SVN_ERR(svn_sqlite__with_immediate_transaction(
-    wcroot->sdb, pristine_remove_if_unreferenced_txn, &b, scratch_pool));
+  SVN_SQLITE__WITH_IMMEDIATE_TXN(
+    pristine_remove_if_unreferenced_txn(
+      wcroot->sdb, wcroot, sha1_checksum, pristine_abspath, scratch_pool),
+    wcroot->sdb);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/in-repo-authz/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/svnrdump/dump_editor.c?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/svnrdump/dump_editor.c (original)
+++ subversion/branches/in-repo-authz/subversion/svnrdump/dump_editor.c Wed Dec 19 03:27:09 2012
@@ -323,13 +323,15 @@ dump_node(struct dump_edit_baton *eb,
 
   /* Add the edit root relpath prefix if necessary. */
   if (eb->update_anchor_relpath)
-    node_relpath = svn_relpath_join(eb->update_anchor_relpath, node_relpath, pool);
+    node_relpath = svn_relpath_join(eb->update_anchor_relpath,
+                                    node_relpath, pool);
 
-  /* Node-path: commons/STATUS */
+  /* Node-path: ... */
   SVN_ERR(svn_stream_printf(eb->stream, pool,
-                            SVN_REPOS_DUMPFILE_NODE_PATH ": %s\n", node_relpath));
+                            SVN_REPOS_DUMPFILE_NODE_PATH ": %s\n",
+                            node_relpath));
 
-  /* Node-kind: file */
+  /* Node-kind: "file" | "dir" */
   if (kind == svn_node_file)
     SVN_ERR(svn_stream_printf(eb->stream, pool,
                               SVN_REPOS_DUMPFILE_NODE_KIND ": file\n"));
@@ -344,13 +346,24 @@ dump_node(struct dump_edit_baton *eb,
     case svn_node_action_change:
       /* We are here after a change_file_prop or change_dir_prop. They
          set up whatever dump_props they needed to- nothing to
-         do here but print node action information */
+         do here but print node action information.
+
+         Node-action: change.  */
       SVN_ERR(svn_stream_puts(eb->stream,
                               SVN_REPOS_DUMPFILE_NODE_ACTION ": change\n"));
       break;
 
     case svn_node_action_replace:
-      if (!is_copy)
+      if (is_copy)
+        {
+          /* Delete the original, and then re-add the replacement as a
+             copy using recursive calls into this function. */
+          SVN_ERR(dump_node(eb, repos_relpath, kind, svn_node_action_delete,
+                            FALSE, NULL, SVN_INVALID_REVNUM, pool));
+          SVN_ERR(dump_node(eb, repos_relpath, kind, svn_node_action_add,
+                            is_copy, copyfrom_path, copyfrom_rev, pool));
+        }
+      else
         {
           /* Node-action: replace */
           SVN_ERR(svn_stream_puts(eb->stream,
@@ -360,24 +373,11 @@ dump_node(struct dump_edit_baton *eb,
           /* Wait for a change_*_prop to be called before dumping
              anything */
           eb->dump_props = TRUE;
-          break;
         }
-      /* More complex case: is_copy is true, and copyfrom_path/
-         copyfrom_rev are present: delete the original, and then re-add
-         it */
-
-      SVN_ERR(svn_stream_puts(eb->stream,
-                              SVN_REPOS_DUMPFILE_NODE_ACTION ": delete\n\n"));
-
-      /* Recurse: Print an additional add-with-history record. */
-      SVN_ERR(dump_node(eb, repos_relpath, kind, svn_node_action_add,
-                        is_copy, copyfrom_path, copyfrom_rev, pool));
-
-      /* We can leave this routine quietly now, don't need to dump any
-         content; that was already done in the second record. */
       break;
 
     case svn_node_action_delete:
+      /* Node-action: delete */
       SVN_ERR(svn_stream_puts(eb->stream,
                               SVN_REPOS_DUMPFILE_NODE_ACTION ": delete\n"));
 
@@ -385,44 +385,54 @@ dump_node(struct dump_edit_baton *eb,
          print a couple of newlines because we're not dumping props or
          text. */
       SVN_ERR(svn_stream_puts(eb->stream, "\n\n"));
+
       break;
 
     case svn_node_action_add:
+      /* Node-action: add */
       SVN_ERR(svn_stream_puts(eb->stream,
                               SVN_REPOS_DUMPFILE_NODE_ACTION ": add\n"));
 
-      if (!is_copy)
+      if (is_copy)
         {
-          /* eb->dump_props for files is handled in close_file
-             which is called immediately.  However, directories are not
-             closed until all the work inside them has been done;
-             eb->dump_props for directories is handled in all the
-             functions that can possibly be called after add_directory:
-             add_directory, open_directory, delete_entry, close_directory,
-             add_file, open_file. change_dir_prop is a special case. */
-
-          /* Wait for a change_*_prop to be called before dumping
-             anything */
-          eb->dump_props = TRUE;
-          break;
+          /* Node-copyfrom-rev / Node-copyfrom-path */
+          SVN_ERR(svn_stream_printf(eb->stream, pool,
+                                    SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV
+                                    ": %ld\n"
+                                    SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH
+                                    ": %s\n",
+                                    copyfrom_rev, copyfrom_path));
+
+          /* Ugly hack: If a directory was copied from a previous
+             revision, nothing like close_file() will be called to write two
+             blank lines. If change_dir_prop() is called, props are dumped
+             (along with the necessary PROPS-END\n\n and we're good. So
+             set DUMP_NEWLINES here to print the newlines unless
+             change_dir_prop() is called next otherwise the `svnadmin load`
+             parser will fail.  */
+          if (kind == svn_node_dir)
+            eb->dump_newlines = TRUE;
         }
+      else
+        {
+          /* eb->dump_props (for files) is handled in close_file()
+             which is called immediately.
 
-      SVN_ERR(svn_stream_printf(eb->stream, pool,
-                                SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV
-                                ": %ld\n"
-                                SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH
-                                ": %s\n",
-                                copyfrom_rev, copyfrom_path));
+             However, directories are not closed until all the work
+             inside them has been done; eb->dump_props (for directories)
+             is handled (via dump_pending()) in all the functions that
+             can possibly be called after add_directory():
+
+               - add_directory()
+               - open_directory()
+               - delete_entry()
+               - close_directory()
+               - add_file()
+               - open_file()
 
-      /* Ugly hack: If a directory was copied from a previous
-         revision, nothing like close_file() will be called to write two
-         blank lines. If change_dir_prop() is called, props are dumped
-         (along with the necessary PROPS-END\n\n and we're good. So
-         set DUMP_NEWLINES here to print the newlines unless
-         change_dir_prop() is called next otherwise the `svnadmin load`
-         parser will fail.  */
-      if (kind == svn_node_dir)
-        eb->dump_newlines = TRUE;
+             change_dir_prop() is a special case. */
+          eb->dump_props = TRUE;
+        }
 
       break;
     }
@@ -440,7 +450,8 @@ dump_mkdir(struct dump_edit_baton *eb,
 
   /* Node-path: ... */
   SVN_ERR(svn_stream_printf(eb->stream, pool,
-                            SVN_REPOS_DUMPFILE_NODE_PATH ": %s\n", repos_relpath));
+                            SVN_REPOS_DUMPFILE_NODE_PATH ": %s\n",
+                            repos_relpath));
 
   /* Node-kind: dir */
   SVN_ERR(svn_stream_printf(eb->stream, pool,

Modified: subversion/branches/in-repo-authz/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/svnrdump/load_editor.c?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/in-repo-authz/subversion/svnrdump/load_editor.c Wed Dec 19 03:27:09 2012
@@ -855,6 +855,8 @@ set_revision_property(void *baton,
 {
   struct revision_baton *rb = baton;
 
+  SVN_ERR(svn_rdump__normalize_prop(name, &value, rb->pool));
+  
   SVN_ERR(svn_repos__validate_prop(name, value, rb->pool));
 
   if (rb->rev > 0)
@@ -934,6 +936,8 @@ set_node_property(void *baton,
         }
     }
 
+  SVN_ERR(svn_rdump__normalize_prop(name, &value, pool));
+
   SVN_ERR(svn_repos__validate_prop(name, value, pool));
 
   switch (nb->kind)

Modified: subversion/branches/in-repo-authz/subversion/svnrdump/svnrdump.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/svnrdump/svnrdump.h?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/svnrdump/svnrdump.h (original)
+++ subversion/branches/in-repo-authz/subversion/svnrdump/svnrdump.h Wed Dec 19 03:27:09 2012
@@ -106,6 +106,20 @@ svn_rdump__normalize_props(apr_hash_t **
                            apr_hash_t *props,
                            apr_pool_t *result_pool);
 
+/* Normalize the line ending style of a single property that "needs
+ * translation" (according to svn_prop_needs_translation(),
+ * currently all svn:* props) so that they contain only LF (\n) line endings.
+ * "\r" characters found mid-line are replaced with "\n".
+ * "\r\n" sequences are replaced with "\n"
+ *
+ * NAME is used to check that VALUE should be normalized, and if this is the
+ * case, VALUE is then normalized, allocated from RESULT_POOL
+ */
+svn_error_t *
+svn_rdump__normalize_prop(const char *name,
+                          const svn_string_t **value,
+                          apr_pool_t *result_pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/in-repo-authz/subversion/svnrdump/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/svnrdump/util.c?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/svnrdump/util.c (original)
+++ subversion/branches/in-repo-authz/subversion/svnrdump/util.c Wed Dec 19 03:27:09 2012
@@ -31,6 +31,25 @@
 
 
 svn_error_t *
+svn_rdump__normalize_prop(const char *name,
+                          const svn_string_t **value,
+                          apr_pool_t *result_pool)
+{
+  if (svn_prop_needs_translation(name))
+    {
+      const char *cstring;
+
+      SVN_ERR(svn_subst_translate_cstring2((*value)->data, &cstring,
+                                           "\n", TRUE,
+                                           NULL, FALSE,
+                                           result_pool));
+
+      *value = svn_string_create(cstring, result_pool);
+    }
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_rdump__normalize_props(apr_hash_t **normal_props,
                            apr_hash_t *props,
                            apr_pool_t *result_pool)
@@ -45,16 +64,8 @@ svn_rdump__normalize_props(apr_hash_t **
       const char *key = svn__apr_hash_index_key(hi);
       const svn_string_t *value = svn__apr_hash_index_val(hi);
 
-      if (svn_prop_needs_translation(key))
-        {
-          const char *cstring;
-
-          SVN_ERR(svn_subst_translate_cstring2(value->data, &cstring,
-                                               "\n", TRUE,
-                                               NULL, FALSE,
-                                               result_pool));
-          value = svn_string_create(cstring, result_pool);
-        }
+      SVN_ERR(svn_rdump__normalize_prop(key, &value,
+                                        result_pool));
 
       apr_hash_set(*normal_props, key, APR_HASH_KEY_STRING, value);
     }

Modified: subversion/branches/in-repo-authz/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/cmdline/svnrdump_tests.py?rev=1423749&r1=1423748&r2=1423749&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/branches/in-repo-authz/subversion/tests/cmdline/svnrdump_tests.py Wed Dec 19 03:27:09 2012
@@ -358,7 +358,6 @@ def copy_bad_line_endings_dump(sbox):
                 expected_dumpfile_name="copy-bad-line-endings.expected.dump",
                 bypass_prop_validation=True)
 
-@XFail()
 @Issue(4263)
 def copy_bad_line_endings_load(sbox):
   "load: inconsistent line endings in svn:* props"