You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2016/01/21 22:39:24 UTC

svn commit: r1726108 [1/4] - in /subversion/branches/parallel-put: ./ build/ac-macros/ notes/ notes/move-tracking/ subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/ subversion/bindings/swig/ subversion/bindings/swig/include/ subversio...

Author: stefan2
Date: Thu Jan 21 21:39:22 2016
New Revision: 1726108

URL: http://svn.apache.org/viewvc?rev=1726108&view=rev
Log:
On the parallel-put branch:
Catch up with /trunk up to r1726107. No conflicts occured.

Added:
    subversion/branches/parallel-put/notes/move-tracking/path_pairs_to_eid_map.py
      - copied unchanged from r1726107, subversion/trunk/notes/move-tracking/path_pairs_to_eid_map.py
    subversion/branches/parallel-put/subversion/bindings/swig/include/proxy.py
      - copied unchanged from r1726107, subversion/trunk/subversion/bindings/swig/include/proxy.py
    subversion/branches/parallel-put/subversion/libsvn_client/merge_elements.c
      - copied unchanged from r1726107, subversion/trunk/subversion/libsvn_client/merge_elements.c
    subversion/branches/parallel-put/subversion/libsvn_ra_serf/request_body.c
      - copied unchanged from r1726107, subversion/trunk/subversion/libsvn_ra_serf/request_body.c
    subversion/branches/parallel-put/tools/dev/find-control-statements.py
      - copied unchanged from r1726107, subversion/trunk/tools/dev/find-control-statements.py
Modified:
    subversion/branches/parallel-put/   (props changed)
    subversion/branches/parallel-put/build/ac-macros/swig.m4
    subversion/branches/parallel-put/configure.ac
    subversion/branches/parallel-put/notes/knobs
    subversion/branches/parallel-put/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/StatusEditor.java
    subversion/branches/parallel-put/subversion/bindings/swig/INSTALL
    subversion/branches/parallel-put/subversion/bindings/swig/include/proxy.swg
    subversion/branches/parallel-put/subversion/bindings/swig/perl/native/Base.pm
    subversion/branches/parallel-put/subversion/include/private/svn_branch.h
    subversion/branches/parallel-put/subversion/include/private/svn_branch_impl.h
    subversion/branches/parallel-put/subversion/include/private/svn_diff_private.h
    subversion/branches/parallel-put/subversion/include/svn_client.h
    subversion/branches/parallel-put/subversion/include/svn_fs.h
    subversion/branches/parallel-put/subversion/include/svn_io.h
    subversion/branches/parallel-put/subversion/libsvn_client/client.h
    subversion/branches/parallel-put/subversion/libsvn_client/diff.c
    subversion/branches/parallel-put/subversion/libsvn_client/merge.c
    subversion/branches/parallel-put/subversion/libsvn_client/patch.c
    subversion/branches/parallel-put/subversion/libsvn_client/relocate.c
    subversion/branches/parallel-put/subversion/libsvn_client/resolved.c
    subversion/branches/parallel-put/subversion/libsvn_client/revisions.c
    subversion/branches/parallel-put/subversion/libsvn_delta/branch.c
    subversion/branches/parallel-put/subversion/libsvn_delta/branch_compat.c
    subversion/branches/parallel-put/subversion/libsvn_delta/branch_nested.c
    subversion/branches/parallel-put/subversion/libsvn_diff/parse-diff.c
    subversion/branches/parallel-put/subversion/libsvn_fs/deprecated.c
    subversion/branches/parallel-put/subversion/libsvn_fs/fs-loader.c
    subversion/branches/parallel-put/subversion/libsvn_fs_base/tree.c
    subversion/branches/parallel-put/subversion/libsvn_fs_fs/cached_data.c
    subversion/branches/parallel-put/subversion/libsvn_fs_fs/caching.c
    subversion/branches/parallel-put/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/parallel-put/subversion/libsvn_fs_fs/temp_serializer.c
    subversion/branches/parallel-put/subversion/libsvn_fs_fs/temp_serializer.h
    subversion/branches/parallel-put/subversion/libsvn_fs_fs/tree.c
    subversion/branches/parallel-put/subversion/libsvn_fs_x/   (props changed)
    subversion/branches/parallel-put/subversion/libsvn_fs_x/cached_data.c
    subversion/branches/parallel-put/subversion/libsvn_fs_x/caching.c
    subversion/branches/parallel-put/subversion/libsvn_fs_x/index.c
    subversion/branches/parallel-put/subversion/libsvn_fs_x/pack.c
    subversion/branches/parallel-put/subversion/libsvn_fs_x/rev_file.c
    subversion/branches/parallel-put/subversion/libsvn_fs_x/temp_serializer.c
    subversion/branches/parallel-put/subversion/libsvn_fs_x/temp_serializer.h
    subversion/branches/parallel-put/subversion/libsvn_fs_x/transaction.c
    subversion/branches/parallel-put/subversion/libsvn_fs_x/tree.c
    subversion/branches/parallel-put/subversion/libsvn_fs_x/util.c
    subversion/branches/parallel-put/subversion/libsvn_fs_x/util.h
    subversion/branches/parallel-put/subversion/libsvn_fs_x/verify.c
    subversion/branches/parallel-put/subversion/libsvn_ra_local/ra_plugin.c
    subversion/branches/parallel-put/subversion/libsvn_ra_serf/commit.c
    subversion/branches/parallel-put/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/parallel-put/subversion/libsvn_ra_serf/update.c
    subversion/branches/parallel-put/subversion/libsvn_repos/commit.c
    subversion/branches/parallel-put/subversion/libsvn_repos/delta.c
    subversion/branches/parallel-put/subversion/libsvn_repos/reporter.c
    subversion/branches/parallel-put/subversion/libsvn_repos/repos.h
    subversion/branches/parallel-put/subversion/libsvn_subr/cache-membuffer.c
    subversion/branches/parallel-put/subversion/libsvn_subr/eol.c
    subversion/branches/parallel-put/subversion/libsvn_subr/io.c
    subversion/branches/parallel-put/subversion/libsvn_subr/path.c
    subversion/branches/parallel-put/subversion/libsvn_subr/pool.c
    subversion/branches/parallel-put/subversion/libsvn_subr/utf_validate.c
    subversion/branches/parallel-put/subversion/libsvn_subr/win32_crashrpt.c
    subversion/branches/parallel-put/subversion/libsvn_wc/conflicts.c
    subversion/branches/parallel-put/subversion/libsvn_wc/update_editor.c
    subversion/branches/parallel-put/subversion/mod_dav_svn/activity.c
    subversion/branches/parallel-put/subversion/mod_dav_svn/dav_svn.h
    subversion/branches/parallel-put/subversion/mod_dav_svn/deadprops.c
    subversion/branches/parallel-put/subversion/mod_dav_svn/liveprops.c
    subversion/branches/parallel-put/subversion/mod_dav_svn/lock.c
    subversion/branches/parallel-put/subversion/mod_dav_svn/merge.c
    subversion/branches/parallel-put/subversion/mod_dav_svn/mod_dav_svn.c
    subversion/branches/parallel-put/subversion/mod_dav_svn/reports/get-location-segments.c
    subversion/branches/parallel-put/subversion/mod_dav_svn/reports/update.c
    subversion/branches/parallel-put/subversion/mod_dav_svn/repos.c
    subversion/branches/parallel-put/subversion/mod_dav_svn/util.c
    subversion/branches/parallel-put/subversion/mod_dav_svn/version.c
    subversion/branches/parallel-put/subversion/svn/cl.h
    subversion/branches/parallel-put/subversion/svn/conflict-callbacks.c
    subversion/branches/parallel-put/subversion/svn/merge-cmd.c
    subversion/branches/parallel-put/subversion/svn/notify.c
    subversion/branches/parallel-put/subversion/svn/resolve-cmd.c
    subversion/branches/parallel-put/subversion/svn/svn.c
    subversion/branches/parallel-put/subversion/svn/switch-cmd.c
    subversion/branches/parallel-put/subversion/svn/update-cmd.c
    subversion/branches/parallel-put/subversion/svnadmin/svnadmin.c
    subversion/branches/parallel-put/subversion/svnserve/serve.c
    subversion/branches/parallel-put/subversion/svnserve/svnserve.c
    subversion/branches/parallel-put/subversion/tests/cmdline/authz_tests.py
    subversion/branches/parallel-put/subversion/tests/cmdline/mod_dav_svn_tests.py
    subversion/branches/parallel-put/subversion/tests/cmdline/patch_tests.py
    subversion/branches/parallel-put/subversion/tests/cmdline/relocate_tests.py
    subversion/branches/parallel-put/subversion/tests/libsvn_fs/fs-test.c
    subversion/branches/parallel-put/subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c
    subversion/branches/parallel-put/subversion/tests/libsvn_ra/ra-test.c
    subversion/branches/parallel-put/tools/backup/hot-backup.py.in
    subversion/branches/parallel-put/tools/client-side/svn-mergeinfo-normalizer/logic.c
    subversion/branches/parallel-put/tools/dev/svnmover/merge3.c
    subversion/branches/parallel-put/tools/dev/svnmover/svnmover.c
    subversion/branches/parallel-put/tools/dist/backport.pl

Propchange: subversion/branches/parallel-put/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 21 21:39:22 2016
@@ -95,3 +95,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
+/subversion/trunk:1719877-1726107

Modified: subversion/branches/parallel-put/build/ac-macros/swig.m4
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/build/ac-macros/swig.m4?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/build/ac-macros/swig.m4 (original)
+++ subversion/branches/parallel-put/build/ac-macros/swig.m4 Thu Jan 21 21:39:22 2016
@@ -91,13 +91,12 @@ AC_DEFUN(SVN_FIND_SWIG,
     AC_MSG_RESULT([$SWIG_VERSION_RAW])
     # If you change the required swig version number, don't forget to update:
     #   subversion/bindings/swig/INSTALL
-    if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \
-       test "$SWIG_VERSION" -lt "300000"; then
+    if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then
       SWIG_SUITABLE=yes
     else
       SWIG_SUITABLE=no
       AC_MSG_WARN([Detected SWIG version $SWIG_VERSION_RAW])
-      AC_MSG_WARN([Subversion requires SWIG >= 1.3.24 and < 3.0.0 ])
+      AC_MSG_WARN([Subversion requires SWIG >= 1.3.24])
     fi
   fi
  

Modified: subversion/branches/parallel-put/configure.ac
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/configure.ac?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/configure.ac (original)
+++ subversion/branches/parallel-put/configure.ac Thu Jan 21 21:39:22 2016
@@ -1518,6 +1518,7 @@ fi
 # Need to strip '-no-cpp-precomp' from CPPFLAGS for SWIG as well.
 SWIG_CPPFLAGS="$CPPFLAGS"
 SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-no-cpp-precomp ])
+SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-Wdate-time ])
 AC_SUBST([SWIG_CPPFLAGS])
 
 dnl Since this is used only on Unix-y systems, define the path separator as '/'

Modified: subversion/branches/parallel-put/notes/knobs
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/notes/knobs?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/notes/knobs (original)
+++ subversion/branches/parallel-put/notes/knobs Thu Jan 21 21:39:22 2016
@@ -73,7 +73,6 @@ SSL_VERBOSE
 SVN_DEPRECATED
 SVN_FS__TRAIL_DEBUG
 SVN_FS_FS__LOG_ACCESS
-SVN_UTF_NO_UNINITIALISED_ACCESS
 
 2.4 Test-only
 
@@ -437,14 +436,6 @@ SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2
   Default:   not defined
   Suggested: defined, not defined
 
-5.15 SVN_UTF_NO_UNINITIALISED_ACCESS
-
-  Scope:     libsvn_subr
-  Purpose:   Disables some code that triggers warnings in memory tools
-             such as valgrind and address sanitizer.
-  Range:     definedness
-  Default:   not defined
-  Suggested: defined, not defined
 
 6 Defines that affect unit tests
 ================================

Modified: subversion/branches/parallel-put/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/StatusEditor.java
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/StatusEditor.java?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/StatusEditor.java (original)
+++ subversion/branches/parallel-put/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/StatusEditor.java Thu Jan 21 21:39:22 2016
@@ -107,7 +107,7 @@ class StatusEditor implements ISVNEditor
     {
         //DEBUG:System.err.println("  [J] StatusEditor.addAbsent");
         checkState();
-        throw new RuntimeException("Not implemented: StatusEditor.addAbsent");
+        // ignore this callback, as svn status -u does
     }
 
     public void alterDirectory(String relativePath,

Modified: subversion/branches/parallel-put/subversion/bindings/swig/INSTALL
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/bindings/swig/INSTALL?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/bindings/swig/INSTALL (original)
+++ subversion/branches/parallel-put/subversion/bindings/swig/INSTALL Thu Jan 21 21:39:22 2016
@@ -65,7 +65,7 @@ BUILDING SWIG BINDINGS FOR SVN ON UNIX
 
 
 Step 1:  Install a suitable version of SWIG (which is
-         currently SWIG version 1.3.24 or later, but not SWIG 3.0.0 or newer).
+         currently SWIG version 1.3.24 or later).
 
     * Perhaps your distribution packages a suitable version - if it does
       install it, and skip to the last bullet point in this section.

Modified: subversion/branches/parallel-put/subversion/bindings/swig/include/proxy.swg
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/bindings/swig/include/proxy.swg?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/bindings/swig/include/proxy.swg (original)
+++ subversion/branches/parallel-put/subversion/bindings/swig/include/proxy.swg Thu Jan 21 21:39:22 2016
@@ -60,51 +60,11 @@
         value.assert_valid()
 %}
 
-/* Default code for all wrapped proxy classes in Python */
+/* Default code for all wrapped proxy classes in Python.
+ * Inline the code from a separate file to avoid issues with
+ * SWIG mis-parsing the comments as preprocessor directives. */
 %define %proxy_pythoncode(TYPE)
-%pythoncode {
-  def set_parent_pool(self, parent_pool=None):
-    """Create a new proxy object for TYPE"""
-    import libsvn.core, weakref
-    self.__dict__["_parent_pool"] = \
-      parent_pool or libsvn.core.application_pool;
-    if self.__dict__["_parent_pool"]:
-      self.__dict__["_is_valid"] = weakref.ref(
-        self.__dict__["_parent_pool"]._is_valid)
-
-  def assert_valid(self):
-    """Assert that this object is using valid pool memory"""
-    if "_is_valid" in self.__dict__:
-      assert self.__dict__["_is_valid"](), "Variable has already been deleted"
-
-  def __getattr__(self, name):
-    """Get an attribute from this object"""
-    self.assert_valid()
-
-    value = _swig_getattr(self, self.__class__, name)
-
-    # If we got back a different object than we have, we need to copy all our
-    # metadata into it, so that it looks identical
-    members = self.__dict__.get("_members")
-    if members is not None:
-      _copy_metadata_deep(value, members.get(name))
-        
-    # Verify that the new object is good
-    _assert_valid_deep(value)
-
-    return value
-
-  def __setattr__(self, name, value):
-    """Set an attribute on this object"""
-    self.assert_valid()
-
-    # Save a copy of the object, so that the garbage
-    # collector won't kill the object while it's in
-    # SWIG-land
-    self.__dict__.setdefault("_members",{})[name] = value
-
-    return _swig_setattr(self, self.__class__, name, value)
-}
+%pythoncode "proxy.py"
 %enddef
 
 /* Define a proxy for wrapping an existing struct */

Modified: subversion/branches/parallel-put/subversion/bindings/swig/perl/native/Base.pm
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/bindings/swig/perl/native/Base.pm?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/bindings/swig/perl/native/Base.pm (original)
+++ subversion/branches/parallel-put/subversion/bindings/swig/perl/native/Base.pm Thu Jan 21 21:39:22 2016
@@ -28,7 +28,7 @@ C<$data-E<gt>field($new_value)>.
 Once you understand the convention of subversion functions in perl
 bindings, you could look at the subversion api and write them in perl.
 The API is available in the source header files or online at
-http://svn.collab.net/svn-doxygen/.
+L<https://subversion.apache.org/docs/api/latest/>.
 
 =head1 INTERNALS
 

Modified: subversion/branches/parallel-put/subversion/include/private/svn_branch.h
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/include/private/svn_branch.h?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/include/private/svn_branch.h (original)
+++ subversion/branches/parallel-put/subversion/include/private/svn_branch.h Thu Jan 21 21:39:22 2016
@@ -166,6 +166,11 @@ svn_branch__txn_create(const svn_branch_
 
 /* Return all the branches in TXN.
  *
+ * These branches are available for reading. (Some of them may also be
+ * mutable.)
+ *
+ * ### Rename to 'list_branches' & return only their ids?
+ *
  * Return an empty array if there are none.
  */
 apr_array_header_t *
@@ -199,11 +204,21 @@ svn_branch__txn_new_eid(svn_branch__txn_
                         int *new_eid_p,
                         apr_pool_t *scratch_pool);
 
-/** Create a new branch or access an existing branch.
+/** Open for writing, either a new branch or an existing branch.
  *
- * When creating a branch, declare its root element id to be ROOT_EID. Do
+ * When creating a new branch, declare its root element id to be ROOT_EID. Do
  * not instantiate the root element, nor any other elements.
  *
+ * TREE_REF specifies the initial tree content, by reference to a committed
+ * tree. It overwrites any existing tree, even if the branch was already
+ * mutable in the txn.
+ *
+ * If TREE_REF is null, then the initial tree is empty for a new branch
+ * (not already present in the txn), or the branch's current tree if the
+ * branch was already present (readable or mutable) in the txn.
+ *
+ * ### TODO: Take a 'history' parameter; 'none' is a valid option.
+ *
  * We use a common 'open subbranch' method for both 'find' and 'add'
  * cases, according to the principle that 'editing' a txn should dictate
  * the new state without reference to the old state.
@@ -211,27 +226,18 @@ svn_branch__txn_new_eid(svn_branch__txn_
  * This method returns a mutable 'branch state' object which is a part of
  * the txn.
  *
- * When adding a new branch, ROOT_EID is used.
- *
  * ### When opening ('finding') an existing branch, ROOT_EID should match
  *     it. (Should we check, and throw an error if not?)
  */
 svn_error_t *
 svn_branch__txn_open_branch(svn_branch__txn_t *txn,
                             svn_branch__state_t **new_branch_p,
-                            const char *new_branch_id,
+                            const char *branch_id,
                             int root_eid,
+                            svn_branch__rev_bid_eid_t *tree_ref,
                             apr_pool_t *result_pool,
                             apr_pool_t *scratch_pool);
 
-svn_error_t *
-svn_branch__txn_branch(svn_branch__txn_t *txn,
-                       svn_branch__state_t **new_branch_p,
-                       svn_branch__rev_bid_eid_t *from,
-                       const char *new_branch_id,
-                       apr_pool_t *result_pool,
-                       apr_pool_t *scratch_pool);
-
 /** Register a sequence point.
  *
  * At a sequence point, elements are arranged in a tree hierarchy: each
@@ -323,6 +329,8 @@ struct svn_branch__state_t
   const char *bid;
 
   /* The revision to which this branch state belongs */
+  /* ### Later we should remove this and let a single state be sharable
+     by multiple txns. */
   svn_branch__txn_t *txn;
 
 };
@@ -385,26 +393,6 @@ svn_branch__id_unnest(const char **outer
                       const char *bid,
                       apr_pool_t *result_pool);
 
-/* Register the existence of BRANCH in TXN.
- */
-svn_error_t *
-svn_branch__txn_add_branch(svn_branch__txn_t *txn,
-                           svn_branch__state_t *branch,
-                           apr_pool_t *scratch_pool);
-
-/* Create a new branch with branch id BID, with no elements
- * (not even a root element).
- *
- * Create and return a new branch object. Register its existence in TXN.
- *
- * Set the root element to ROOT_EID.
- */
-svn_branch__state_t *
-svn_branch__txn_add_new_branch(svn_branch__txn_t *txn,
-                               const char *bid,
-                               int root_eid,
-                               apr_pool_t *scratch_pool);
-
 /* Remove the branch with id BID from the list of branches in TXN.
  */
 svn_error_t *

Modified: subversion/branches/parallel-put/subversion/include/private/svn_branch_impl.h
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/include/private/svn_branch_impl.h?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/include/private/svn_branch_impl.h (original)
+++ subversion/branches/parallel-put/subversion/include/private/svn_branch_impl.h Thu Jan 21 21:39:22 2016
@@ -59,17 +59,6 @@ typedef apr_array_header_t *(*svn_branch
   const svn_branch__txn_t *txn,
   apr_pool_t *result_pool);
 
-typedef svn_error_t *(*svn_branch__txn_v_add_branch_t)(
-  svn_branch__txn_t *txn,
-  svn_branch__state_t *branch,
-  apr_pool_t *scratch_pool);
-
-typedef svn_branch__state_t *(*svn_branch__txn_v_add_new_branch_t)(
-  svn_branch__txn_t *txn,
-  const char *bid,
-  int root_eid,
-  apr_pool_t *scratch_pool);
-
 typedef svn_error_t *(*svn_branch__txn_v_delete_branch_t)(
   svn_branch__txn_t *txn,
   const char *bid,
@@ -90,14 +79,7 @@ typedef svn_error_t *(*svn_branch__txn_v
   svn_branch__state_t **new_branch_p,
   const char *new_branch_id,
   int root_eid,
-  apr_pool_t *result_pool,
-  apr_pool_t *scratch_pool);
-
-typedef svn_error_t *(*svn_branch__txn_v_branch_t)(
-  svn_branch__txn_t *txn,
-  svn_branch__state_t **new_branch_p,
   svn_branch__rev_bid_eid_t *from,
-  const char *new_branch_id,
   apr_pool_t *result_pool,
   apr_pool_t *scratch_pool);
 
@@ -128,13 +110,10 @@ struct svn_branch__txn_vtable_t
 
   /* Methods. */
   svn_branch__txn_v_get_branches_t get_branches;
-  svn_branch__txn_v_add_branch_t add_branch;
-  svn_branch__txn_v_add_new_branch_t add_new_branch;
   svn_branch__txn_v_delete_branch_t delete_branch;
   svn_branch__txn_v_get_num_new_eids_t get_num_new_eids;
   svn_branch__txn_v_new_eid_t new_eid;
   svn_branch__txn_v_open_branch_t open_branch;
-  svn_branch__txn_v_branch_t branch;
   svn_branch__txn_v_finalize_eids_t finalize_eids;
   svn_branch__txn_v_serialize_t serialize;
   svn_branch__txn_v_sequence_point_t sequence_point;

Modified: subversion/branches/parallel-put/subversion/include/private/svn_diff_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/include/private/svn_diff_private.h?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/include/private/svn_diff_private.h (original)
+++ subversion/branches/parallel-put/subversion/include/private/svn_diff_private.h Thu Jan 21 21:39:22 2016
@@ -141,6 +141,13 @@ svn_diff_hunk__create_deletes_single_lin
                                           apr_pool_t *result_pool,
                                           apr_pool_t *scratch_pool);
 
+/** Fetches the penalty fuzz of the diff hunk. The patch file parser applies
+ * an additional penalty on some cases of bad patch files. These cases may
+ * include errors as headers that aren't consistent with bodies, etc.
+ */
+svn_linenum_t
+svn_diff_hunk__get_fuzz_penalty(const svn_diff_hunk_t *hunk);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/parallel-put/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/include/svn_client.h?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/include/svn_client.h (original)
+++ subversion/branches/parallel-put/subversion/include/svn_client.h Thu Jan 21 21:39:22 2016
@@ -4386,8 +4386,8 @@ typedef enum svn_client_conflict_option_
   svn_client_conflict_option_undefined = -1, /* for private use only */
   svn_client_conflict_option_postpone = 0,
   svn_client_conflict_option_base_text,
-  svn_client_conflict_option_incoming_text,
-  svn_client_conflict_option_working_text,
+  svn_client_conflict_option_incoming_text, /* "theirs-full" */
+  svn_client_conflict_option_working_text,  /* "mine-full" */
   svn_client_conflict_option_incoming_text_where_conflicted,
   svn_client_conflict_option_working_text_where_conflicted,
   svn_client_conflict_option_merged_text,

Modified: subversion/branches/parallel-put/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/include/svn_fs.h?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/include/svn_fs.h (original)
+++ subversion/branches/parallel-put/subversion/include/svn_fs.h Thu Jan 21 21:39:22 2016
@@ -134,6 +134,12 @@ typedef struct svn_fs_t svn_fs_t;
  */
 #define SVN_FS_CONFIG_FSFS_CACHE_NS             "fsfs-cache-namespace"
 
+/** Enable / disable caching of node properties for a FSFS repository.
+ *
+ * @since New in 1.10.
+ */
+#define SVN_FS_CONFIG_FSFS_CACHE_NODEPROPS      "fsfs-cache-nodeprops"
+
 /** Enable / disable the FSFS format 7 "block read" feature.
  *
  * @since New in 1.9.

Modified: subversion/branches/parallel-put/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/include/svn_io.h?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/include/svn_io.h (original)
+++ subversion/branches/parallel-put/subversion/include/svn_io.h Thu Jan 21 21:39:22 2016
@@ -1148,8 +1148,8 @@ svn_stream_for_stdout(svn_stream_t **out
                       apr_pool_t *pool);
 
 /** Read the contents of @a stream into memory, from its current position
- * to its end, returning the data in @a *result. The stream will be closed
- * when it has been successfully and completely read.
+ * to its end, returning the data in @a *result. This function does not
+ * close the @a stream upon completion.
  *
  * @a len_hint gives a hint about the expected length, in bytes, of the
  * actual data that will be read from the stream. It may be 0, meaning no

Modified: subversion/branches/parallel-put/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_client/client.h?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_client/client.h (original)
+++ subversion/branches/parallel-put/subversion/libsvn_client/client.h Thu Jan 21 21:39:22 2016
@@ -1185,6 +1185,48 @@ svn_client__remote_propget(apr_hash_t *p
                            apr_pool_t *result_pool,
                            apr_pool_t *scratch_pool);
 
+/* */
+typedef struct merge_source_t
+{
+  /* "left" side URL and revision (inclusive iff youngest) */
+  const svn_client__pathrev_t *loc1;
+
+  /* "right" side URL and revision (inclusive iff youngest) */
+  const svn_client__pathrev_t *loc2;
+
+  /* True iff LOC1 is an ancestor of LOC2 or vice-versa (history-wise). */
+  svn_boolean_t ancestral;
+} merge_source_t;
+
+/* Description of the merge target root node (a WC working node) */
+typedef struct merge_target_t
+{
+  /* Absolute path to the WC node */
+  const char *abspath;
+
+  /* The repository location of the base node of the target WC.  If the node
+   * is locally added, then URL & REV are NULL & SVN_INVALID_REVNUM.
+   * REPOS_ROOT_URL and REPOS_UUID are always valid. */
+  svn_client__pathrev_t loc;
+
+} merge_target_t;
+
+/*
+ * Similar API to svn_client_merge_peg5().
+ */
+svn_error_t *
+svn_client__merge_elements(svn_boolean_t *use_sleep,
+                           apr_array_header_t *merge_sources,
+                           merge_target_t *target,
+                           svn_ra_session_t *ra_session,
+                           svn_boolean_t diff_ignore_ancestry,
+                           svn_boolean_t force_delete,
+                           svn_boolean_t dry_run,
+                           const apr_array_header_t *merge_options,
+                           svn_client_ctx_t *ctx,
+                           apr_pool_t *result_pool,
+                           apr_pool_t *scratch_pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/parallel-put/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_client/diff.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_client/diff.c Thu Jan 21 21:39:22 2016
@@ -2238,22 +2238,20 @@ diff_repos_wc(const char **root_relpath,
   else
     diff_depth = svn_depth_unknown;
 
-
+  /* Tell the RA layer we want a delta to change our txn to URL1 */
+  SVN_ERR(svn_ra_do_diff3(ra_session,
+                          &reporter, &reporter_baton,
+                          loc1->rev,
+                          target,
+                          diff_depth,
+                          ignore_ancestry,
+                          TRUE, /* text_deltas */
+                          loc1->url,
+                          diff_editor, diff_edit_baton,
+                          scratch_pool));
 
   if (is_copy && revision2_kind != svn_opt_revision_base)
     {
-      /* Tell the RA layer we want a delta to change our txn to URL1 */
-      SVN_ERR(svn_ra_do_diff3(ra_session,
-                              &reporter, &reporter_baton,
-                              loc1->rev,
-                              target,
-                              diff_depth,
-                              ignore_ancestry,
-                              TRUE,  /* text_deltas */
-                              loc1->url,
-                              diff_editor, diff_edit_baton,
-                              scratch_pool));
-
       /* Report the copy source. */
       if (cf_depth == svn_depth_unknown)
         cf_depth = svn_depth_infinity;
@@ -2277,18 +2275,6 @@ diff_repos_wc(const char **root_relpath,
     }
   else
     {
-      /* Tell the RA layer we want a delta to change our txn to URL1 */
-      SVN_ERR(svn_ra_do_diff3(ra_session,
-                              &reporter, &reporter_baton,
-                              loc1->rev,
-                              target,
-                              diff_depth,
-                              ignore_ancestry,
-                              TRUE,  /* text_deltas */
-                              loc1->url,
-                              diff_editor, diff_edit_baton,
-                              scratch_pool));
-
       /* Create a txn mirror of path2;  the diff editor will print
          diffs in reverse.  :-)  */
       SVN_ERR(svn_wc_crawl_revisions5(ctx->wc_ctx, abspath2,

Modified: subversion/branches/parallel-put/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_client/merge.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_client/merge.c Thu Jan 21 21:39:22 2016
@@ -215,32 +215,6 @@
 
 /*** Repos-Diff Editor Callbacks ***/
 
-/* */
-typedef struct merge_source_t
-{
-  /* "left" side URL and revision (inclusive iff youngest) */
-  const svn_client__pathrev_t *loc1;
-
-  /* "right" side URL and revision (inclusive iff youngest) */
-  const svn_client__pathrev_t *loc2;
-
-  /* True iff LOC1 is an ancestor of LOC2 or vice-versa (history-wise). */
-  svn_boolean_t ancestral;
-} merge_source_t;
-
-/* Description of the merge target root node (a WC working node) */
-typedef struct merge_target_t
-{
-  /* Absolute path to the WC node */
-  const char *abspath;
-
-  /* The repository location of the base node of the target WC.  If the node
-   * is locally added, then URL & REV are NULL & SVN_INVALID_REVNUM.
-   * REPOS_ROOT_URL and REPOS_UUID are always valid. */
-  svn_client__pathrev_t loc;
-
-} merge_target_t;
-
 typedef struct merge_cmd_baton_t {
   svn_boolean_t force_delete;         /* Delete a file/dir even if modified */
   svn_boolean_t dry_run;
@@ -11853,6 +11827,21 @@ merge_peg_locked(conflict_report_t **con
 
   /* Do the real merge!  (We say with confidence that our merge
      sources are both ancestral and related.) */
+  if (getenv("SVN_ELEMENT_MERGE")
+      && same_repos
+      && (depth == svn_depth_infinity || depth == svn_depth_unknown)
+      && ignore_mergeinfo
+      && !record_only)
+    {
+      err = svn_client__merge_elements(&use_sleep,
+                                       merge_sources, target, ra_session,
+                                       diff_ignore_ancestry, force_delete,
+                                       dry_run, merge_options,
+                                       ctx, result_pool, scratch_pool);
+      /* ### Currently this merge just errors out on any conflicts */
+      *conflict_report = NULL;
+    }
+  else
   err = do_merge(NULL, NULL, conflict_report, &use_sleep,
                  merge_sources, target, ra_session,
                  TRUE /*sources_related*/, same_repos, ignore_mergeinfo,

Modified: subversion/branches/parallel-put/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_client/patch.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_client/patch.c Thu Jan 21 21:39:22 2016
@@ -67,7 +67,10 @@ typedef struct hunk_info_t {
 
   /* The fuzz factor used when matching this hunk, i.e. how many
    * lines of leading and trailing context to ignore during matching. */
-  svn_linenum_t fuzz;
+  svn_linenum_t match_fuzz;
+
+  /* match_fuzz + the penalty caused by bad patch files */
+  svn_linenum_t report_fuzz;
 } hunk_info_t;
 
 /* A struct carrying information related to the patched and unpatched
@@ -1567,12 +1570,20 @@ match_hunk(svn_boolean_t *matched, targe
   svn_linenum_t hunk_length;
   svn_linenum_t leading_context;
   svn_linenum_t trailing_context;
+  svn_linenum_t fuzz_penalty;
 
   *matched = FALSE;
 
   if (content->eof)
     return SVN_NO_ERROR;
 
+  fuzz_penalty = svn_diff_hunk__get_fuzz_penalty(hunk);
+
+  if (fuzz_penalty > fuzz)
+    return SVN_NO_ERROR;
+  else
+    fuzz -= fuzz_penalty;
+
   saved_line = content->current_line;
   lines_read = 0;
   lines_matched = FALSE;
@@ -2079,7 +2090,8 @@ get_hunk_info(hunk_info_t **hi, patch_ta
   (*hi)->matched_line = matched_line;
   (*hi)->rejected = (matched_line == 0);
   (*hi)->already_applied = already_applied;
-  (*hi)->fuzz = fuzz;
+  (*hi)->report_fuzz = fuzz;
+  (*hi)->match_fuzz = fuzz - svn_diff_hunk__get_fuzz_penalty(hunk);
 
   return SVN_NO_ERROR;
 }
@@ -2201,6 +2213,7 @@ apply_hunk(patch_target_t *target, targe
   svn_linenum_t lines_read;
   svn_boolean_t eof;
   apr_pool_t *iterpool;
+  svn_linenum_t fuzz = hi->match_fuzz;
 
   /* ### Is there a cleaner way to describe if we have an existing target?
    */
@@ -2212,13 +2225,13 @@ apply_hunk(patch_target_t *target, targe
        * Also copy leading lines of context which matched with fuzz.
        * The target has changed on the fuzzy-matched lines,
        * so we should retain the target's version of those lines. */
-      SVN_ERR(copy_lines_to_target(content, hi->matched_line + hi->fuzz,
+      SVN_ERR(copy_lines_to_target(content, hi->matched_line + fuzz,
                                    pool));
 
       /* Skip the target's version of the hunk.
        * Don't skip trailing lines which matched with fuzz. */
       line = content->current_line +
-             svn_diff_hunk_get_original_length(hi->hunk) - (2 * hi->fuzz);
+             svn_diff_hunk_get_original_length(hi->hunk) - (2 * fuzz);
       SVN_ERR(seek_to_line(content, line, pool));
       if (content->current_line != line && ! content->eof)
         {
@@ -2245,8 +2258,8 @@ apply_hunk(patch_target_t *target, targe
                                                    &eol_str, &eof,
                                                    iterpool, iterpool));
       lines_read++;
-      if (lines_read > hi->fuzz &&
-          lines_read <= svn_diff_hunk_get_modified_length(hi->hunk) - hi->fuzz)
+      if (lines_read > fuzz &&
+          lines_read <= svn_diff_hunk_get_modified_length(hi->hunk) - fuzz)
         {
           apr_size_t len;
 
@@ -2315,7 +2328,7 @@ send_hunk_notification(const hunk_info_t
   notify->hunk_modified_length =
     svn_diff_hunk_get_modified_length(hi->hunk);
   notify->hunk_matched_line = hi->matched_line;
-  notify->hunk_fuzz = hi->fuzz;
+  notify->hunk_fuzz = hi->report_fuzz;
   notify->prop_name = prop_name;
 
   ctx->notify_func2(ctx->notify_baton2, notify, pool);
@@ -3292,6 +3305,7 @@ install_patched_target(patch_target_t *t
  */
 static svn_error_t *
 write_out_rejected_hunks(patch_target_t *target,
+                         const char *root_abspath,
                          svn_boolean_t dry_run,
                          apr_pool_t *scratch_pool)
 {
@@ -3299,17 +3313,33 @@ write_out_rejected_hunks(patch_target_t
     {
       /* Write out rejected hunks, if any. */
       apr_file_t *reject_file;
+      svn_error_t *err;
 
-      SVN_ERR(svn_io_open_uniquely_named(&reject_file, NULL,
-                                         svn_dirent_dirname(
-                                              target->local_abspath,
-                                              scratch_pool),
-                                         svn_dirent_basename(
-                                              target->local_abspath,
-                                              NULL),
-                                         ".svnpatch.rej",
-                                         svn_io_file_del_none,
-                                         scratch_pool, scratch_pool));
+      err = svn_io_open_uniquely_named(&reject_file, NULL,
+                                       svn_dirent_dirname(target->local_abspath,
+                                                          scratch_pool),
+                                       svn_dirent_basename(
+                                         target->local_abspath,
+                                         NULL),
+                                       ".svnpatch.rej",
+                                       svn_io_file_del_none,
+                                       scratch_pool, scratch_pool);
+      if (err && APR_STATUS_IS_ENOENT(err->apr_err))
+        {
+          /* The hunk applies to a file in a directory which does not exist.
+           * Put the reject file into the working copy root instead. */
+          svn_error_clear(err);
+          SVN_ERR(svn_io_open_uniquely_named(&reject_file, NULL,
+                                             root_abspath,
+                                             svn_dirent_basename(
+                                               target->local_abspath,
+                                               NULL),
+                                             ".svnpatch.rej",
+                                             svn_io_file_del_none,
+                                             scratch_pool, scratch_pool));
+        }
+      else
+        SVN_ERR(err);
 
       SVN_ERR(svn_stream_reset(target->reject_stream));
 
@@ -3665,7 +3695,8 @@ apply_patches(/* The path to the patch f
                     SVN_ERR(install_patched_prop_targets(target, ctx,
                                                          dry_run, iterpool));
 
-                  SVN_ERR(write_out_rejected_hunks(target, dry_run, iterpool));
+                  SVN_ERR(write_out_rejected_hunks(target, root_abspath,
+                                                   dry_run, iterpool));
 
                   APR_ARRAY_PUSH(targets_info,
                                  patch_target_info_t *) = target_info;

Modified: subversion/branches/parallel-put/subversion/libsvn_client/relocate.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_client/relocate.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_client/relocate.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_client/relocate.c Thu Jan 21 21:39:22 2016
@@ -141,6 +141,8 @@ svn_client_relocate2(const char *wcroot_
   apr_hash_index_t *hi;
   apr_pool_t *iterpool = NULL;
   const char *old_repos_root_url, *new_repos_root_url;
+  char *sig_from_prefix, *sig_to_prefix;
+  apr_size_t index_from, index_to;
 
   /* Populate our validator callback baton, and call the relocate code. */
   vb.ctx = ctx;
@@ -183,6 +185,21 @@ svn_client_relocate2(const char *wcroot_
   if (! apr_hash_count(externals_hash))
     return SVN_NO_ERROR;
 
+  /* A valid prefix for the main working copy may be too long to be
+     valid for an external.  Trim any common trailing characters to
+     leave the significant part that changes. */
+  sig_from_prefix = apr_pstrdup(pool, from_prefix);
+  sig_to_prefix = apr_pstrdup(pool, to_prefix);
+  index_from = strlen(sig_from_prefix);
+  index_to = strlen(sig_to_prefix);
+  while (index_from && index_to
+         && sig_from_prefix[index_from] == sig_to_prefix[index_to])
+    {
+      sig_from_prefix[index_from] = sig_to_prefix[index_to] = '\0';
+      --index_from;
+      --index_to;
+    }
+
   iterpool = svn_pool_create(pool);
 
   for (hi = apr_hash_first(pool, externals_hash);
@@ -218,7 +235,8 @@ svn_client_relocate2(const char *wcroot_
           SVN_ERR(err);
 
           if (strcmp(old_repos_root_url, this_repos_root_url) == 0)
-            SVN_ERR(svn_client_relocate2(this_abspath, from_prefix, to_prefix,
+            SVN_ERR(svn_client_relocate2(this_abspath,
+                                         sig_from_prefix, sig_to_prefix,
                                          FALSE /* ignore_externals */,
                                          ctx, iterpool));
         }

Modified: subversion/branches/parallel-put/subversion/libsvn_client/resolved.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_client/resolved.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_client/resolved.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_client/resolved.c Thu Jan 21 21:39:22 2016
@@ -482,7 +482,7 @@ static const svn_client_conflict_option_
 {
   {
     svn_client_conflict_option_postpone,
-    N_("mark the conflict to be resolved later"),
+    N_("skip this conflict and leave it unresolved"),
     NULL,
     resolve_text_conflict
   },
@@ -496,21 +496,28 @@ static const svn_client_conflict_option_
 
   {
     svn_client_conflict_option_working_text,
-    N_("accept working copy version of entire file"),
+    N_("reject all incoming changes for this file"),
     NULL,
     resolve_text_conflict
   },
 
   {
     svn_client_conflict_option_incoming_text_where_conflicted,
-    N_("accept incoming version of all text conflicts in file"),
+    N_("accept incoming changes only where they conflict"),
     NULL,
     resolve_text_conflict
   },
 
   {
     svn_client_conflict_option_working_text_where_conflicted,
-    N_("accept working copy version of all text conflicts in file"),
+    N_("reject incoming changes which conflict and accept the rest"),
+    NULL,
+    resolve_text_conflict
+  },
+
+  {
+    svn_client_conflict_option_merged_text,
+    N_("accept the file as it appears in the working copy"),
     NULL,
     resolve_text_conflict
   },
@@ -522,7 +529,7 @@ static const svn_client_conflict_option_
 {
   {
     svn_client_conflict_option_postpone,
-    N_("mark the conflict to be resolved later"),
+    N_("skip this conflict and leave it unresolved"),
     NULL,
     resolve_text_conflict,
   },
@@ -541,6 +548,13 @@ static const svn_client_conflict_option_
     resolve_text_conflict
   },
 
+  {
+    svn_client_conflict_option_merged_text,
+    N_("accept the file as it appears in the working copy"),
+    NULL,
+    resolve_text_conflict
+  },
+
 };
 
 /* Resolver options for a property conflict */
@@ -548,7 +562,7 @@ static const svn_client_conflict_option_
 {
   {
     svn_client_conflict_option_postpone,
-    N_("mark the conflict to be resolved later"),
+    N_("skip this conflict and leave it unresolved"),
     NULL,
     resolve_prop_conflict
   },
@@ -567,6 +581,13 @@ static const svn_client_conflict_option_
     resolve_prop_conflict
   },
 
+  {
+    svn_client_conflict_option_merged_text,
+    N_("accept merged version of property value"),
+    NULL,
+    resolve_prop_conflict
+  },
+
 };
 
 /* Resolver options for a tree conflict */
@@ -574,7 +595,7 @@ static const svn_client_conflict_option_
 {
   {
     svn_client_conflict_option_postpone,
-    N_("mark the conflict to be resolved later"),
+    N_("skip this conflict and leave it unresolved"),
     NULL,
     resolve_tree_conflict
   },

Modified: subversion/branches/parallel-put/subversion/libsvn_client/revisions.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_client/revisions.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_client/revisions.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_client/revisions.c Thu Jan 21 21:39:22 2016
@@ -89,7 +89,9 @@ svn_client__get_revision_number(svn_revn
         /* The BASE, COMMITTED, and PREV revision keywords do not
            apply to URLs. */
         if (svn_path_is_url(local_abspath))
-          goto invalid_rev_arg;
+          return svn_error_create(SVN_ERR_CLIENT_BAD_REVISION, NULL,
+                                  _("PREV, BASE, or COMMITTED revision "
+                                    "keywords are invalid for URL"));
 
         err = svn_wc__node_get_origin(NULL, revnum, NULL, NULL, NULL, NULL,
                                       NULL,
@@ -129,7 +131,9 @@ svn_client__get_revision_number(svn_revn
         /* The BASE, COMMITTED, and PREV revision keywords do not
            apply to URLs. */
         if (svn_path_is_url(local_abspath))
-          goto invalid_rev_arg;
+          return svn_error_create(SVN_ERR_CLIENT_BAD_REVISION, NULL,
+                                  _("PREV, BASE, or COMMITTED revision "
+                                    "keywords are invalid for URL"));
 
         SVN_ERR(svn_wc__node_get_changed_info(revnum, NULL, NULL,
                                               wc_ctx, local_abspath,
@@ -183,10 +187,4 @@ svn_client__get_revision_number(svn_revn
     *revnum = *youngest_rev;
 
   return SVN_NO_ERROR;
-
-  invalid_rev_arg:
-    return svn_error_create(
-      SVN_ERR_CLIENT_BAD_REVISION, NULL,
-      _("PREV, BASE, or COMMITTED revision keywords are invalid for URL"));
-
 }

Modified: subversion/branches/parallel-put/subversion/libsvn_delta/branch.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_delta/branch.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_delta/branch.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_delta/branch.c Thu Jan 21 21:39:22 2016
@@ -145,36 +145,6 @@ branch_txn_get_branches(const svn_branch
 
 /* An #svn_branch__txn_t method. */
 static svn_error_t *
-branch_txn_add_branch(svn_branch__txn_t *txn,
-                      svn_branch__state_t *branch,
-                      apr_pool_t *scratch_pool)
-{
-  APR_ARRAY_PUSH(txn->priv->branches, void *) = branch;
-
-  return SVN_NO_ERROR;
-}
-
-/* An #svn_branch__txn_t method. */
-static svn_branch__state_t *
-branch_txn_add_new_branch(svn_branch__txn_t *txn,
-                          const char *bid,
-                          int root_eid,
-                          apr_pool_t *scratch_pool)
-{
-  svn_branch__state_t *new_branch;
-
-  SVN_ERR_ASSERT_NO_RETURN(root_eid != -1);
-
-  new_branch = branch_state_create(bid, root_eid, txn,
-                                   txn->priv->branches->pool);
-
-  APR_ARRAY_PUSH(txn->priv->branches, void *) = new_branch;
-
-  return new_branch;
-}
-
-/* An #svn_branch__txn_t method. */
-static svn_error_t *
 branch_txn_delete_branch(svn_branch__txn_t *txn,
                          const char *bid,
                          apr_pool_t *scratch_pool)
@@ -223,79 +193,63 @@ branch_txn_new_eid(svn_branch__txn_t *tx
 static svn_error_t *
 branch_txn_open_branch(svn_branch__txn_t *txn,
                        svn_branch__state_t **new_branch_p,
-                       const char *new_branch_id,
+                       const char *branch_id,
                        int root_eid,
+                       svn_branch__rev_bid_eid_t *tree_ref,
                        apr_pool_t *result_pool,
                        apr_pool_t *scratch_pool)
 {
   svn_branch__state_t *new_branch;
 
-  /* if the subbranch already exists, just return it */
+  /* if the branch already exists, just return it, else create it */
   new_branch
-    = svn_branch__txn_get_branch_by_id(txn, new_branch_id, scratch_pool);
+    = svn_branch__txn_get_branch_by_id(txn, branch_id, scratch_pool);
   if (new_branch)
     {
       SVN_ERR_ASSERT(root_eid == svn_branch__root_eid(new_branch));
     }
   else
     {
-      new_branch = svn_branch__txn_add_new_branch(txn,
-                                                  new_branch_id,
-                                                  root_eid, scratch_pool);
-    }
-
-  if (new_branch_p)
-    *new_branch_p = new_branch;
-  return SVN_NO_ERROR;
-}
+      SVN_ERR_ASSERT_NO_RETURN(root_eid != -1);
 
-/* An #svn_branch__txn_t method. */
-static svn_error_t *
-branch_txn_branch(svn_branch__txn_t *txn,
-                  svn_branch__state_t **new_branch_p,
-                  svn_branch__rev_bid_eid_t *from,
-                  const char *new_branch_id,
-                  apr_pool_t *result_pool,
-                  apr_pool_t *scratch_pool)
-{
-  svn_branch__state_t *new_branch;
-  svn_branch__state_t *from_branch;
-  svn_element__tree_t *from_subtree;
+      new_branch = branch_state_create(branch_id, root_eid, txn,
+                                       txn->priv->branches->pool);
+      APR_ARRAY_PUSH(txn->priv->branches, void *) = new_branch;
+    }
 
-  SVN_ERR(branch_in_rev_or_txn(&from_branch, from, txn, scratch_pool));
-  /* Source branch must exist */
-  if (! from_branch)
+  if (tree_ref)
     {
-      return svn_error_createf(SVN_BRANCH__ERR, NULL,
-                               _("Cannot branch from r%ld %s e%d: "
-                                 "branch does not exist"),
-                               from->rev, from->bid, from->eid);
-    }
+      svn_branch__state_t *from_branch;
+      svn_element__tree_t *tree;
 
-  SVN_ERR_ASSERT(from_branch->priv->is_flat);
+      SVN_ERR(branch_in_rev_or_txn(&from_branch, tree_ref, txn, scratch_pool));
+      /* Source branch must exist */
+      if (! from_branch)
+        {
+          return svn_error_createf(SVN_BRANCH__ERR, NULL,
+                                   _("Cannot branch from r%ld %s e%d: "
+                                     "branch does not exist"),
+                                   tree_ref->rev, tree_ref->bid, tree_ref->eid);
+        }
 
-  SVN_ERR(svn_branch__state_get_elements(from_branch, &from_subtree,
-                                         scratch_pool));
-  from_subtree = svn_element__tree_get_subtree_at_eid(from_subtree,
-                                                     from->eid,
-                                                     scratch_pool);
-  /* Source element must exist */
-  if (! from_subtree)
-    {
-      return svn_error_createf(SVN_BRANCH__ERR, NULL,
-                               _("Cannot branch from r%ld %s e%d: "
-                                 "element does not exist"),
-                               from->rev, from->bid, from->eid);
-    }
+      SVN_ERR_ASSERT(from_branch->priv->is_flat);
 
-  new_branch = svn_branch__txn_add_new_branch(txn,
-                                              new_branch_id,
-                                              from->eid, scratch_pool);
+      SVN_ERR(svn_branch__state_get_elements(from_branch, &tree,
+                                             scratch_pool));
+      tree = svn_element__tree_get_subtree_at_eid(tree, tree_ref->eid,
+                                                  scratch_pool);
+      /* Source element must exist */
+      if (! tree)
+        {
+          return svn_error_createf(SVN_BRANCH__ERR, NULL,
+                                   _("Cannot branch from r%ld %s e%d: "
+                                     "element does not exist"),
+                                   tree_ref->rev, tree_ref->bid, tree_ref->eid);
+        }
 
-  /* Populate the mapping from the 'from' source */
-  SVN_ERR(branch_instantiate_elements(new_branch, from_subtree,
-                                      scratch_pool));
-  new_branch->priv->is_flat = TRUE;
+      /* Populate the tree from the 'from' source */
+      SVN_ERR(branch_instantiate_elements(new_branch, tree, scratch_pool));
+    }
 
   if (new_branch_p)
     *new_branch_p = new_branch;
@@ -354,32 +308,6 @@ svn_branch__txn_get_branches(const svn_b
 }
 
 svn_error_t *
-svn_branch__txn_add_branch(svn_branch__txn_t *txn,
-                           svn_branch__state_t *branch,
-                           apr_pool_t *scratch_pool)
-{
-  SVN_ERR(txn->vtable->add_branch(txn,
-                                  branch,
-                                  scratch_pool));
-
-  return SVN_NO_ERROR;
-}
-
-svn_branch__state_t *
-svn_branch__txn_add_new_branch(svn_branch__txn_t *txn,
-                               const char *bid,
-                               int root_eid,
-                               apr_pool_t *scratch_pool)
-{
-  svn_branch__state_t *new_branch
-    = txn->vtable->add_new_branch(txn,
-                                  bid, root_eid,
-                                  scratch_pool);
-
-  return new_branch;
-}
-
-svn_error_t *
 svn_branch__txn_delete_branch(svn_branch__txn_t *txn,
                               const char *bid,
                               apr_pool_t *scratch_pool)
@@ -415,35 +343,21 @@ svn_branch__txn_new_eid(svn_branch__txn_
 svn_error_t *
 svn_branch__txn_open_branch(svn_branch__txn_t *txn,
                             svn_branch__state_t **new_branch_p,
-                            const char *new_branch_id,
+                            const char *branch_id,
                             int root_eid,
+                            svn_branch__rev_bid_eid_t *tree_ref,
                             apr_pool_t *result_pool,
                             apr_pool_t *scratch_pool)
 {
   SVN_ERR(txn->vtable->open_branch(txn,
                                    new_branch_p,
-                                   new_branch_id,
-                                   root_eid, result_pool,
+                                   branch_id,
+                                   root_eid, tree_ref, result_pool,
                                    scratch_pool));
   return SVN_NO_ERROR;
 }
 
 svn_error_t *
-svn_branch__txn_branch(svn_branch__txn_t *txn,
-                       svn_branch__state_t **new_branch_p,
-                       svn_branch__rev_bid_eid_t *from,
-                       const char *new_branch_id,
-                       apr_pool_t *result_pool,
-                       apr_pool_t *scratch_pool)
-{
-  SVN_ERR(txn->vtable->branch(txn,
-                              new_branch_p,
-                              from, new_branch_id, result_pool,
-                              scratch_pool));
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
 svn_branch__txn_finalize_eids(svn_branch__txn_t *txn,
                               apr_pool_t *scratch_pool)
 {
@@ -680,13 +594,10 @@ branch_txn_create(svn_branch__repos_t *r
   static const svn_branch__txn_vtable_t vtable = {
     {0},
     branch_txn_get_branches,
-    branch_txn_add_branch,
-    branch_txn_add_new_branch,
     branch_txn_delete_branch,
     branch_txn_get_num_new_eids,
     branch_txn_new_eid,
     branch_txn_open_branch,
-    branch_txn_branch,
     branch_txn_finalize_eids,
     branch_txn_serialize,
     branch_txn_sequence_point,
@@ -1701,7 +1612,7 @@ svn_branch__txn_parse(svn_branch__txn_t
 
       SVN_ERR(svn_branch__state_parse(&branch, txn, stream,
                                       result_pool, scratch_pool));
-      SVN_ERR(svn_branch__txn_add_branch(txn, branch, scratch_pool));
+      APR_ARRAY_PUSH(txn->priv->branches, void *) = branch;
     }
 
   *txn_p = txn;

Modified: subversion/branches/parallel-put/subversion/libsvn_delta/branch_compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_delta/branch_compat.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_delta/branch_compat.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_delta/branch_compat.c Thu Jan 21 21:39:22 2016
@@ -1763,35 +1763,6 @@ compat_branch_txn_get_branches(const svn
 
 /* An #svn_branch__txn_t method. */
 static svn_error_t *
-compat_branch_txn_add_branch(svn_branch__txn_t *txn,
-                             svn_branch__state_t *branch,
-                             apr_pool_t *scratch_pool)
-{
-  /* Just forwarding: nothing more is needed. */
-  SVN_ERR(svn_branch__txn_add_branch(txn->priv->txn,
-                                     branch,
-                                     scratch_pool));
-  return SVN_NO_ERROR;
-}
-
-/* An #svn_branch__txn_t method. */
-static svn_branch__state_t *
-compat_branch_txn_add_new_branch(svn_branch__txn_t *txn,
-                                 const char *bid,
-                                 int root_eid,
-                                 apr_pool_t *scratch_pool)
-{
-  /* Just forwarding: nothing more is needed. */
-  svn_branch__state_t *new_branch
-    = svn_branch__txn_add_new_branch(txn->priv->txn,
-                                     bid, root_eid,
-                                     scratch_pool);
-
-  return new_branch;
-}
-
-/* An #svn_branch__txn_t method. */
-static svn_error_t *
 compat_branch_txn_delete_branch(svn_branch__txn_t *txn,
                                 const char *bid,
                                 apr_pool_t *scratch_pool)
@@ -1846,13 +1817,14 @@ compat_branch_txn_open_branch(svn_branch
                               svn_branch__state_t **new_branch_p,
                               const char *new_branch_id,
                               int root_eid,
+                              svn_branch__rev_bid_eid_t *tree_ref,
                               apr_pool_t *result_pool,
                               apr_pool_t *scratch_pool)
 {
   /* Just forwarding: nothing more is needed. */
   SVN_ERR(svn_branch__txn_open_branch(txn->priv->txn,
                                       new_branch_p,
-                                      new_branch_id, root_eid,
+                                      new_branch_id, root_eid, tree_ref,
                                       result_pool,
                                       scratch_pool));
   return SVN_NO_ERROR;
@@ -1860,29 +1832,6 @@ compat_branch_txn_open_branch(svn_branch
 
 /* An #svn_branch__txn_t method. */
 static svn_error_t *
-compat_branch_txn_branch(svn_branch__txn_t *txn,
-                         svn_branch__state_t **new_branch_p,
-                         svn_branch__rev_bid_eid_t *from,
-                         const char *new_branch_id,
-                         apr_pool_t *result_pool,
-                         apr_pool_t *scratch_pool)
-{
-  svn_branch__state_t *new_branch;
-
-  /* Just forwarding: nothing more is needed. */
-  SVN_ERR(svn_branch__txn_branch(txn->priv->txn,
-                                 &new_branch, from,
-                                 new_branch_id,
-                                 result_pool,
-                                 scratch_pool));
-
-  if (new_branch_p)
-    *new_branch_p = new_branch;
-  return SVN_NO_ERROR;
-}
-
-/* An #svn_branch__txn_t method. */
-static svn_error_t *
 compat_branch_txn_serialize(svn_branch__txn_t *txn,
                             svn_stream_t *stream,
                             apr_pool_t *scratch_pool)
@@ -2012,13 +1961,10 @@ svn_branch__compat_txn_from_delta_for_co
   static const svn_branch__txn_vtable_t vtable = {
     {0},
     compat_branch_txn_get_branches,
-    compat_branch_txn_add_branch,
-    compat_branch_txn_add_new_branch,
     compat_branch_txn_delete_branch,
     compat_branch_txn_get_num_new_eids,
     compat_branch_txn_new_eid,
     compat_branch_txn_open_branch,
-    compat_branch_txn_branch,
     compat_branch_txn_finalize_eids,
     compat_branch_txn_serialize,
     compat_branch_txn_sequence_point,

Modified: subversion/branches/parallel-put/subversion/libsvn_delta/branch_nested.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_delta/branch_nested.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_delta/branch_nested.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_delta/branch_nested.c Thu Jan 21 21:39:22 2016
@@ -295,14 +295,18 @@ svn_branch__instantiate_elements_r(svn_b
         svn_branch__subtree_t *this_subtree = apr_hash_this_val(hi);
         const char *new_branch_id;
         svn_branch__state_t *new_branch;
+        /*### svn_branch__history_t *history;*/
 
         /* branch this subbranch into NEW_BRANCH (recursing) */
         new_branch_id = svn_branch__id_nest(to_branch->bid, this_outer_eid,
                                             scratch_pool);
-        new_branch = svn_branch__txn_add_new_branch(to_branch->txn,
-                                                    new_branch_id,
-                                                    this_subtree->tree->root_eid,
-                                                    scratch_pool);
+        SVN_ERR(svn_branch__txn_open_branch(to_branch->txn, &new_branch,
+                                            new_branch_id,
+                                            this_subtree->tree->root_eid,
+                                            NULL /*tree_ref*/,
+                                            scratch_pool, scratch_pool));
+        /*### SVN_ERR(svn_branch__state_set_history(new_branch, history,
+                                              scratch_pool));*/
 
         SVN_ERR(svn_branch__instantiate_elements_r(new_branch, *this_subtree,
                                                    scratch_pool));
@@ -462,35 +466,6 @@ nested_branch_txn_get_branches(const svn
 
 /* An #svn_branch__txn_t method. */
 static svn_error_t *
-nested_branch_txn_add_branch(svn_branch__txn_t *txn,
-                             svn_branch__state_t *branch,
-                             apr_pool_t *scratch_pool)
-{
-  /* Just forwarding: nothing more is needed. */
-  SVN_ERR(svn_branch__txn_add_branch(txn->priv->wrapped_txn,
-                                     branch,
-                                     scratch_pool));
-  return SVN_NO_ERROR;
-}
-
-/* An #svn_branch__txn_t method. */
-static svn_branch__state_t *
-nested_branch_txn_add_new_branch(svn_branch__txn_t *txn,
-                                 const char *bid,
-                                 int root_eid,
-                                 apr_pool_t *scratch_pool)
-{
-  /* Just forwarding: nothing more is needed. */
-  svn_branch__state_t *new_branch
-    = svn_branch__txn_add_new_branch(txn->priv->wrapped_txn,
-                                     bid, root_eid,
-                                     scratch_pool);
-
-  return new_branch;
-}
-
-/* An #svn_branch__txn_t method. */
-static svn_error_t *
 nested_branch_txn_delete_branch(svn_branch__txn_t *txn,
                                 const char *bid,
                                 apr_pool_t *scratch_pool)
@@ -537,47 +512,33 @@ nested_branch_txn_open_branch(svn_branch
                               svn_branch__state_t **new_branch_p,
                               const char *new_branch_id,
                               int root_eid,
+                              svn_branch__rev_bid_eid_t *tree_ref,
                               apr_pool_t *result_pool,
                               apr_pool_t *scratch_pool)
 {
-  /* Just forwarding: nothing more is needed. */
+  svn_branch__state_t *new_branch;
+
   SVN_ERR(svn_branch__txn_open_branch(txn->priv->wrapped_txn,
-                                      new_branch_p,
-                                      new_branch_id, root_eid,
+                                      &new_branch,
+                                      new_branch_id, root_eid, tree_ref,
                                       result_pool,
                                       scratch_pool));
-  return SVN_NO_ERROR;
-}
-
-/* Implements nested branching.
- * An #svn_branch__txn_t method. */
-static svn_error_t *
-nested_branch_txn_branch(svn_branch__txn_t *txn,
-                         svn_branch__state_t **new_branch_p,
-                         svn_branch__rev_bid_eid_t *from,
-                         const char *new_branch_id,
-                         apr_pool_t *result_pool,
-                         apr_pool_t *scratch_pool)
-{
-  svn_branch__state_t *new_branch;
-  svn_branch__state_t *from_branch;
-  svn_branch__subtree_t *from_subtree;
-
-  SVN_ERR(svn_branch__txn_branch(txn->priv->wrapped_txn,
-                                 &new_branch, from,
-                                 new_branch_id,
-                                 result_pool,
-                                 scratch_pool));
 
   /* Recursively branch any nested branches */
-  /* (The way we're doing it here also redundantly re-instantiates all the
-     elements in NEW_BRANCH.) */
-  SVN_ERR(branch_in_rev_or_txn(&from_branch, from, txn->priv->wrapped_txn,
-                               scratch_pool));
-  SVN_ERR(svn_branch__get_subtree(from_branch, &from_subtree, from->eid,
-                                  scratch_pool));
-  SVN_ERR(svn_branch__instantiate_elements_r(new_branch, *from_subtree,
-                                             scratch_pool));
+  if (tree_ref)
+    {
+      svn_branch__state_t *from_branch;
+      svn_branch__subtree_t *from_subtree;
+
+      /* (The way we're doing it here also redundantly re-instantiates all the
+         elements in NEW_BRANCH.) */
+      SVN_ERR(branch_in_rev_or_txn(&from_branch, tree_ref,
+                                   txn->priv->wrapped_txn, scratch_pool));
+      SVN_ERR(svn_branch__get_subtree(from_branch, &from_subtree,
+                                      tree_ref->eid, scratch_pool));
+      SVN_ERR(svn_branch__instantiate_elements_r(new_branch, *from_subtree,
+                                                 scratch_pool));
+    }
 
   if (new_branch_p)
     *new_branch_p = new_branch;
@@ -676,13 +637,10 @@ svn_branch__nested_txn_create(svn_branch
   static const svn_branch__txn_vtable_t vtable = {
     {0},
     nested_branch_txn_get_branches,
-    nested_branch_txn_add_branch,
-    nested_branch_txn_add_new_branch,
     nested_branch_txn_delete_branch,
     nested_branch_txn_get_num_new_eids,
     nested_branch_txn_new_eid,
     nested_branch_txn_open_branch,
-    nested_branch_txn_branch,
     nested_branch_txn_finalize_eids,
     nested_branch_txn_serialize,
     nested_branch_txn_sequence_point,

Modified: subversion/branches/parallel-put/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_diff/parse-diff.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_diff/parse-diff.c Thu Jan 21 21:39:22 2016
@@ -89,6 +89,10 @@ struct svn_diff_hunk_t {
   /* Did we see a 'file does not end with eol' marker in this hunk? */
   svn_boolean_t original_no_final_eol;
   svn_boolean_t modified_no_final_eol;
+
+  /* Fuzz penalty, triggered by bad patch targets */
+  svn_linenum_t original_fuzz;
+  svn_linenum_t modified_fuzz;
 };
 
 struct svn_diff_binary_patch_t {
@@ -122,7 +126,7 @@ add_or_delete_single_line(svn_diff_hunk_
                           apr_pool_t *result_pool,
                           apr_pool_t *scratch_pool)
 {
-  svn_diff_hunk_t *hunk = apr_palloc(result_pool, sizeof(*hunk));
+  svn_diff_hunk_t *hunk = apr_pcalloc(result_pool, sizeof(*hunk));
   static const char *hunk_header[] = { "@@ -1 +0,0 @@\n", "@@ -0,0 +1 @@\n" };
   const apr_size_t header_len = strlen(hunk_header[add]);
   const apr_size_t len = strlen(line);
@@ -285,6 +289,12 @@ svn_diff_hunk_get_trailing_context(const
   return hunk->trailing_context;
 }
 
+svn_linenum_t
+svn_diff_hunk__get_fuzz_penalty(const svn_diff_hunk_t *hunk)
+{
+  return hunk->patch->reverse ? hunk->original_fuzz : hunk->modified_fuzz;
+}
+
 /* Baton for the base85 stream implementation */
 struct base85_baton_t
 {
@@ -1183,24 +1193,38 @@ parse_next_hunk(svn_diff_hunk_t **hunk,
             }
 
           c = line->data[0];
-          if (original_lines > 0 && modified_lines > 0 &&
-              ((c == ' ')
+          if (c == ' '
+              || ((original_lines > 0 && modified_lines > 0)
+                  && ( 
                /* Tolerate chopped leading spaces on empty lines. */
-               || (! eof && line->len == 0)
+                      (! eof && line->len == 0)
                /* Maybe tolerate chopped leading spaces on non-empty lines. */
-               || (ignore_whitespace && c != del && c != add)))
+                      || (ignore_whitespace && c != del && c != add))))
             {
               /* It's a "context" line in the hunk. */
               hunk_seen = TRUE;
-              original_lines--;
-              modified_lines--;
+              if (original_lines > 0)
+                original_lines--;
+              else
+                {
+                  (*hunk)->original_length++;
+                  (*hunk)->original_fuzz++;
+                }
+              if (modified_lines > 0)
+                modified_lines--;
+              else
+                {
+                  (*hunk)->modified_length++;
+                  (*hunk)->modified_fuzz++;
+                }
               if (changed_line_seen)
                 trailing_context++;
               else
                 leading_context++;
               last_line_type = context_line;
             }
-          else if (original_lines > 0 && c == del)
+          else if (c == del
+                   && (original_lines > 0 || line->data[1] != del))
             {
               /* It's a "deleted" line in the hunk. */
               hunk_seen = TRUE;
@@ -1211,10 +1235,17 @@ parse_next_hunk(svn_diff_hunk_t **hunk,
               if (trailing_context > 0)
                 trailing_context = 0;
 
-              original_lines--;
+              if (original_lines > 0)
+                original_lines--;
+              else
+                {
+                  (*hunk)->original_length++;
+                  (*hunk)->original_fuzz++;
+                }
               last_line_type = original_line;
             }
-          else if (modified_lines > 0 && c == add)
+          else if (c == add
+                   && (modified_lines > 0 || line->data[1] != add))
             {
               /* It's an "added" line in the hunk. */
               hunk_seen = TRUE;
@@ -1225,7 +1256,13 @@ parse_next_hunk(svn_diff_hunk_t **hunk,
               if (trailing_context > 0)
                 trailing_context = 0;
 
-              modified_lines--;
+              if (modified_lines > 0)
+                modified_lines--;
+              else
+                {
+                  (*hunk)->modified_length++;
+                  (*hunk)->modified_fuzz++;
+                }
               last_line_type = modified_line;
             }
           else
@@ -1241,7 +1278,6 @@ parse_next_hunk(svn_diff_hunk_t **hunk,
                    * after the hunk text. */
                   end = last_line;
                 }
-
               if (original_end == 0)
                 original_end = end;
               if (modified_end == 0)
@@ -1318,6 +1354,21 @@ parse_next_hunk(svn_diff_hunk_t **hunk,
 
   if (hunk_seen && start < end)
     {
+      /* Did we get the number of context lines announced in the header?
+
+         If not... let's limit the number from the header to what we
+         actually have, and apply a fuzz penalty */
+      if (original_lines)
+        {
+          (*hunk)->original_length -= original_lines;
+          (*hunk)->original_fuzz += original_lines;
+        }
+      if (modified_lines)
+        {
+          (*hunk)->modified_length -= modified_lines;
+          (*hunk)->modified_fuzz += modified_lines;
+        }
+
       (*hunk)->patch = patch;
       (*hunk)->apr_file = apr_file;
       (*hunk)->leading_context = leading_context;

Modified: subversion/branches/parallel-put/subversion/libsvn_fs/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_fs/deprecated.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_fs/deprecated.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_fs/deprecated.c Thu Jan 21 21:39:22 2016
@@ -26,6 +26,7 @@
    deprecated functions in this file. */
 #define SVN_DEPRECATED
 
+#include <apr_md5.h>
 #include "svn_fs.h"
 
 
@@ -144,6 +145,51 @@ svn_fs_get_mergeinfo(svn_mergeinfo_catal
 }
 
 svn_error_t *
+svn_fs_paths_changed(apr_hash_t **changed_paths_p, svn_fs_root_t *root,
+                     apr_pool_t *pool)
+{
+  apr_hash_t *changed_paths_new_structs;
+  apr_hash_index_t *hi;
+
+  SVN_ERR(svn_fs_paths_changed2(&changed_paths_new_structs, root, pool));
+  *changed_paths_p = apr_hash_make(pool);
+  for (hi = apr_hash_first(pool, changed_paths_new_structs);
+       hi;
+       hi = apr_hash_next(hi))
+    {
+      const void *vkey;
+      apr_ssize_t klen;
+      void *vval;
+      svn_fs_path_change2_t *val;
+      svn_fs_path_change_t *change;
+      apr_hash_this(hi, &vkey, &klen, &vval);
+      val = vval;
+      change = apr_palloc(pool, sizeof(*change));
+      change->node_rev_id = val->node_rev_id;
+      change->change_kind = val->change_kind;
+      change->text_mod = val->text_mod;
+      change->prop_mod = val->prop_mod;
+      apr_hash_set(*changed_paths_p, vkey, klen, change);
+    }
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_fs_file_md5_checksum(unsigned char digest[],
+                         svn_fs_root_t *root,
+                         const char *path,
+                         apr_pool_t *pool)
+{
+  svn_checksum_t *md5sum;
+
+  SVN_ERR(svn_fs_file_checksum(&md5sum, svn_checksum_md5, root, path, TRUE,
+                               pool));
+  memcpy(digest, md5sum->digest, APR_MD5_DIGESTSIZE);
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_fs_history_prev(svn_fs_history_t **prev_history_p,
                     svn_fs_history_t *history, svn_boolean_t cross_copies,
                     apr_pool_t *pool)

Modified: subversion/branches/parallel-put/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_fs/fs-loader.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_fs/fs-loader.c Thu Jan 21 21:39:22 2016
@@ -26,7 +26,6 @@
 #include <apr.h>
 #include <apr_atomic.h>
 #include <apr_hash.h>
-#include <apr_md5.h>
 #include <apr_uuid.h>
 #include <apr_strings.h>
 
@@ -1057,36 +1056,6 @@ svn_fs_paths_changed2(apr_hash_t **chang
 }
 
 svn_error_t *
-svn_fs_paths_changed(apr_hash_t **changed_paths_p, svn_fs_root_t *root,
-                     apr_pool_t *pool)
-{
-  apr_hash_t *changed_paths_new_structs;
-  apr_hash_index_t *hi;
-
-  SVN_ERR(svn_fs_paths_changed2(&changed_paths_new_structs, root, pool));
-  *changed_paths_p = apr_hash_make(pool);
-  for (hi = apr_hash_first(pool, changed_paths_new_structs);
-       hi;
-       hi = apr_hash_next(hi))
-    {
-      const void *vkey;
-      apr_ssize_t klen;
-      void *vval;
-      svn_fs_path_change2_t *val;
-      svn_fs_path_change_t *change;
-      apr_hash_this(hi, &vkey, &klen, &vval);
-      val = vval;
-      change = apr_palloc(pool, sizeof(*change));
-      change->node_rev_id = val->node_rev_id;
-      change->change_kind = val->change_kind;
-      change->text_mod = val->text_mod;
-      change->prop_mod = val->prop_mod;
-      apr_hash_set(*changed_paths_p, vkey, klen, change);
-    }
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
 svn_fs_check_path(svn_node_kind_t *kind_p, svn_fs_root_t *root,
                   const char *path, apr_pool_t *pool)
 {
@@ -1384,21 +1353,6 @@ svn_fs_file_checksum(svn_checksum_t **ch
 
   return SVN_NO_ERROR;
 }
-
-svn_error_t *
-svn_fs_file_md5_checksum(unsigned char digest[],
-                         svn_fs_root_t *root,
-                         const char *path,
-                         apr_pool_t *pool)
-{
-  svn_checksum_t *md5sum;
-
-  SVN_ERR(svn_fs_file_checksum(&md5sum, svn_checksum_md5, root, path, TRUE,
-                               pool));
-  memcpy(digest, md5sum->digest, APR_MD5_DIGESTSIZE);
-
-  return SVN_NO_ERROR;
-}
 
 svn_error_t *
 svn_fs_file_contents(svn_stream_t **contents, svn_fs_root_t *root,

Modified: subversion/branches/parallel-put/subversion/libsvn_fs_base/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_fs_base/tree.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_fs_base/tree.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_fs_base/tree.c Thu Jan 21 21:39:22 2016
@@ -2661,7 +2661,7 @@ txn_body_commit(void *baton, trail_t *tr
 
   svn_revnum_t youngest_rev;
   const svn_fs_id_t *y_rev_root_id;
-  dag_node_t *txn_base_root_node;
+  dag_node_t *txn_base_root_node, *txn_root_node;
 
   /* Getting the youngest revision locks the revisions table until
      this trail is done. */
@@ -2694,6 +2694,19 @@ txn_body_commit(void *baton, trail_t *tr
      discovered locks. */
   SVN_ERR(verify_locks(txn_name, trail, trail->pool));
 
+  /* Ensure every txn has a mutable root as then the new revision will
+     have a distinct root node-revision-id.  This is necessary as
+     future transactions use the root node-revision-id as a proxy for
+     the transaction base revision. */
+  SVN_ERR(svn_fs_base__dag_txn_root(&txn_root_node, fs, txn_name,
+                                    trail, trail->pool));
+  if (!svn_fs_base__dag_check_mutable(txn_root_node, txn->id))
+    {
+      dag_node_t *clone;
+      SVN_ERR(svn_fs_base__dag_clone_root(&clone, fs, txn->id,
+                                          trail, trail->pool));
+    }
+
   /* Else, commit the txn. */
   return svn_fs_base__dag_commit_txn(&(args->new_rev), txn, trail,
                                      trail->pool);

Modified: subversion/branches/parallel-put/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_fs_fs/cached_data.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_fs_fs/cached_data.c Thu Jan 21 21:39:22 2016
@@ -2715,8 +2715,12 @@ svn_fs_fs__rep_contents_dir(apr_array_he
   SVN_ERR(get_dir_contents(dir, fs, noderev, result_pool, scratch_pool));
   *entries_p = dir->entries;
 
-  /* Update the cache, if we are to use one. */
-  if (cache)
+  /* Update the cache, if we are to use one.
+   *
+   * Don't even attempt to serialize very large directories; it would cause
+   * an unnecessary memory allocation peak.  150 bytes/entry is about right.
+   */
+  if (cache && svn_cache__is_cachable(cache, 150 * dir->entries->nelts))
     SVN_ERR(svn_cache__set(cache, key, dir, scratch_pool));
 
   return SVN_NO_ERROR;
@@ -2740,6 +2744,7 @@ svn_fs_fs__rep_contents_dir_entry(svn_fs
                                   apr_pool_t *result_pool,
                                   apr_pool_t *scratch_pool)
 {
+  extract_dir_entry_baton_t baton;
   svn_boolean_t found = FALSE;
 
   /* find the cache we may use */
@@ -2749,8 +2754,6 @@ svn_fs_fs__rep_contents_dir_entry(svn_fs
                                          scratch_pool);
   if (cache)
     {
-      extract_dir_entry_baton_t baton;
-
       svn_filesize_t filesize;
       SVN_ERR(get_txn_dir_info(&filesize, fs, noderev, scratch_pool));
 
@@ -2767,7 +2770,7 @@ svn_fs_fs__rep_contents_dir_entry(svn_fs
     }
 
   /* fetch data from disk if we did not find it in the cache */
-  if (! found)
+  if (! found || baton.out_of_date)
     {
       svn_fs_dirent_t *entry;
       svn_fs_dirent_t *entry_copy = NULL;
@@ -2777,8 +2780,12 @@ svn_fs_fs__rep_contents_dir_entry(svn_fs
       SVN_ERR(get_dir_contents(&dir, fs, noderev, scratch_pool,
                                scratch_pool));
 
-      /* Update the cache, if we are to use one. */
-      if (cache)
+      /* Update the cache, if we are to use one.
+       *
+       * Don't even attempt to serialize very large directories; it would
+       * cause an unnecessary memory allocation peak.  150 bytes / entry is
+       * about right. */
+      if (cache && svn_cache__is_cachable(cache, 150 * dir.entries->nelts))
         SVN_ERR(svn_cache__set(cache, key, &dir, scratch_pool));
 
       /* find desired entry and return a copy in POOL, if found */