You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2015/12/08 13:07:27 UTC

svn commit: r1718576 - in /subversion/branches/ra-git: ./ subversion/libsvn_delta/ subversion/libsvn_fs_fs/ subversion/libsvn_ra_local/ subversion/libsvn_ra_serf/ subversion/libsvn_ra_svn/ subversion/libsvn_repos/ subversion/libsvn_wc/ subversion/mod_d...

Author: rhuijben
Date: Tue Dec  8 12:07:26 2015
New Revision: 1718576

URL: http://svn.apache.org/viewvc?rev=1718576&view=rev
Log:
On the ra-git branch: Catch up with trunk @r1718575.

Added:
    subversion/branches/ra-git/tools/dist/README.advisory
      - copied unchanged from r1718570, subversion/trunk/tools/dist/README.advisory
    subversion/branches/ra-git/tools/dist/advisory.py
      - copied unchanged from r1718570, subversion/trunk/tools/dist/advisory.py
    subversion/branches/ra-git/tools/dist/security/mailinglist.py
      - copied unchanged from r1718570, subversion/trunk/tools/dist/security/mailinglist.py
Modified:
    subversion/branches/ra-git/   (props changed)
    subversion/branches/ra-git/CHANGES
    subversion/branches/ra-git/COMMITTERS
    subversion/branches/ra-git/subversion/libsvn_delta/branch_compat.c
    subversion/branches/ra-git/subversion/libsvn_delta/branch_nested.c
    subversion/branches/ra-git/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/ra-git/subversion/libsvn_ra_local/ra_plugin.c
    subversion/branches/ra-git/subversion/libsvn_ra_serf/inherited_props.c
    subversion/branches/ra-git/subversion/libsvn_ra_svn/client.c
    subversion/branches/ra-git/subversion/libsvn_ra_svn/marshal.c
    subversion/branches/ra-git/subversion/libsvn_repos/commit.c
    subversion/branches/ra-git/subversion/libsvn_wc/wc-queries.sql
    subversion/branches/ra-git/subversion/libsvn_wc/wc_db.c
    subversion/branches/ra-git/subversion/mod_dav_svn/status.c
    subversion/branches/ra-git/subversion/mod_dav_svn/util.c
    subversion/branches/ra-git/subversion/tests/cmdline/svnfsfs_tests.py
    subversion/branches/ra-git/subversion/tests/libsvn_client/mtcc-test.c
    subversion/branches/ra-git/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
    subversion/branches/ra-git/tools/dev/svnmover/merge3.c
    subversion/branches/ra-git/tools/dev/svnmover/svnmover.c
    subversion/branches/ra-git/tools/dev/svnmover/svnmover.h

Propchange: subversion/branches/ra-git/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Dec  8 12:07:26 2015
@@ -95,4 +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:1583624-1717847
+/subversion/trunk:1583624-1718575

Modified: subversion/branches/ra-git/CHANGES
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/CHANGES?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/CHANGES (original)
+++ subversion/branches/ra-git/CHANGES Tue Dec  8 12:07:26 2015
@@ -1,3 +1,46 @@
+Version 1.9.3
+(15 Dec 2015, from /branches/1.9.x)
+http://svn.apache.org/repos/asf/subversion/tags/1.9.3
+
+ User-visible changes:
+  - Client-side bugfixes:
+    * svn: fix possible crash in auth credentials cache (r1705328)
+    * cleanup: avoid unneeded memory growth during pristine cleanup (r1706241)
+    * diff: fix crash when repository is on server root (r1705060 et al)
+    * fix translations for commit notifications (r1709389, r1709562)
+    * ra_serf: fix crash in multistatus parser (r1706323, r1706324)
+    * svn: report lock/unlock errors as failures (r1701598 et al)
+    * svn: cleanup user deleted external registrations (r1705843, r1710558)
+    * svn: allow simple resolving of binary file text conflicts (r1703581)
+    * svnlook: properly remove tempfiles on diff errors (r1711346)
+    * ra_serf: report built- and run-time versions of libserf (r1704847)
+    * ra_serf: set Content-Type header in outgoing requests (r1715224 et al)
+    * svn: fix merging deletes of svn:eol-style CRLF/CR files (r1703689 et al)
+    * ra_local: disable zero-copy code path (r1718167)
+
+  - Server-side bugfixes:
+    * mod_authz_svn: fix authz with mod_auth_kerb/mod_auth_ntlm (issue #4602)
+    * mod_dav_svn: fix display of process ID in cache statistics (r1709553)
+    * mod_dav_svn: use LimitXMLRequestBody for skel-encoded requests (r1687812)
+    * svnadmin dump: preserve no-op changes (r1709388 et al, issue #4598)
+    * fsfs: avoid unneeded I/O when opening transactions (r1715793)
+
+  - Bindings bugfixes:
+    * javahl: fix ABI incompatibilty with 1.8 (r1710104)
+    * javahl: allow non-absolute paths in SVNClient.vacuum (r1710215, r1710290)
+
+ Developer-visible changes:
+  - General:
+    * fix patch filter invocation in svn_client_patch() (r1706783)
+    * add @since information to config defines (r1706983, r1706999)
+    * fix running the tests in compatibility mode (r1706375)
+    * clarify documentation of svn_fs_node_created_rev() (r1717154)
+
+  - API changes:
+    * fix overflow detection in svn_stringbuf_remove and _replace (r1714358)
+    * don't ignore some of the parameters to svn_ra_svn_create_conn3 (r1714314)
+
+
 Version 1.9.2
 (30 Sep 2015, from /branches/1.9.x)
 http://svn.apache.org/repos/asf/subversion/tags/1.9.2
@@ -794,6 +837,31 @@ http://svn.apache.org/repos/asf/subversi
     * javahl: allow compiling with a C++11 compiler (r1684412)
 
 
+Version 1.8.15
+(15 Dec 2015, from /branches/1.8.x)
+http://svn.apache.org/repos/asf/subversion/tags/1.8.15
+
+ User-visible changes:
+  - Client-side bugfixes:
+    * gpg-agent: fix crash with non-canonical $HOME (r1691928, issue #4584)
+
+  - Client-side and server-side bugfixes:
+    * fix a segfault with old style text delta (r1618472 et al)
+
+  - Server-side bugfixes:
+    * fsfs: reduce memory allocation with Apache (r1591005 et al)
+    * mod_dav_svn: emit first log items as soon as possible (r1666965 et al)
+    * mod_dav_svn: use LimitXMLRequestBody for skel-encoded requests (r1687812)
+
+  - Bindings bugfixes:
+    * swig: fix memory corruption in svn_client_copy_source_t (r1694929)
+
+ Developer-visible changes:
+  - General:
+    * better configure-time detection of httpd authz fix (r1687304 et al)
+    * fix compilation with apr 1.2.x (r1701237)
+
+
 Version 1.8.14
 (5 Aug 2015, from /branches/1.8.x)
 http://svn.apache.org/repos/asf/subversion/tags/1.8.14

Modified: subversion/branches/ra-git/COMMITTERS
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/COMMITTERS?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/COMMITTERS [UTF-8] (original)
+++ subversion/branches/ra-git/COMMITTERS [UTF-8] Tue Dec  8 12:07:26 2015
@@ -60,6 +60,7 @@ Blanket commit access:
          trent   Trent Nelson <tr...@snakebite.org>
         kotkov   Evgeny Kotkov <ev...@visualsvn.com>
       astieger   Andreas Stieger <an...@gmx.de>
+      jamessan   James McCoy <ja...@jamessan.com>
 
 [[END ACTIVE FULL COMMITTERS.  LEAVE THIS LINE HERE; SCRIPTS LOOK FOR IT.]]
 

Modified: subversion/branches/ra-git/subversion/libsvn_delta/branch_compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_delta/branch_compat.c?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_delta/branch_compat.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_delta/branch_compat.c Tue Dec  8 12:07:26 2015
@@ -1186,30 +1186,27 @@ convert_branch_to_paths(apr_hash_t *path
   for (hi = apr_hash_first(scratch_pool, elements->e_map);
        hi; hi = apr_hash_next(hi))
     {
-      int eid = *(const int *)apr_hash_this_key(hi);
+      int eid = svn_eid__hash_this_key(hi);
+      svn_element__content_t *element = apr_hash_this_val(hi);
       const char *rrpath
         = branch_get_storage_rrpath_by_eid(branch, eid, result_pool);
-      svn_branch__el_rev_id_t *ba = svn_hash_gets(paths, rrpath);
+      svn_branch__el_rev_id_t *ba;
 
-      /* Fill in the details. If it's already been filled in, then let a
-         branch-root element override a sub-branch element of an outer
-         branch, because the branch-root element is the one that should
-         be specifying the element's payload.
-       */
-      if (! ba
-          || eid == svn_branch__root_eid(branch))
-        {
-          ba = svn_branch__el_rev_id_create(branch, eid, branch->txn->rev,
-                                            result_pool);
-          svn_hash_sets(paths, rrpath, ba);
-          /*SVN_DBG(("branch-to-path[%d]: b%s e%d -> %s",
-                   i, svn_branch__get_id(branch, scratch_pool), eid, rrpath));*/
-        }
-      else
-        {
-          /*SVN_DBG(("branch-to-path: b%s e%d -> <already present; not overwriting> (%s)",
-                   svn_branch__get_id(branch, scratch_pool), eid, rrpath));*/
-        }
+      /* A subbranch-root element carries no payload; the corresponding
+         inner branch root element will provide the payload for this path. */
+      if (element->payload->is_subbranch_root)
+        continue;
+
+      /* No other element should exist at this path, given that we avoid
+         storing anything for a subbranch-root element. */
+      SVN_ERR_ASSERT(! svn_hash_gets(paths, rrpath));
+
+      /* Fill in the details. */
+      ba = svn_branch__el_rev_id_create(branch, eid, branch->txn->rev,
+                                        result_pool);
+      svn_hash_sets(paths, rrpath, ba);
+      /*SVN_DBG(("branch-to-path[%d]: b%s e%d -> %s",
+               i, svn_branch__get_id(branch, scratch_pool), eid, rrpath));*/
     }
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/ra-git/subversion/libsvn_delta/branch_nested.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_delta/branch_nested.c?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_delta/branch_nested.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_delta/branch_nested.c Tue Dec  8 12:07:26 2015
@@ -120,15 +120,17 @@ svn_branch__get_subbranch_at_eid(svn_bra
   return SVN_NO_ERROR;
 }
 
-svn_error_t *
-svn_branch__get_immediate_subbranches(svn_branch__state_t *branch,
-                                      apr_array_header_t **subbranches_p,
-                                      apr_pool_t *result_pool,
-                                      apr_pool_t *scratch_pool)
+/* Set *SUBBRANCH_EIDS_P an array of EIDs of the subbranch-root elements in
+ * BRANCH.
+ */
+static svn_error_t *
+svn_branch__get_immediate_subbranch_eids(svn_branch__state_t *branch,
+                                         apr_array_header_t **subbranch_eids_p,
+                                         apr_pool_t *result_pool,
+                                         apr_pool_t *scratch_pool)
 {
-  apr_array_header_t *subbranches
-    = apr_array_make(result_pool, 0, sizeof(void *));
-  const char *branch_id = svn_branch__get_id(branch, scratch_pool);
+  apr_array_header_t *subbranch_eids
+    = apr_array_make(result_pool, 0, sizeof(int));
   svn_element__tree_t *elements;
   apr_hash_index_t *hi;
 
@@ -141,16 +143,39 @@ svn_branch__get_immediate_subbranches(sv
 
       if (element->payload->is_subbranch_root)
         {
-          const char *subbranch_id
-            = svn_branch__id_nest(branch_id, eid, scratch_pool);
-          svn_branch__state_t *subbranch
-            = svn_branch__txn_get_branch_by_id(branch->txn, subbranch_id,
-                                               scratch_pool);
-
-          SVN_ERR_ASSERT_NO_RETURN(subbranch);
-          APR_ARRAY_PUSH(subbranches, void *) = subbranch;
+          APR_ARRAY_PUSH(subbranch_eids, int) = eid;
         }
     }
+  *subbranch_eids_p = subbranch_eids;
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_branch__get_immediate_subbranches(svn_branch__state_t *branch,
+                                      apr_array_header_t **subbranches_p,
+                                      apr_pool_t *result_pool,
+                                      apr_pool_t *scratch_pool)
+{
+  apr_array_header_t *subbranch_eids;
+  apr_array_header_t *subbranches
+    = apr_array_make(result_pool, 0, sizeof(void *));
+  const char *branch_id = svn_branch__get_id(branch, scratch_pool);
+  int i;
+
+  SVN_ERR(svn_branch__get_immediate_subbranch_eids(branch, &subbranch_eids,
+                                                   scratch_pool, scratch_pool));
+  for (i = 0; i < subbranch_eids->nelts; i++)
+    {
+      int eid = APR_ARRAY_IDX(subbranch_eids, i, int);
+      const char *subbranch_id
+        = svn_branch__id_nest(branch_id, eid, scratch_pool);
+      svn_branch__state_t *subbranch
+        = svn_branch__txn_get_branch_by_id(branch->txn, subbranch_id,
+                                           scratch_pool);
+
+      SVN_ERR_ASSERT_NO_RETURN(subbranch);
+      APR_ARRAY_PUSH(subbranches, void *) = subbranch;
+    }
   *subbranches_p = subbranches;
   return SVN_NO_ERROR;
 }
@@ -175,7 +200,7 @@ svn_branch__get_subtree(svn_branch__stat
 {
   svn_element__tree_t *element_tree;
   svn_branch__subtree_t *new_subtree;
-  apr_array_header_t *subbranches;
+  apr_array_header_t *subbranch_eids;
   int i;
   apr_pool_t *iterpool = result_pool;  /* ### not a proper iterpool */
 
@@ -188,17 +213,13 @@ svn_branch__get_subtree(svn_branch__stat
                                                      result_pool);
 
   /* Add subbranches */
-  SVN_ERR(svn_branch__get_immediate_subbranches(branch, &subbranches,
-                                                result_pool, result_pool));
-  for (i = 0; i < subbranches->nelts; i++)
+  SVN_ERR(svn_branch__get_immediate_subbranch_eids(branch, &subbranch_eids,
+                                                   result_pool, result_pool));
+  for (i = 0; i < subbranch_eids->nelts; i++)
     {
-      svn_branch__state_t *subbranch = APR_ARRAY_IDX(subbranches, i, void *);
-      const char *outer_bid;
-      int outer_eid;
+      int outer_eid = APR_ARRAY_IDX(subbranch_eids, i, int);
       const char *subbranch_relpath_in_subtree;
 
-      svn_branch__id_unnest(&outer_bid, &outer_eid, subbranch->bid,
-                            iterpool);
       subbranch_relpath_in_subtree
         = svn_element__tree_get_path_by_eid(new_subtree->tree, outer_eid,
                                             iterpool);
@@ -206,13 +227,19 @@ svn_branch__get_subtree(svn_branch__stat
       /* Is it pathwise at or below EID? If so, add it into the subtree. */
       if (subbranch_relpath_in_subtree)
         {
+          svn_branch__state_t *subbranch;
           svn_branch__subtree_t *this_subtree;
 
-          SVN_ERR(svn_branch__get_subtree(subbranch, &this_subtree,
-                                          svn_branch__root_eid(subbranch),
-                                          result_pool));
-          svn_eid__hash_set(new_subtree->subbranches, outer_eid,
-                            this_subtree);
+          SVN_ERR(svn_branch__get_subbranch_at_eid(branch, &subbranch,
+                                                   outer_eid, iterpool));
+          if (subbranch)
+            {
+              SVN_ERR(svn_branch__get_subtree(subbranch, &this_subtree,
+                                              svn_branch__root_eid(subbranch),
+                                              result_pool));
+              svn_eid__hash_set(new_subtree->subbranches, outer_eid,
+                                this_subtree);
+            }
         }
     }
   *subtree_p = new_subtree;
@@ -302,36 +329,45 @@ svn_branch__find_nested_branch_element_b
 {
   /* The path we're looking for is (path-wise) in this branch. See if it
      is also in a sub-branch. */
+  /* Loop invariants: RELPATH is the path we're looking for, relative to
+     ROOT_BRANCH which is the current level of nesting that we've descended
+     into. */
   while (TRUE)
     {
-      apr_array_header_t *subbranches;
+      apr_array_header_t *subbranch_eids;
       int i;
       svn_boolean_t found = FALSE;
 
-      SVN_ERR(svn_branch__get_immediate_subbranches(root_branch, &subbranches,
-                                                    scratch_pool, scratch_pool));
-      for (i = 0; i < subbranches->nelts; i++)
+      SVN_ERR(svn_branch__get_immediate_subbranch_eids(
+                root_branch, &subbranch_eids, scratch_pool, scratch_pool));
+      for (i = 0; i < subbranch_eids->nelts; i++)
         {
-          svn_branch__state_t *subbranch = APR_ARRAY_IDX(subbranches, i, void *);
-          svn_branch__state_t *outer_branch;
-          int outer_eid;
+          int outer_eid = APR_ARRAY_IDX(subbranch_eids, i, int);
           const char *relpath_to_subbranch;
           const char *relpath_in_subbranch;
 
-          svn_branch__get_outer_branch_and_eid(&outer_branch, &outer_eid,
-                                               subbranch, scratch_pool);
-
+          /* Check whether the RELPATH we're looking for is within this
+             subbranch at OUTER_EID. If it is, recurse in the subbranch. */
           relpath_to_subbranch
             = svn_branch__get_path_by_eid(root_branch, outer_eid, scratch_pool);
-
           relpath_in_subbranch
             = svn_relpath_skip_ancestor(relpath_to_subbranch, relpath);
           if (relpath_in_subbranch)
             {
-              root_branch = subbranch;
-              relpath = relpath_in_subbranch;
-              found = TRUE;
-              break;
+              svn_branch__state_t *subbranch;
+
+              SVN_ERR(svn_branch__get_subbranch_at_eid(
+                        root_branch, &subbranch, outer_eid, scratch_pool));
+              /* If the branch hierarchy is not 'flat' then we might find
+                 there is no actual branch where the subbranch-root element
+                 says there should be one. In that case, ignore it. */
+              if (subbranch)
+                {
+                  root_branch = subbranch;
+                  relpath = relpath_in_subbranch;
+                  found = TRUE;
+                  break;
+                }
             }
         }
       if (! found)

Modified: subversion/branches/ra-git/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_fs/fs_fs.c?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_fs/fs_fs.c Tue Dec  8 12:07:26 2015
@@ -1416,8 +1416,8 @@ svn_fs_fs__file_text_rep_equal(svn_boole
   svn_stream_t *contents_a, *contents_b;
   representation_t *rep_a = a->data_rep;
   representation_t *rep_b = b->data_rep;
-  svn_boolean_t a_empty = !rep_a;
-  svn_boolean_t b_empty = !rep_b;
+  svn_boolean_t a_empty = !rep_a || rep_a->expanded_size == 0;
+  svn_boolean_t b_empty = !rep_b || rep_b->expanded_size == 0;
 
   /* This makes sure that neither rep will be NULL later on */
   if (a_empty && b_empty)

Modified: subversion/branches/ra-git/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_ra_local/ra_plugin.c?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_ra_local/ra_plugin.c Tue Dec  8 12:07:26 2015
@@ -360,8 +360,13 @@ make_reporter(svn_ra_session_t *session,
                                   edit_baton,
                                   NULL,
                                   NULL,
-                                  1024 * 1024,  /* process-local transfers
-                                                   should be fast */
+                                  0, /* Disable zero-copy codepath, because
+                                        RA API users are unaware about the
+                                        zero-copy code path limitation (do
+                                        not access FSFS data structures
+                                        and, hence, caches).  See notes
+                                        to svn_repos_begin_report3() for
+                                        additional details. */
                                   result_pool));
 
   /* Wrap the report baton given us by the repos layer with our own

Modified: subversion/branches/ra-git/subversion/libsvn_ra_serf/inherited_props.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_ra_serf/inherited_props.c?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_ra_serf/inherited_props.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_ra_serf/inherited_props.c Tue Dec  8 12:07:26 2015
@@ -143,9 +143,7 @@ iprops_closed(svn_ra_serf__xml_estate_t
         return svn_error_create(SVN_ERR_XML_MALFORMED, NULL, NULL);
 
       iprops_ctx->curr_iprop->path_or_url =
-        svn_path_url_add_component2(iprops_ctx->repos_root_url,
-                                    cdata->data,
-                                    iprops_ctx->pool);
+                                apr_pstrdup(iprops_ctx->pool, cdata->data);
     }
   else if (leaving_state == IPROPS_PROPNAME)
     {

Modified: subversion/branches/ra-git/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_ra_svn/client.c?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_ra_svn/client.c Tue Dec  8 12:07:26 2015
@@ -1193,7 +1193,6 @@ parse_iproplist(apr_array_header_t **inh
 
 {
   int i;
-  const char *repos_root_url;
   apr_pool_t *iterpool;
 
   if (iproplist == NULL)
@@ -1206,8 +1205,6 @@ parse_iproplist(apr_array_header_t **inh
       return SVN_NO_ERROR;
     }
 
-  SVN_ERR(ra_svn_get_repos_root(session, &repos_root_url, scratch_pool));
-
   *inherited_props = apr_array_make(
     result_pool, iproplist->nelts, sizeof(svn_prop_inherited_item_t *));
 
@@ -1232,9 +1229,7 @@ parse_iproplist(apr_array_header_t **inh
       SVN_ERR(svn_ra_svn__parse_tuple(&elt->u.list, "cl",
                                       &parent_rel_path, &iprop_list));
       SVN_ERR(svn_ra_svn__parse_proplist(iprop_list, iterpool, &iprops));
-      new_iprop->path_or_url = svn_path_url_add_component2(repos_root_url,
-                                                           parent_rel_path,
-                                                           result_pool);
+      new_iprop->path_or_url = apr_pstrdup(result_pool, parent_rel_path);
       new_iprop->prop_hash = svn_hash__make(result_pool);
       for (hi = apr_hash_first(iterpool, iprops);
            hi;

Modified: subversion/branches/ra-git/subversion/libsvn_ra_svn/marshal.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_ra_svn/marshal.c?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_ra_svn/marshal.c Tue Dec  8 12:07:26 2015
@@ -1194,6 +1194,7 @@ static svn_error_t *read_string(svn_ra_s
   apr_size_t len = (apr_size_t)len64;
   apr_size_t readbuf_len;
   char *dest;
+  apr_size_t buflen;
 
   /* We can't store strings longer than the maximum size of apr_size_t,
    * so check before using the truncated value. */
@@ -1201,8 +1202,9 @@ static svn_error_t *read_string(svn_ra_s
     return svn_error_create(SVN_ERR_RA_SVN_MALFORMED_DATA, NULL,
                             _("String length larger than maximum"));
 
+  buflen = conn->read_end - conn->read_ptr;
   /* Shorter strings can be copied directly from the read buffer. */
-  if (conn->read_ptr + len <= conn->read_end)
+  if (len <= buflen)
     {
       item->kind = SVN_RA_SVN_STRING;
       item->u.string.data = apr_pstrmemdup(pool, conn->read_ptr, len);

Modified: subversion/branches/ra-git/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_repos/commit.c?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_repos/commit.c Tue Dec  8 12:07:26 2015
@@ -73,7 +73,7 @@ struct edit_baton
   svn_repos_t *repos;
 
   /* URL to the root of the open repository. */
-  const char *repos_url_decoded;
+  const char *repos_root_url;
 
   /* The name of the repository (here for convenience). */
   const char *repos_name;
@@ -324,7 +324,6 @@ add_file_or_directory(const char *path,
       const char *fs_path;
       svn_fs_root_t *copy_root;
       svn_node_kind_t kind;
-      size_t repos_url_len;
       svn_repos_authz_access_t required;
 
       /* Copy requires recursive write access to the destination path
@@ -345,14 +344,15 @@ add_file_or_directory(const char *path,
 
       /* For now, require that the url come from the same repository
          that this commit is operating on. */
-      copy_path = svn_path_uri_decode(copy_path, subpool);
-      repos_url_len = strlen(eb->repos_url_decoded);
-      if (strncmp(copy_path, eb->repos_url_decoded, repos_url_len) != 0)
+      copy_path = svn_uri_canonicalize(copy_path, subpool);
+      copy_path = svn_uri_skip_ancestor(eb->repos_root_url, copy_path,
+                                        subpool);
+      if (!copy_path)
         return svn_error_createf
           (SVN_ERR_FS_GENERAL, NULL,
            _("Source url '%s' is from different repository"), copy_path);
 
-      fs_path = apr_pstrdup(subpool, copy_path + repos_url_len);
+      fs_path = svn_fspath__canonicalize(copy_path, pool);
 
       /* Now use the "fs_path" as an absolute path within the
          repository to make the copy from. */
@@ -1009,7 +1009,9 @@ svn_repos_get_commit_editor5(const svn_d
   struct edit_baton *eb;
   svn_delta_shim_callbacks_t *shim_callbacks =
                                     svn_delta_shim_callbacks_default(pool);
-  const char *repos_url = svn_path_uri_encode(repos_url_decoded, pool);
+  /* Our api contract explicitly requires a not canonical url here.
+     ### Should fix that when revving this api */
+  const char *repos_url = svn_uri_canonicalize(repos_url_decoded, pool);
 
   /* Do a global authz access lookup.  Users with no write access
      whatsoever to the repository don't get a commit editor. */
@@ -1051,7 +1053,7 @@ svn_repos_get_commit_editor5(const svn_d
   eb->authz_baton = authz_baton;
   eb->base_path = svn_fspath__canonicalize(base_path, subpool);
   eb->repos = repos;
-  eb->repos_url_decoded = repos_url_decoded;
+  eb->repos_root_url = repos_url;
   eb->repos_name = svn_dirent_basename(svn_repos_path(repos, subpool),
                                        subpool);
   eb->fs = svn_repos_fs(repos);

Modified: subversion/branches/ra-git/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/wc-queries.sql?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/wc-queries.sql Tue Dec  8 12:07:26 2015
@@ -1747,13 +1747,6 @@ WHERE wc_id = ?1
 
 /* Queries for cached inherited properties. */
 
-/* Select the inherited properties of a single base node. */
--- STMT_SELECT_IPROPS
-SELECT inherited_props FROM nodes
-WHERE wc_id = ?1
-  AND local_relpath = ?2
-  AND op_depth = 0
-
 /* Update the inherited properties of a single base node. */
 -- STMT_UPDATE_IPROP
 UPDATE nodes

Modified: subversion/branches/ra-git/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/wc_db.c?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/wc_db.c Tue Dec  8 12:07:26 2015
@@ -10618,68 +10618,6 @@ svn_wc__db_prop_retrieve_recursive(apr_h
   return svn_error_trace(svn_sqlite__reset(stmt));
 }
 
-/* The body of svn_wc__db_read_cached_iprops(). */
-static svn_error_t *
-db_read_cached_iprops(apr_array_header_t **iprops,
-                      svn_wc__db_wcroot_t *wcroot,
-                      const char *local_relpath,
-                      apr_pool_t *result_pool,
-                      apr_pool_t *scratch_pool)
-{
-  svn_sqlite__stmt_t *stmt;
-  svn_boolean_t have_row;
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_SELECT_IPROPS));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
-  SVN_ERR(svn_sqlite__step(&have_row, stmt));
-
-  if (!have_row)
-    {
-      return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND,
-                               svn_sqlite__reset(stmt),
-                               _("The node '%s' was not found."),
-                               path_for_error_message(wcroot, local_relpath,
-                                                      scratch_pool));
-    }
-
-  SVN_ERR(svn_sqlite__column_iprops(iprops, stmt, 0,
-                                    result_pool, scratch_pool));
-
-  SVN_ERR(svn_sqlite__reset(stmt));
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_wc__db_read_cached_iprops(apr_array_header_t **iprops,
-                              svn_wc__db_t *db,
-                              const char *local_abspath,
-                              apr_pool_t *result_pool,
-                              apr_pool_t *scratch_pool)
-{
-  svn_wc__db_wcroot_t *wcroot;
-  const char *local_relpath;
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
-
-  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                                                db, local_abspath,
-                                                scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(wcroot);
-
-  /* Don't use with_txn yet, as we perform just a single transaction */
-  SVN_ERR(db_read_cached_iprops(iprops, wcroot, local_relpath,
-                                result_pool, scratch_pool));
-
-  if (!*iprops)
-    {
-      *iprops = apr_array_make(result_pool, 0,
-                               sizeof(svn_prop_inherited_item_t *));
-    }
-
-  return SVN_NO_ERROR;
-}
-
 /* Remove all prop name value pairs from PROP_HASH where the property
    name is not PROPNAME. */
 static void
@@ -11402,7 +11340,9 @@ relocate_txn(svn_wc__db_wcroot_t *wcroot
 
   SVN_ERR(svn_wc__db_fetch_repos_info(NULL, &repos_uuid, wcroot,
                                       old_repos_id, scratch_pool));
-  SVN_ERR_ASSERT(repos_uuid);  /* This function affects all the children of the given local_relpath,
+  SVN_ERR_ASSERT(repos_uuid);
+
+  /* This function affects all the children of the given local_relpath,
      but the way that it does this is through the repos inheritance mechanism.
      So, we only need to rewrite the repos_id of the given local_relpath,
      as well as any children with a non-null repos_id, as well as various
@@ -11429,6 +11369,11 @@ relocate_txn(svn_wc__db_wcroot_t *wcroot
       SVN_ERR(svn_sqlite__step_done(stmt));
     }
 
+  /* ### TODO: Update urls stored in inherited properties...
+               What about urls in conflicts?
+                 # We can probably keep these as they are only used
+                   for showing full urls to the user */
+
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/ra-git/subversion/mod_dav_svn/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/mod_dav_svn/status.c?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/mod_dav_svn/status.c (original)
+++ subversion/branches/ra-git/subversion/mod_dav_svn/status.c Tue Dec  8 12:07:26 2015
@@ -29,6 +29,14 @@
 #include "private/svn_cache.h"
 #include "private/svn_fs_private.h"
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>   /* For getpid() */
+#endif
+
+#if APR_HAVE_PROCESS_H
+#include <process.h>
+#endif
+
 /* The apache headers define these and they conflict with our definitions. */
 #ifdef PACKAGE_BUGREPORT
 #undef PACKAGE_BUGREPORT
@@ -90,13 +98,12 @@ int dav_svn__status(request_rec *r)
             ap_ht_time(r->pool, apr_time_now(), DEFAULT_TIME_FORMAT, 0),
             "</dt>\n", SVN_VA_NULL);
 
-#if !defined(WIN32) && defined(HAVE_UNISTD_H) && defined(HAVE_GETPID)
+#if defined(WIN32) || (defined(HAVE_UNISTD_H) && defined(HAVE_GETPID))
   /* On Unix the server is generally multiple processes and this
      request only shows the status of the single process that handles
      the request. Ideally we would iterate over all processes but that
      would need some MPM support, so we settle for simply showing the
      process ID. */
-#include <unistd.h>
   ap_rprintf(r, "<dt>Server process id: %d</dt>\n", (int)getpid());
 #endif
 

Modified: subversion/branches/ra-git/subversion/mod_dav_svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/mod_dav_svn/util.c?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/mod_dav_svn/util.c (original)
+++ subversion/branches/ra-git/subversion/mod_dav_svn/util.c Tue Dec  8 12:07:26 2015
@@ -779,7 +779,12 @@ request_body_to_string(svn_string_t **re
 
   if (content_length)
     {
-      buf = svn_stringbuf_create_ensure(content_length, pool);
+      /* Do not allocate more than 1 MB until we receive request body. */
+      apr_size_t alloc_len = 1 * 1024 *1024;
+      if (content_length < alloc_len)
+        alloc_len = (apr_size_t) content_length;
+
+      buf = svn_stringbuf_create_ensure(alloc_len, pool);
     }
   else
     {

Modified: subversion/branches/ra-git/subversion/tests/cmdline/svnfsfs_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/svnfsfs_tests.py?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/cmdline/svnfsfs_tests.py (original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/svnfsfs_tests.py Tue Dec  8 12:07:26 2015
@@ -248,12 +248,9 @@ def load_index_sharded(sbox):
   sbox.build(create_wc=False)
   patch_format(sbox.repo_dir, shard_size=2)
 
-  # With --fsfs-packing, everything is already packed and we
-  # can skip this part.
-  if not svntest.main.options.fsfs_packing:
-    expected_output = ["Packing revisions in shard 0...done.\n"]
-    svntest.actions.run_and_verify_svnadmin(expected_output, [],
-                                            "pack", sbox.repo_dir)
+  expected_output = ["Packing revisions in shard 0...done.\n"]
+  svntest.actions.run_and_verify_svnadmin(expected_output, [],
+                                          "pack", sbox.repo_dir)
 
   # Read P2L index using svnfsfs.
   exit_code, items, errput = \

Modified: subversion/branches/ra-git/subversion/tests/libsvn_client/mtcc-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/libsvn_client/mtcc-test.c?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/libsvn_client/mtcc-test.c (original)
+++ subversion/branches/ra-git/subversion/tests/libsvn_client/mtcc-test.c Tue Dec  8 12:07:26 2015
@@ -724,6 +724,65 @@ test_file_revs_both_ways(const svn_test_
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_iprops_path_format(const svn_test_opts_t *opts,
+                        apr_pool_t *pool)
+{
+  svn_client__mtcc_t *mtcc;
+  svn_client_ctx_t *ctx;
+  apr_pool_t *subpool = svn_pool_create(pool);
+  const char *repos_url;
+  svn_ra_session_t *ra;
+
+  SVN_ERR(svn_test__create_repos2(NULL, &repos_url, NULL, "mtcc-iprops-paths",
+                                  opts, pool, subpool));
+
+  SVN_ERR(svn_client_create_context2(&ctx, NULL, pool));
+  SVN_ERR(svn_test__init_auth_baton(&ctx->auth_baton, pool));
+
+  SVN_ERR(svn_client__mtcc_create(&mtcc, repos_url, 0, ctx, subpool, subpool));
+  SVN_ERR(svn_client__mtcc_add_mkdir("A", mtcc, subpool));
+  SVN_ERR(svn_client__mtcc_add_mkdir("A/B", mtcc, subpool));
+  SVN_ERR(svn_client__mtcc_add_mkdir("A/B/C", mtcc, subpool));
+  SVN_ERR(svn_client__mtcc_add_mkdir("A/B/C/D", mtcc, subpool));
+  SVN_ERR(svn_client__mtcc_add_propset("", "on-root",
+                                       svn_string_create("ROOT", subpool),
+                                       FALSE, mtcc, subpool));
+  SVN_ERR(svn_client__mtcc_add_propset("A/B", "on-B",
+                                       svn_string_create("BBBB", subpool),
+                                       FALSE, mtcc, subpool));
+  SVN_ERR(svn_client__mtcc_add_propset("A/B/C", "Z",
+                                       svn_string_create("Z", subpool),
+                                       FALSE, mtcc, subpool));
+  SVN_ERR(verify_mtcc_commit(mtcc, 1, subpool));
+  svn_pool_clear(subpool);
+
+  {
+    apr_array_header_t *iprops;
+    svn_prop_inherited_item_t *ip;
+
+    SVN_ERR(svn_client_open_ra_session2(&ra, repos_url, NULL, ctx,
+                                        pool, subpool));
+
+    SVN_ERR(svn_ra_get_inherited_props(ra, &iprops, "A/B/C/D", 1,
+                                       subpool, subpool));
+
+    SVN_TEST_ASSERT(iprops != NULL);
+    SVN_TEST_INT_ASSERT(iprops->nelts, 3);
+
+    ip = APR_ARRAY_IDX(iprops, 0, svn_prop_inherited_item_t *);
+    SVN_TEST_STRING_ASSERT(ip->path_or_url, "");
+
+    ip = APR_ARRAY_IDX(iprops, 1, svn_prop_inherited_item_t *);
+    SVN_TEST_STRING_ASSERT(ip->path_or_url, "A/B");
+
+    ip = APR_ARRAY_IDX(iprops, 2, svn_prop_inherited_item_t *);
+    SVN_TEST_STRING_ASSERT(ip->path_or_url, "A/B/C");
+  }
+
+  return SVN_NO_ERROR;
+}
+
 /* ========================================================================== */
 
 
@@ -750,6 +809,8 @@ static struct svn_test_descriptor_t test
                        "test mtcc replace tree"),
     SVN_TEST_OPTS_PASS(test_file_revs_both_ways,
                        "test ra_get_file_revs2 both ways"),
+    SVN_TEST_OPTS_PASS(test_iprops_path_format,
+                       "test iprops url format"),
     SVN_TEST_NULL
   };
 

Modified: subversion/branches/ra-git/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c (original)
+++ subversion/branches/ra-git/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c Tue Dec  8 12:07:26 2015
@@ -1648,6 +1648,98 @@ delta_chain_with_plain(const svn_test_op
 
 #undef REPO_NAME
 
+/* ------------------------------------------------------------------------ */
+
+#define REPO_NAME "test-repo-compare_0_length_rep"
+
+static svn_error_t *
+compare_0_length_rep(const svn_test_opts_t *opts,
+                     apr_pool_t *pool)
+{
+  svn_fs_t *fs;
+  svn_fs_txn_t *txn;
+  svn_fs_root_t *root;
+  svn_revnum_t rev;
+  int i, k;
+  apr_hash_t *fs_config;
+
+  /* Test expectations. */
+#define no_rep_file      "no-rep"
+#define empty_plain_file "empty-plain"
+#define plain_file       "plain"
+#define empty_delta_file "empty-delta"
+#define delta_file       "delta"
+
+  enum { COUNT = 5 };
+  const char *file_names[COUNT] = { no_rep_file,
+                                    empty_delta_file, 
+                                    plain_file,
+                                    empty_delta_file,
+                                    delta_file };
+
+  int equal[COUNT][COUNT] = { { 1, 1, 0, 1, 0 },
+                              { 1, 1, 0, 1, 0 },
+                              { 0, 0, 1, 0, 1 },
+                              { 1, 1, 0, 1, 0 },
+                              { 0, 0, 1, 0, 1 } };
+
+  /* Well, this club is FSFS only ... */
+  if (strcmp(opts->fs_type, "fsfs") != 0)
+    return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL, NULL);
+
+  /* We want to check that whether NULL reps, empty PLAIN reps and empty
+   * DELTA reps are all considered equal, yet different from non-empty reps.
+   *
+   * Because we can't create empty PLAIN reps with recent formats anymore,
+   * some format selection & upgrade gymnastics is needed. */
+
+  /* Create a format 1 repository.
+   * This one does not support DELTA reps, so all is PLAIN. */
+  fs_config = apr_hash_make(pool);
+  svn_hash_sets(fs_config, SVN_FS_CONFIG_PRE_1_4_COMPATIBLE, "x");
+  SVN_ERR(svn_test__create_fs2(&fs, REPO_NAME, opts, fs_config, pool));
+
+  /* Revision 1, create 3 files:
+   * One with no rep, one with an empty rep and a non-empty one. */
+  SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, pool));
+  SVN_ERR(svn_fs_txn_root(&root, txn, pool));
+  SVN_ERR(svn_fs_make_file(root, no_rep_file, pool));
+  SVN_ERR(svn_fs_make_file(root, empty_plain_file, pool));
+  SVN_ERR(svn_test__set_file_contents(root, empty_plain_file, "", pool));
+  SVN_ERR(svn_fs_make_file(root, plain_file, pool));
+  SVN_ERR(svn_test__set_file_contents(root, plain_file, "x", pool));
+  SVN_ERR(svn_fs_commit_txn(NULL, &rev, txn, pool));
+
+  /* Upgrade the file system format. */
+  SVN_ERR(svn_fs_upgrade2(REPO_NAME, NULL, NULL, NULL, NULL, pool));
+  SVN_ERR(svn_fs_open2(&fs, REPO_NAME, NULL, pool, pool));
+
+  /* Revision 2, create two more files:
+   * a file with an empty DELTA rep and a non-empty one. */
+  SVN_ERR(svn_fs_begin_txn(&txn, fs, rev, pool));
+  SVN_ERR(svn_fs_txn_root(&root, txn, pool));
+  SVN_ERR(svn_fs_make_file(root, empty_delta_file, pool));
+  SVN_ERR(svn_test__set_file_contents(root, empty_delta_file, "", pool));
+  SVN_ERR(svn_fs_make_file(root, delta_file, pool));
+  SVN_ERR(svn_test__set_file_contents(root, delta_file, "x", pool));
+  SVN_ERR(svn_fs_commit_txn(NULL, &rev, txn, pool));
+
+  /* Now compare. */
+  SVN_ERR(svn_fs_revision_root(&root, fs, rev, pool));
+  for (i = 0; i < COUNT; ++i)
+    for (k = 0; k < COUNT; ++k)
+      {
+        svn_boolean_t different;
+        SVN_ERR(svn_fs_contents_different(&different, root, file_names[i],
+                                          root, file_names[k], pool));
+        SVN_TEST_ASSERT(different != equal[i][k]);
+      }
+
+  return SVN_NO_ERROR;
+}
+
+#undef REPO_NAME
+
 
 /* The test table.  */
 
@@ -1696,6 +1788,8 @@ static struct svn_test_descriptor_t test
                        "rep-sharing effectiveness"),
     SVN_TEST_OPTS_PASS(delta_chain_with_plain,
                        "delta chains starting with PLAIN, issue #4577"),
+    SVN_TEST_OPTS_PASS(compare_0_length_rep,
+                       "compare empty PLAIN and non-existent reps"),
     SVN_TEST_NULL
   };
 

Modified: subversion/branches/ra-git/tools/dev/svnmover/merge3.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dev/svnmover/merge3.c?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dev/svnmover/merge3.c (original)
+++ subversion/branches/ra-git/tools/dev/svnmover/merge3.c Tue Dec  8 12:07:26 2015
@@ -840,6 +840,7 @@ element_merge(svn_element__content_t **r
 
 static svn_error_t *
 branch_merge_subtree_r(svn_branch__txn_t *edit_txn,
+                       svn_branch__state_t *edit_branch,
                        conflict_storage_t **conflict_storage_p,
                        const svn_branch__el_rev_id_t *src,
                        const svn_branch__el_rev_id_t *tgt,
@@ -851,6 +852,7 @@ branch_merge_subtree_r(svn_branch__txn_t
  */
 static svn_error_t *
 merge_subbranch(svn_branch__txn_t *edit_txn,
+                svn_branch__state_t *edit_branch,
                 const svn_branch__el_rev_id_t *src,
                 const svn_branch__el_rev_id_t *tgt,
                 const svn_branch__el_rev_id_t *yca,
@@ -886,9 +888,22 @@ merge_subbranch(svn_branch__txn_t *edit_
   if (subbr_src && subbr_tgt && subbr_yca)  /* ?edit vs. ?edit */
     {
       conflict_storage_t *conflict_storage;
+      const char *new_branch_id
+        = svn_branch__id_nest(svn_branch__get_id(edit_branch, scratch_pool),
+                              eid, scratch_pool);
+      svn_branch__rev_bid_eid_t *from
+        = svn_branch__rev_bid_eid_create(tgt_subbranch->txn->rev,
+                                         svn_branch__get_id(tgt_subbranch,
+                                                            scratch_pool),
+                                         svn_branch__root_eid(tgt_subbranch),
+                                         scratch_pool);
+      svn_branch__state_t *edit_subbranch;
+
+      SVN_ERR(svn_branch__txn_branch(edit_txn, &edit_subbranch, from,
+                                     new_branch_id, scratch_pool, scratch_pool));
 
       /* subbranch possibly changed in source => merge */
-      SVN_ERR(branch_merge_subtree_r(edit_txn,
+      SVN_ERR(branch_merge_subtree_r(edit_txn, edit_subbranch,
                                      &conflict_storage,
                                      subbr_src, subbr_tgt, subbr_yca,
                                      scratch_pool, scratch_pool));
@@ -909,7 +924,7 @@ merge_subbranch(svn_branch__txn_t *edit_
   else if (subbr_src)  /* added on source branch */
     {
       const char *new_branch_id
-        = svn_branch__id_nest(svn_branch__get_id(tgt->branch, scratch_pool),
+        = svn_branch__id_nest(svn_branch__get_id(edit_branch, scratch_pool),
                               eid, scratch_pool);
       svn_branch__rev_bid_eid_t *from
         = svn_branch__rev_bid_eid_create(src_subbranch->txn->rev,
@@ -923,7 +938,18 @@ merge_subbranch(svn_branch__txn_t *edit_
     }
   else if (subbr_tgt)  /* added on target branch */
     {
-      /* nothing to do */
+      const char *new_branch_id
+        = svn_branch__id_nest(svn_branch__get_id(edit_branch, scratch_pool),
+                              eid, scratch_pool);
+      svn_branch__rev_bid_eid_t *from
+        = svn_branch__rev_bid_eid_create(tgt_subbranch->txn->rev,
+                                         svn_branch__get_id(tgt_subbranch,
+                                                            scratch_pool),
+                                         svn_branch__root_eid(tgt_subbranch),
+                                         scratch_pool);
+
+      SVN_ERR(svn_branch__txn_branch(edit_txn, NULL /*new_branch_p*/, from,
+                                     new_branch_id, scratch_pool, scratch_pool));
     }
   else if (subbr_yca)  /* double delete */
     {
@@ -1138,6 +1164,7 @@ detect_orphans(apr_hash_t **orphans_p,
  */
 static svn_error_t *
 branch_merge_subtree_r(svn_branch__txn_t *edit_txn,
+                       svn_branch__state_t *edit_branch,
                        conflict_storage_t **conflict_storage_p,
                        const svn_branch__el_rev_id_t *src,
                        const svn_branch__el_rev_id_t *tgt,
@@ -1166,7 +1193,7 @@ branch_merge_subtree_r(svn_branch__txn_t
            svn_branch__get_id(yca->branch, scratch_pool), yca->eid));*/
 
   svnmover_notify_v("merging into branch %s",
-                    svn_branch__get_id(tgt->branch, scratch_pool));
+                    edit_branch->bid);
   /*
       for (eid, diff1) in element_differences(YCA, FROM):
         diff2 = element_diff(eid, YCA, TO)
@@ -1231,7 +1258,8 @@ branch_merge_subtree_r(svn_branch__txn_t
           /* Still need to merge any subbranch linked to this element.
              There were no changes to the link element but that doesn't
              mean there were no changes to the linked branch. */
-          SVN_ERR(merge_subbranch(edit_txn, src, tgt, yca, eid, iterpool));
+          SVN_ERR(merge_subbranch(edit_txn, edit_branch,
+                                  src, tgt, yca, eid, iterpool));
 
           continue;
         }
@@ -1299,7 +1327,8 @@ branch_merge_subtree_r(svn_branch__txn_t
 
           if (result)
             {
-              SVN_ERR(merge_subbranch(edit_txn, src, tgt, yca, eid, iterpool));
+              SVN_ERR(merge_subbranch(edit_txn, edit_branch,
+                                      src, tgt, yca, eid, iterpool));
             }
         }
     }
@@ -1329,6 +1358,7 @@ branch_merge_subtree_r(svn_branch__txn_t
 
 svn_error_t *
 svnmover_branch_merge(svn_branch__txn_t *edit_txn,
+                      svn_branch__state_t *edit_branch,
                       conflict_storage_t **conflict_storage_p,
                       svn_branch__el_rev_id_t *src,
                       svn_branch__el_rev_id_t *tgt,
@@ -1345,7 +1375,7 @@ svnmover_branch_merge(svn_branch__txn_t
   /*SVN_ERR(verify_not_subbranch_root(to, scratch_pool));*/
   /*SVN_ERR(verify_not_subbranch_root(yca, scratch_pool));*/
 
-  SVN_ERR(branch_merge_subtree_r(edit_txn,
+  SVN_ERR(branch_merge_subtree_r(edit_txn, edit_branch,
                                  &conflicts,
                                  src, tgt, yca,
                                  result_pool, scratch_pool));

Modified: subversion/branches/ra-git/tools/dev/svnmover/svnmover.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dev/svnmover/svnmover.c?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dev/svnmover/svnmover.c (original)
+++ subversion/branches/ra-git/tools/dev/svnmover/svnmover.c Tue Dec  8 12:07:26 2015
@@ -1758,7 +1758,8 @@ do_switch(svnmover_wc_t *wc,
       tgt = svn_branch__el_rev_id_create(wc->working->branch,
                                          svn_branch__root_eid(wc->working->branch),
                                          SVN_INVALID_REVNUM, scratch_pool);
-      SVN_ERR(svnmover_branch_merge(wc->edit_txn, &wc->conflicts,
+      SVN_ERR(svnmover_branch_merge(wc->edit_txn, tgt->branch,
+                                    &wc->conflicts,
                                     src, tgt, yca, wc->pool, scratch_pool));
 
       if (svnmover_any_conflicts(wc->conflicts))
@@ -1793,7 +1794,7 @@ do_merge(svnmover_wc_t *wc,
                       src->eid, tgt->eid, yca->eid);
     }
 
-  SVN_ERR(svnmover_branch_merge(wc->edit_txn,
+  SVN_ERR(svnmover_branch_merge(wc->edit_txn, tgt->branch,
                                 &wc->conflicts,
                                 src, tgt, yca,
                                 wc->pool, scratch_pool));
@@ -3511,6 +3512,7 @@ execute(svnmover_wc_t *wc,
           {
             VERIFY_EID_EXISTS("merge", 0);
             VERIFY_EID_EXISTS("merge", 1);
+            VERIFY_REV_UNSPECIFIED("merge", 1);
             VERIFY_EID_EXISTS("merge", 2);
 
             SVN_ERR(do_merge(wc,
@@ -3525,6 +3527,7 @@ execute(svnmover_wc_t *wc,
           {
             VERIFY_EID_EXISTS("merge", 0);
             VERIFY_EID_EXISTS("merge", 1);
+            VERIFY_REV_UNSPECIFIED("merge", 1);
 
             SVN_ERR(do_auto_merge(wc,
                                   arg[0]->el_rev /*from*/,

Modified: subversion/branches/ra-git/tools/dev/svnmover/svnmover.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dev/svnmover/svnmover.h?rev=1718576&r1=1718575&r2=1718576&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dev/svnmover/svnmover.h (original)
+++ subversion/branches/ra-git/tools/dev/svnmover/svnmover.h Tue Dec  8 12:07:26 2015
@@ -161,12 +161,12 @@ struct conflict_storage_t
   apr_hash_t *orphan_conflicts;
 };
 
-/* Merge SRC into TGT, using the common ancestor YCA.
+/* Three-way-merge the changes from YCA to SRC and YCA to TGT. YCA is
+ * notionally the youngest common ancestor of SRC and TGT.
  *
  * The elements to merge are the union of the elements in the three input
  * subtrees (SRC, TGT, YCA). For each such element, merge the two changes:
- * YCA -> SRC and YCA -> TGT, applying the result to TGT which is assumed
- * to be a branch in EDIT_TXN.
+ * YCA -> SRC and YCA -> TGT, applying the result to EDIT_TXN:EDIT_BRANCH.
  *
  * If conflicts arise, return them in *CONFLICT_STORAGE_P; otherwise set
  * that to null.
@@ -179,6 +179,7 @@ struct conflict_storage_t
  */
 svn_error_t *
 svnmover_branch_merge(svn_branch__txn_t *edit_txn,
+                      svn_branch__state_t *edit_branch,
                       conflict_storage_t **conflict_storage_p,
                       svn_branch__el_rev_id_t *src,
                       svn_branch__el_rev_id_t *tgt,