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/12 12:15:19 UTC

svn commit: r1719652 [1/2] - in /subversion/branches/ra-git: ./ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_delta/ subversion/libsvn_diff/ subversion/libsvn_fs_fs/ subversion/libsvn_fs_x/ subversion/libsv...

Author: rhuijben
Date: Sat Dec 12 11:15:19 2015
New Revision: 1719652

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

Modified:
    subversion/branches/ra-git/   (props changed)
    subversion/branches/ra-git/Makefile.in
    subversion/branches/ra-git/configure.ac
    subversion/branches/ra-git/subversion/include/private/svn_branch.h
    subversion/branches/ra-git/subversion/include/private/svn_branch_impl.h
    subversion/branches/ra-git/subversion/include/svn_io.h
    subversion/branches/ra-git/subversion/include/svn_props.h
    subversion/branches/ra-git/subversion/libsvn_client/patch.c
    subversion/branches/ra-git/subversion/libsvn_delta/branch.c
    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_delta/element.c
    subversion/branches/ra-git/subversion/libsvn_diff/parse-diff.c
    subversion/branches/ra-git/subversion/libsvn_fs_fs/cached_data.c
    subversion/branches/ra-git/subversion/libsvn_fs_fs/index.c
    subversion/branches/ra-git/subversion/libsvn_fs_fs/pack.c
    subversion/branches/ra-git/subversion/libsvn_fs_fs/transaction.c
    subversion/branches/ra-git/subversion/libsvn_fs_fs/util.c
    subversion/branches/ra-git/subversion/libsvn_fs_fs/util.h
    subversion/branches/ra-git/subversion/libsvn_fs_fs/verify.c
    subversion/branches/ra-git/subversion/libsvn_fs_x/   (props changed)
    subversion/branches/ra-git/subversion/libsvn_fs_x/low_level.c
    subversion/branches/ra-git/subversion/libsvn_fs_x/low_level.h
    subversion/branches/ra-git/subversion/libsvn_repos/commit.c
    subversion/branches/ra-git/subversion/libsvn_repos/dump.c
    subversion/branches/ra-git/subversion/libsvn_subr/io.c
    subversion/branches/ra-git/subversion/libsvn_subr/stream.c
    subversion/branches/ra-git/subversion/tests/cmdline/svnmover_tests.py
    subversion/branches/ra-git/subversion/tests/libsvn_fs/fs-test.c
    subversion/branches/ra-git/subversion/tests/libsvn_subr/io-test.c
    subversion/branches/ra-git/subversion/tests/svn_test.h
    subversion/branches/ra-git/subversion/tests/svn_test_main.c
    subversion/branches/ra-git/tools/dev/svnmover/ra.c
    subversion/branches/ra-git/tools/dev/svnmover/svnmover.c
    subversion/branches/ra-git/tools/dist/security/_gnupg.py

Propchange: subversion/branches/ra-git/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Dec 12 11:15:19 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-1718575
+/subversion/trunk:1583624-1719651

Modified: subversion/branches/ra-git/Makefile.in
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/Makefile.in?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/Makefile.in (original)
+++ subversion/branches/ra-git/Makefile.in Sat Dec 12 11:15:19 2015
@@ -661,6 +661,7 @@ check-clean: gcov-clean
 	rm -rf subversion/tests/libsvn_fs/test-repo-*          \
 	       subversion/tests/libsvn_fs_base/test-repo-*     \
 	       subversion/tests/libsvn_fs_fs/test-repo-*       \
+	       subversion/tests/libsvn_fs_x/test-repo-*        \
 	       subversion/tests/libsvn_ra_local/test-repo-*    \
 	       subversion/tests/libsvn_repos/test-repo-*       \
 	       subversion/tests/libsvn_subr/z                  \

Modified: subversion/branches/ra-git/configure.ac
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/configure.ac?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/configure.ac (original)
+++ subversion/branches/ra-git/configure.ac Sat Dec 12 11:15:19 2015
@@ -1054,6 +1054,7 @@ AS_HELP_STRING([--enable-maintainer-mode
         SVN_CFLAGS_ADD_IFELSE([-Wno-system-headers])
         SVN_CFLAGS_ADD_IFELSE([-Wno-format-nonliteral])
         SVN_CFLAGS_ADD_IFELSE([-Wmissing-variable-declarations])
+        SVN_CFLAGS_ADD_IFELSE([-Wno-unused-const-variable])
 
         CMAINTAINERFLAGS="$CFLAGS"
         CFLAGS="$CFLAGS_KEEP"

Modified: subversion/branches/ra-git/subversion/include/private/svn_branch.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/include/private/svn_branch.h?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/include/private/svn_branch.h (original)
+++ subversion/branches/ra-git/subversion/include/private/svn_branch.h Sat Dec 12 11:15:19 2015
@@ -211,18 +211,14 @@ 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, PREDECESSOR and ROOT_EID are used.
+ * When adding a new branch, ROOT_EID is used.
  *
- * ### When opening ('finding') an existing branch, they must match it
- *     (else throw an error)? But this is problematic: we should't care
- *     exactly where it was branched from, as long as it was branched from
- *     ... roughly 'the right branch'? ... perhaps meaning one with a common
- *     ancestor?
+ * ### 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,
-                            svn_branch__rev_bid_t *predecessor,
                             const char *new_branch_id,
                             int root_eid,
                             apr_pool_t *result_pool,
@@ -326,10 +322,6 @@ struct svn_branch__state_t
   /* The branch identifier (starting with 'B') */
   const char *bid;
 
-  /* The previous location in the lifeline of this branch. */
-  /* (REV = -1 means "in this txn") */
-  svn_branch__rev_bid_t *predecessor;
-
   /* The revision to which this branch state belongs */
   svn_branch__txn_t *txn;
 
@@ -410,7 +402,6 @@ svn_branch__txn_add_branch(svn_branch__t
 svn_branch__state_t *
 svn_branch__txn_add_new_branch(svn_branch__txn_t *txn,
                                const char *bid,
-                               svn_branch__rev_bid_t *predecessor,
                                int root_eid,
                                apr_pool_t *scratch_pool);
 
@@ -497,6 +488,24 @@ svn_boolean_t
 svn_branch__rev_bid_equal(const svn_branch__rev_bid_t *id1,
                           const svn_branch__rev_bid_t *id2);
 
+typedef struct svn_branch__history_t
+{
+  /* The immediate parents of this state in the branch/merge graph.
+     Hash of (BID -> svn_branch__rev_bid_t). */
+  apr_hash_t *parents;
+} svn_branch__history_t;
+
+svn_branch__history_t *
+svn_branch__history_create_empty(apr_pool_t *result_pool);
+
+svn_branch__history_t *
+svn_branch__history_create(apr_hash_t *parents,
+                           apr_pool_t *result_pool);
+
+svn_branch__history_t *
+svn_branch__history_dup(const svn_branch__history_t *old,
+                        apr_pool_t *result_pool);
+
 /* Return the mapping of elements in branch BRANCH.
  */
 svn_error_t *
@@ -609,26 +618,19 @@ svn_error_t *
 svn_branch__state_purge(svn_branch__state_t *branch,
                         apr_pool_t *scratch_pool);
 
-/* Get the merge ancestor(s).
+/* Get the merge history of BRANCH.
  */
 svn_error_t *
-svn_branch__state_get_merge_ancestor(svn_branch__state_t *branch,
-                                     svn_branch__rev_bid_t **merge_ancestor_p,
-                                     apr_pool_t *result_pool);
+svn_branch__state_get_history(svn_branch__state_t *branch,
+                              svn_branch__history_t **merge_history_p,
+                              apr_pool_t *result_pool);
 
-/* Set a merge ancestor.
- *
- * Currently only one is allowed; this overwrites it if it was already set.
- *
- * TODO: Allow adding multiple ancestors on different branches. When
- * there is an existing ancestor that is earlier along the same branch
- * (line of history) as MERGE_ANCESTOR, then update (replace) it instead
- * of just adding another one.
+/* Set the merge history of BRANCH.
  */
 svn_error_t *
-svn_branch__state_add_merge_ancestor(svn_branch__state_t *branch,
-                                     const svn_branch__rev_bid_t *merge_ancestor,
-                                     apr_pool_t *scratch_pool);
+svn_branch__state_set_history(svn_branch__state_t *branch,
+                              const svn_branch__history_t *merge_history,
+                              apr_pool_t *scratch_pool);
 
 /* Return the branch-relative path of element EID in BRANCH.
  *

Modified: subversion/branches/ra-git/subversion/include/private/svn_branch_impl.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/include/private/svn_branch_impl.h?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/include/private/svn_branch_impl.h (original)
+++ subversion/branches/ra-git/subversion/include/private/svn_branch_impl.h Sat Dec 12 11:15:19 2015
@@ -67,7 +67,6 @@ typedef svn_error_t *(*svn_branch__txn_v
 typedef svn_branch__state_t *(*svn_branch__txn_v_add_new_branch_t)(
   svn_branch__txn_t *txn,
   const char *bid,
-  svn_branch__rev_bid_t *predecessor,
   int root_eid,
   apr_pool_t *scratch_pool);
 
@@ -89,7 +88,6 @@ typedef svn_error_t *(*svn_branch__txn_v
 typedef svn_error_t *(*svn_branch__txn_v_open_branch_t)(
   svn_branch__txn_t *txn,
   svn_branch__state_t **new_branch_p,
-  svn_branch__rev_bid_t *predecessor,
   const char *new_branch_id,
   int root_eid,
   apr_pool_t *result_pool,
@@ -186,14 +184,14 @@ typedef svn_error_t *(*svn_branch__state
   svn_branch__state_t *branch,
   apr_pool_t *scratch_pool);
 
-typedef svn_error_t *(*svn_branch__state_v_get_merge_ancestor_t)(
+typedef svn_error_t *(*svn_branch__state_v_get_history_t)(
   svn_branch__state_t *branch,
-  svn_branch__rev_bid_t **merge_ancestor_p,
+  svn_branch__history_t **history_p,
   apr_pool_t *scratch_pool);
 
-typedef svn_error_t *(*svn_branch__state_v_add_merge_ancestor_t)(
+typedef svn_error_t *(*svn_branch__state_v_set_history_t)(
   svn_branch__state_t *branch,
-  const svn_branch__rev_bid_t *merge_ancestor,
+  const svn_branch__history_t *history,
   apr_pool_t *scratch_pool);
 
 struct svn_branch__state_vtable_t
@@ -206,8 +204,8 @@ struct svn_branch__state_vtable_t
   svn_branch__state_v_copy_one_t copy_one;
   svn_branch__state_v_copy_tree_t copy_tree;
   svn_branch__state_v_purge_t purge;
-  svn_branch__state_v_get_merge_ancestor_t get_merge_ancestor;
-  svn_branch__state_v_add_merge_ancestor_t add_merge_ancestor;
+  svn_branch__state_v_get_history_t get_history;
+  svn_branch__state_v_set_history_t set_history;
 
 };
 

Modified: subversion/branches/ra-git/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/include/svn_io.h?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/include/svn_io.h (original)
+++ subversion/branches/ra-git/subversion/include/svn_io.h Sat Dec 12 11:15:19 2015
@@ -2235,6 +2235,16 @@ svn_error_t *
 svn_io_file_size_get(svn_filesize_t *filesize_p, apr_file_t *file,
                      apr_pool_t *pool);
 
+/** Fetch the current offset of @a file into @a *offset_p. Use @a pool for
+  * temporary allocations.
+  *
+  * @since New in 1.10
+  */
+svn_error_t *
+svn_io_file_get_offset(apr_off_t *offset_p,
+                       apr_file_t *file,
+                       apr_pool_t *pool);
+
 /** Wrapper for apr_file_read(). */
 svn_error_t *
 svn_io_file_read(apr_file_t *file,

Modified: subversion/branches/ra-git/subversion/include/svn_props.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/include/svn_props.h?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/include/svn_props.h (original)
+++ subversion/branches/ra-git/subversion/include/svn_props.h Sat Dec 12 11:15:19 2015
@@ -475,22 +475,42 @@ svn_prop_name_is_valid(const char *prop_
 /** The files' last modification time.
  * This is stored as string in the form @c "2008-08-07T07:38:51.008782Z", to
  * be converted by the functions @c svn_time_to_cstring() and
- * @c svn_time_from_cstring(). */
+ * @c svn_time_from_cstring().
+ *
+ * @note This property name is reserved for future usage, but currently unused.
+ *
+ * @since New in 1.6.
+ */
 #define SVN_PROP_TEXT_TIME  SVN_PROP_PREFIX "text-time"
 
 /** The files' owner.
  * Stored as numeric ID, optionally followed by whitespace and the string:
  * @c "1000 pmarek". Parsers @b should accept any number of whitespace,
- * and writers @b should put exactly a single space. */
+ * and writers @b should put exactly a single space.
+ *
+ * @note This property name is reserved for future usage, but currently unused.
+ *
+ * @since New in 1.6.
+ */
 #define SVN_PROP_OWNER SVN_PROP_PREFIX "owner"
 
 /** The files' group.
- * The same format as for @c SVN_PROP_OWNER, the owner-property. */
+ * The same format as for @c SVN_PROP_OWNER, the owner-property.
+ *
+ * @note This property name is reserved for future usage, but currently unused.
+ *
+ * @since New in 1.6.
+ */
 #define SVN_PROP_GROUP  SVN_PROP_PREFIX "group"
 
 /** The files' unix-mode.
  * Stored in octal, with a leading @c 0; may have 5 digits if any of @c setuid,
- * @c setgid or @c sticky are set; an example is @c "0644". */
+ * @c setgid or @c sticky are set; an example is @c "0644".
+ *
+ * @note This property name is reserved for future usage, but currently unused.
+ *
+ * @since New in 1.6.
+ */
 #define SVN_PROP_UNIX_MODE  SVN_PROP_PREFIX "unix-mode"
 
 /** @} */ /* Meta-data properties */

Modified: subversion/branches/ra-git/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_client/patch.c?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_client/patch.c Sat Dec 12 11:15:19 2015
@@ -831,8 +831,7 @@ tell_file(void *baton, apr_off_t *offset
 {
   apr_file_t *file = baton;
 
-  *offset = 0;
-  SVN_ERR(svn_io_file_seek(file, APR_CUR, offset, scratch_pool));
+  SVN_ERR(svn_io_file_get_offset(offset, file, scratch_pool));
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/ra-git/subversion/libsvn_delta/branch.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_delta/branch.c?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_delta/branch.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_delta/branch.c Sat Dec 12 11:15:19 2015
@@ -69,10 +69,8 @@ struct svn_branch__state_priv_t
   /* EID -> svn_element__content_t mapping. */
   svn_element__tree_t *element_tree;
 
-  /* Youngest ancestor, with respect to a complete merge, on another branch.
-     (REV = -1 means "in this txn".)
-     ### TODO: Multiple ancestors, corresponding to multiple source branches. */
-  svn_branch__rev_bid_t *merge_ancestor;
+  /* Merge history for this branch state. */
+  svn_branch__history_t *history;
 
   svn_boolean_t is_flat;
 
@@ -80,7 +78,6 @@ struct svn_branch__state_priv_t
 
 static svn_branch__state_t *
 branch_state_create(const char *bid,
-                    svn_branch__rev_bid_t *predecessor,
                     int root_eid,
                     svn_branch__txn_t *txn,
                     apr_pool_t *result_pool);
@@ -161,7 +158,6 @@ branch_txn_add_branch(svn_branch__txn_t
 static svn_branch__state_t *
 branch_txn_add_new_branch(svn_branch__txn_t *txn,
                           const char *bid,
-                          svn_branch__rev_bid_t *predecessor,
                           int root_eid,
                           apr_pool_t *scratch_pool)
 {
@@ -169,7 +165,7 @@ branch_txn_add_new_branch(svn_branch__tx
 
   SVN_ERR_ASSERT_NO_RETURN(root_eid != -1);
 
-  new_branch = branch_state_create(bid, predecessor, root_eid, txn,
+  new_branch = branch_state_create(bid, root_eid, txn,
                                    txn->priv->branches->pool);
 
   APR_ARRAY_PUSH(txn->priv->branches, void *) = new_branch;
@@ -227,7 +223,6 @@ 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,
-                       svn_branch__rev_bid_t *predecessor,
                        const char *new_branch_id,
                        int root_eid,
                        apr_pool_t *result_pool,
@@ -246,7 +241,6 @@ branch_txn_open_branch(svn_branch__txn_t
     {
       new_branch = svn_branch__txn_add_new_branch(txn,
                                                   new_branch_id,
-                                                  predecessor,
                                                   root_eid, scratch_pool);
     }
 
@@ -264,7 +258,6 @@ branch_txn_branch(svn_branch__txn_t *txn
                   apr_pool_t *result_pool,
                   apr_pool_t *scratch_pool)
 {
-  svn_branch__rev_bid_t *predecessor;
   svn_branch__state_t *new_branch;
   svn_branch__state_t *from_branch;
   svn_element__tree_t *from_subtree;
@@ -295,10 +288,8 @@ branch_txn_branch(svn_branch__txn_t *txn
                                from->rev, from->bid, from->eid);
     }
 
-  predecessor = svn_branch__rev_bid_create(from->rev, from->bid, scratch_pool);
   new_branch = svn_branch__txn_add_new_branch(txn,
                                               new_branch_id,
-                                              predecessor,
                                               from->eid, scratch_pool);
 
   /* Populate the mapping from the 'from' source */
@@ -377,13 +368,12 @@ svn_branch__txn_add_branch(svn_branch__t
 svn_branch__state_t *
 svn_branch__txn_add_new_branch(svn_branch__txn_t *txn,
                                const char *bid,
-                               svn_branch__rev_bid_t *predecessor,
                                int root_eid,
                                apr_pool_t *scratch_pool)
 {
   svn_branch__state_t *new_branch
     = txn->vtable->add_new_branch(txn,
-                                  bid, predecessor, root_eid,
+                                  bid, root_eid,
                                   scratch_pool);
 
   return new_branch;
@@ -425,7 +415,6 @@ 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,
-                            svn_branch__rev_bid_t *predecessor,
                             const char *new_branch_id,
                             int root_eid,
                             apr_pool_t *result_pool,
@@ -433,7 +422,7 @@ svn_branch__txn_open_branch(svn_branch__
 {
   SVN_ERR(txn->vtable->open_branch(txn,
                                    new_branch_p,
-                                   predecessor, new_branch_id,
+                                   new_branch_id,
                                    root_eid, result_pool,
                                    scratch_pool));
   return SVN_NO_ERROR;
@@ -643,11 +632,6 @@ branch_txn_serialize(svn_branch__txn_t *
     {
       svn_branch__state_t *branch = APR_ARRAY_IDX(branches, i, void *);
 
-      if (branch->predecessor && branch->predecessor->rev < 0)
-        {
-          branch->predecessor->rev = txn->rev;
-        }
-
       SVN_ERR(svn_branch__state_serialize(stream, branch, scratch_pool));
     }
   return SVN_NO_ERROR;
@@ -941,6 +925,55 @@ svn_branch__rev_bid_equal(const svn_bran
           && strcmp(id1->bid, id2->bid) == 0);
 }
 
+svn_branch__history_t *
+svn_branch__history_create_empty(apr_pool_t *result_pool)
+{
+  svn_branch__history_t *history
+    = svn_branch__history_create(NULL, result_pool);
+
+  return history;
+}
+
+svn_branch__history_t *
+svn_branch__history_create(apr_hash_t *parents,
+                           apr_pool_t *result_pool)
+{
+  svn_branch__history_t *history
+    = apr_pcalloc(result_pool, sizeof(*history));
+
+  history->parents = apr_hash_make(result_pool);
+  if (parents)
+    {
+      apr_hash_index_t *hi;
+
+      for (hi = apr_hash_first(result_pool, parents);
+           hi; hi = apr_hash_next(hi))
+        {
+          const char *bid = apr_hash_this_key(hi);
+          svn_branch__rev_bid_t *val = apr_hash_this_val(hi);
+
+          svn_hash_sets(history->parents,
+                        apr_pstrdup(result_pool, bid),
+                        svn_branch__rev_bid_dup(val, result_pool));
+        }
+    }
+  return history;
+}
+
+svn_branch__history_t *
+svn_branch__history_dup(const svn_branch__history_t *old,
+                        apr_pool_t *result_pool)
+{
+  svn_branch__history_t *history = NULL;
+
+  if (old)
+    {
+      history
+        = svn_branch__history_create(old->parents, result_pool);
+    }
+  return history;
+}
+
 
 /*
  * ========================================================================
@@ -1082,25 +1115,28 @@ branch_state_purge(svn_branch__state_t *
 
 /* An #svn_branch__state_t method. */
 static svn_error_t *
-branch_state_get_merge_ancestor(svn_branch__state_t *branch,
-                                svn_branch__rev_bid_t **merge_ancestor_p,
-                                apr_pool_t *result_pool)
+branch_state_get_history(svn_branch__state_t *branch,
+                         svn_branch__history_t **history_p,
+                         apr_pool_t *result_pool)
 {
-  *merge_ancestor_p = svn_branch__rev_bid_dup(branch->priv->merge_ancestor,
-                                              result_pool);
+  if (history_p)
+    {
+      *history_p
+        = svn_branch__history_dup(branch->priv->history, result_pool);
+    }
   return SVN_NO_ERROR;
 }
 
 /* An #svn_branch__state_t method. */
 static svn_error_t *
-branch_state_add_merge_ancestor(svn_branch__state_t *branch,
-                                const svn_branch__rev_bid_t *merge_ancestor,
-                                apr_pool_t *scratch_pool)
+branch_state_set_history(svn_branch__state_t *branch,
+                         const svn_branch__history_t *history,
+                         apr_pool_t *scratch_pool)
 {
   apr_pool_t *branch_pool = branch_state_pool_get(branch);
 
-  branch->priv->merge_ancestor = svn_branch__rev_bid_dup(merge_ancestor,
-                                                         branch_pool);
+  branch->priv->history
+    = svn_branch__history_dup(history, branch_pool);
   return SVN_NO_ERROR;
 }
 
@@ -1328,24 +1364,26 @@ svn_branch__state_purge(svn_branch__stat
 }
 
 svn_error_t *
-svn_branch__state_get_merge_ancestor(svn_branch__state_t *branch,
-                                     svn_branch__rev_bid_t **merge_ancestor_p,
-                                     apr_pool_t *result_pool)
+svn_branch__state_get_history(svn_branch__state_t *branch,
+                              svn_branch__history_t **history_p,
+                              apr_pool_t *result_pool)
 {
-  SVN_ERR(branch->vtable->get_merge_ancestor(branch,
-                                             merge_ancestor_p,
-                                             result_pool));
+  SVN_ERR(branch->vtable->get_history(branch,
+                                      history_p,
+                                      result_pool));
+  SVN_ERR_ASSERT(*history_p);
   return SVN_NO_ERROR;
 }
 
 svn_error_t *
-svn_branch__state_add_merge_ancestor(svn_branch__state_t *branch,
-                                     const svn_branch__rev_bid_t *merge_ancestor,
-                                     apr_pool_t *scratch_pool)
+svn_branch__state_set_history(svn_branch__state_t *branch,
+                              const svn_branch__history_t *history,
+                              apr_pool_t *scratch_pool)
 {
-  SVN_ERR(branch->vtable->add_merge_ancestor(branch,
-                                             merge_ancestor,
-                                             scratch_pool));
+  SVN_ERR_ASSERT(history);
+  SVN_ERR(branch->vtable->set_history(branch,
+                                      history,
+                                      scratch_pool));
   return SVN_NO_ERROR;
 }
 
@@ -1377,7 +1415,6 @@ svn_branch__state_create(const svn_branc
  */
 static svn_branch__state_t *
 branch_state_create(const char *bid,
-                    svn_branch__rev_bid_t *predecessor,
                     int root_eid,
                     svn_branch__txn_t *txn,
                     apr_pool_t *result_pool)
@@ -1390,19 +1427,19 @@ branch_state_create(const char *bid,
     branch_state_copy_one,
     branch_state_copy_tree,
     branch_state_purge,
-    branch_state_get_merge_ancestor,
-    branch_state_add_merge_ancestor,
+    branch_state_get_history,
+    branch_state_set_history,
   };
   svn_branch__state_t *b
     = svn_branch__state_create(&vtable, NULL, NULL, result_pool);
 
   b->priv = apr_pcalloc(result_pool, sizeof(*b->priv));
   b->bid = apr_pstrdup(result_pool, bid);
-  b->predecessor = svn_branch__rev_bid_dup(predecessor, result_pool);
   b->txn = txn;
   b->priv->element_tree = svn_element__tree_create(NULL, root_eid, result_pool);
   assert_branch_state_invariants(b, result_pool);
   b->priv->is_flat = TRUE;
+  b->priv->history = svn_branch__history_create_empty(result_pool);
   return b;
 }
 
@@ -1418,7 +1455,7 @@ svn_branch__get_default_r0_metadata(apr_
   static const char *default_repos_info
     = "r0: eids 0 1 branches 1\n"
       "B0 root-eid 0 num-eids 1\n"
-      "merge-history: merge-ancestors 0\n"
+      "history: parents 0\n"
       "e0: normal -1 .\n";
 
   return svn_string_create(default_repos_info, result_pool);
@@ -1429,7 +1466,6 @@ static svn_error_t *
 parse_branch_line(char *bid_p,
                   int *root_eid_p,
                   int *num_eids_p,
-                  svn_branch__rev_bid_t **predecessor,
                   svn_stream_t *stream,
                   apr_pool_t *result_pool,
                   apr_pool_t *scratch_pool)
@@ -1437,52 +1473,43 @@ parse_branch_line(char *bid_p,
   svn_stringbuf_t *line;
   svn_boolean_t eof;
   int n;
-  svn_revnum_t pred_rev;
-  char pred_bid[1000];
 
   /* Read a line */
   SVN_ERR(svn_stream_readline(stream, &line, "\n", &eof, scratch_pool));
   SVN_ERR_ASSERT(!eof);
 
-  n = sscanf(line->data, "%s root-eid %d num-eids %d from r%ld.%s",
-             bid_p, root_eid_p, num_eids_p, &pred_rev, pred_bid);
-  SVN_ERR_ASSERT(n == 3 || n == 5);
-
-  if (n == 5)
-    {
-      *predecessor = svn_branch__rev_bid_create(pred_rev, pred_bid, result_pool);
-    }
-  else
-    {
-      *predecessor = NULL;
-    }
+  n = sscanf(line->data, "%s root-eid %d num-eids %d",
+             bid_p, root_eid_p, num_eids_p);
+  SVN_ERR_ASSERT(n == 3);
 
   return SVN_NO_ERROR;
 }
 
-/* Parse the merge history for BRANCH.
+/* Parse the history metadata for BRANCH.
  */
 static svn_error_t *
-merge_history_parse(svn_branch__state_t *branch_state,
-                    svn_stream_t *stream,
-                    apr_pool_t *result_pool,
-                    apr_pool_t *scratch_pool)
+history_parse(svn_branch__history_t **history_p,
+              svn_stream_t *stream,
+              apr_pool_t *result_pool,
+              apr_pool_t *scratch_pool)
 {
+  svn_branch__history_t *history
+    = svn_branch__history_create_empty(result_pool);
   svn_stringbuf_t *line;
   svn_boolean_t eof;
   int n;
-  int num_merge_ancestors;
+  int num_parents;
   int i;
 
   /* Read a line */
   SVN_ERR(svn_stream_readline(stream, &line, "\n", &eof, scratch_pool));
   SVN_ERR_ASSERT(!eof);
 
-  n = sscanf(line->data, "merge-history: merge-ancestors %d",
-             &num_merge_ancestors);
+  n = sscanf(line->data, "history: parents %d",
+             &num_parents);
   SVN_ERR_ASSERT(n == 1);
 
-  for (i = 0; i < num_merge_ancestors; i++)
+  for (i = 0; i < num_parents; i++)
     {
       svn_revnum_t rev;
       char bid[100];
@@ -1490,14 +1517,17 @@ merge_history_parse(svn_branch__state_t
       SVN_ERR(svn_stream_readline(stream, &line, "\n", &eof, scratch_pool));
       SVN_ERR_ASSERT(!eof);
 
-      n = sscanf(line->data, "merge-ancestor: r%ld.%99s",
+      n = sscanf(line->data, "parent: r%ld.%99s",
                  &rev, bid);
       SVN_ERR_ASSERT(n == 2);
 
-      branch_state->priv->merge_ancestor
-        = svn_branch__rev_bid_create(rev, bid, result_pool);
+      svn_hash_sets(history->parents,
+                    apr_pstrdup(result_pool, bid),
+                    svn_branch__rev_bid_create(rev, bid, result_pool));
     }
 
+  if (history_p)
+    *history_p = history;
   return SVN_NO_ERROR;
 }
 
@@ -1582,19 +1612,18 @@ svn_branch__state_parse(svn_branch__stat
 {
   char bid[1000];
   int root_eid, num_eids;
-  svn_branch__rev_bid_t *predecessor;
   svn_branch__state_t *branch_state;
   int i;
 
-  SVN_ERR(parse_branch_line(bid, &root_eid, &num_eids, &predecessor,
+  SVN_ERR(parse_branch_line(bid, &root_eid, &num_eids,
                             stream, scratch_pool, scratch_pool));
 
-  branch_state = branch_state_create(bid, predecessor, root_eid, txn,
+  branch_state = branch_state_create(bid, root_eid, txn,
                                      result_pool);
 
   /* Read in the merge history. */
-  SVN_ERR(merge_history_parse(branch_state,
-                              stream, result_pool, scratch_pool));
+  SVN_ERR(history_parse(&branch_state->priv->history,
+                        stream, result_pool, scratch_pool));
 
   /* Read in the structure. Set the payload of each normal element to a
      (branch-relative) reference. */
@@ -1679,25 +1708,33 @@ svn_branch__txn_parse(svn_branch__txn_t
   return SVN_NO_ERROR;
 }
 
-/* Serialize the merge history information for BRANCH.
+/* Serialize the history metadata for BRANCH.
  */
 static svn_error_t *
-merge_history_serialize(svn_stream_t *stream,
-                        svn_branch__state_t *branch,
-                        apr_pool_t *scratch_pool)
+history_serialize(svn_stream_t *stream,
+                  svn_branch__history_t *history,
+                  apr_pool_t *scratch_pool)
 {
-  int num_merge_ancestors = (branch->priv->merge_ancestor) ? 1 : 0;
+  apr_array_header_t *ancestors_sorted;
   int i;
 
+  /* Write entries in sorted order for stability -- so that for example
+     we can test parse-then-serialize by expecting identical output. */
+  ancestors_sorted = svn_sort__hash(history->parents,
+                                    svn_sort_compare_items_lexically,
+                                    scratch_pool);
   SVN_ERR(svn_stream_printf(stream, scratch_pool,
-                            "merge-history: merge-ancestors %d\n",
-                            num_merge_ancestors));
-  for (i = 0; i < num_merge_ancestors; i++)
-    {
+                            "history: parents %d\n",
+                            ancestors_sorted->nelts));
+  for (i = 0; i < ancestors_sorted->nelts; i++)
+    {
+      svn_sort__item_t *item
+        = &APR_ARRAY_IDX(ancestors_sorted, i, svn_sort__item_t);
+      svn_branch__rev_bid_t *rev_bid = item->value;
+
       SVN_ERR(svn_stream_printf(stream, scratch_pool,
-                                "merge-ancestor: r%ld.%s\n",
-                                branch->priv->merge_ancestor->rev,
-                                branch->priv->merge_ancestor->bid));
+                                "parent: r%ld.%s\n",
+                                rev_bid->rev, rev_bid->bid));
     }
 
   return SVN_NO_ERROR;
@@ -1710,27 +1747,18 @@ svn_branch__state_serialize(svn_stream_t
                             svn_branch__state_t *branch,
                             apr_pool_t *scratch_pool)
 {
-  const char *predecessor_str = "";
   svn_eid__hash_iter_t *ei;
 
   SVN_ERR_ASSERT(branch->priv->is_flat);
 
-  if (branch->predecessor)
-    {
-      assert(SVN_IS_VALID_REVNUM(branch->predecessor->rev));
-      predecessor_str = apr_psprintf(scratch_pool, " from r%ld.%s",
-                                     branch->predecessor->rev,
-                                     branch->predecessor->bid);
-    }
-
   SVN_ERR(svn_stream_printf(stream, scratch_pool,
-                            "%s root-eid %d num-eids %d%s\n",
+                            "%s root-eid %d num-eids %d\n",
                             svn_branch__get_id(branch, scratch_pool),
                             branch->priv->element_tree->root_eid,
-                            apr_hash_count(branch->priv->element_tree->e_map),
-                            predecessor_str));
+                            apr_hash_count(branch->priv->element_tree->e_map)));
 
-  SVN_ERR(merge_history_serialize(stream, branch, scratch_pool));
+  SVN_ERR(history_serialize(stream, branch->priv->history,
+                                  scratch_pool));
 
   for (SVN_EID__HASH_ITER_SORTED_BY_EID(ei, branch->priv->element_tree->e_map,
                                         scratch_pool))

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=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_delta/branch_compat.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_delta/branch_compat.c Sat Dec 12 11:15:19 2015
@@ -74,17 +74,71 @@ pathrev_equal(const svn_pathrev_t *p1,
   return TRUE;
 }
 
-#ifdef SVN_DEBUG
+#if 0
 /* Return a human-readable string representation of LOC. */
-/*static const char *
-pathrev_str(svn_pathrev_t loc,
+static const char *
+pathrev_str(const svn_pathrev_t *loc,
             apr_pool_t *result_pool)
 {
+  if (! loc)
+    return "<nil>";
   return apr_psprintf(result_pool, "%s@%ld",
-                      loc.relpath, loc.rev);
-}*/
+                      loc->relpath, loc->rev);
+}
+
+/* Return a string representation of the (string) keys of HASH. */
+static const char *
+hash_keys_str(apr_hash_t *hash)
+{
+  const char *str = NULL;
+  apr_pool_t *pool;
+  apr_hash_index_t *hi;
+
+  if (! hash)
+    return "<nil>";
+
+  pool = apr_hash_pool_get(hash);
+  for (hi = apr_hash_first(pool, hash); hi; hi = apr_hash_next(hi))
+    {
+      const char *key = apr_hash_this_key(hi);
+
+      if (!str)
+        str = key;
+      else
+        str = apr_psprintf(pool, "%s, %s", str, key);
+    }
+  return apr_psprintf(pool, "{%s}", str);
+}
 #endif
 
+/**
+ * Merge two hash tables into one new hash table. The values of the overlay
+ * hash override the values of the base if both have the same key.
+ *
+ * Unlike apr_hash_overlay(), this doesn't care whether the input hashes use
+ * the same hash function, nor about the relationship between the three pools.
+ *
+ * @param p The pool to use for the new hash table
+ * @param overlay The table to add to the initial table
+ * @param base The table that represents the initial values of the new table
+ * @return A new hash table containing all of the data from the two passed in
+ * @remark Makes a shallow copy: keys and values are not copied
+ */
+static apr_hash_t *
+hash_overlay(apr_hash_t *overlay,
+             apr_hash_t *base)
+{
+  apr_pool_t *pool = apr_hash_pool_get(base);
+  apr_hash_t *result = apr_hash_copy(pool, base);
+  apr_hash_index_t *hi;
+
+  for (hi = apr_hash_first(pool, overlay); hi; hi = apr_hash_next(hi))
+    {
+      svn_hash_sets(result, apr_hash_this_key(hi), apr_hash_this_val(hi));
+    }
+  return result;
+}
+
 
 /*
  * ========================================================================
@@ -266,6 +320,31 @@ typedef struct change_node_t
 #endif
 } change_node_t;
 
+#if 0
+/* Return a string representation of CHANGE. */
+static const char *
+change_node_str(change_node_t *change,
+                apr_pool_t *result_pool)
+{
+  const char *copyfrom = "<nil>";
+  const char *str;
+
+  if (change->copyfrom_path)
+    copyfrom = apr_psprintf(result_pool, "'%s'@%ld",
+                            change->copyfrom_path, change->copyfrom_rev);
+  str = apr_psprintf(result_pool,
+                     "action=%d, kind=%s, changing_rev=%ld, "
+                     "deleting=%d, deleting_rev=%ld, ..., "
+                     "copyfrom=%s",
+                     change->action,
+                     svn_node_kind_to_word(change->kind),
+                     change->changing_rev,
+                     change->deleting, change->deleting_rev,
+                     copyfrom);
+  return str;
+}
+#endif
+
 /* Check whether RELPATH is known to exist, known to not exist, or unknown. */
 static svn_tristate_t
 check_existence(apr_hash_t *changes,
@@ -1535,8 +1614,7 @@ drive_changes_r(const char *rrpath,
                                                         scratch_pool,
                                                         scratch_pool);
           union_children = (current_children
-                            ? apr_hash_overlay(scratch_pool, current_children,
-                                               final_children)
+                            ? hash_overlay(current_children, final_children)
                             : final_children);
           for (hi = apr_hash_first(scratch_pool, union_children);
                hi; hi = apr_hash_next(hi))
@@ -1567,15 +1645,6 @@ drive_changes_r(const char *rrpath,
                       child_pred->relpath = this_rrpath;
                     }
                }
-              /*(("child '%s' current=%s final? %d%s",
-                       name,
-                       child_pred ? pathrev_str(*child_pred, scratch_pool)
-                                  : "<nil>",
-                       (svn_hash_gets(final_children, name) != NULL),
-                       final_copy_from.relpath
-                         ? apr_psprintf(scratch_pool, " parent-cp-from=%s@%ld",
-                                        final_copy_from.relpath,
-                                        final_copy_from.rev) : ""));*/
 
               SVN_ERR(drive_changes_r(this_rrpath,
                                       child_pred,
@@ -1709,14 +1778,13 @@ compat_branch_txn_add_branch(svn_branch_
 static svn_branch__state_t *
 compat_branch_txn_add_new_branch(svn_branch__txn_t *txn,
                                  const char *bid,
-                                 svn_branch__rev_bid_t *predecessor,
                                  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, predecessor, root_eid,
+                                     bid, root_eid,
                                      scratch_pool);
 
   return new_branch;
@@ -1776,7 +1844,6 @@ compat_branch_txn_finalize_eids(svn_bran
 static svn_error_t *
 compat_branch_txn_open_branch(svn_branch__txn_t *txn,
                               svn_branch__state_t **new_branch_p,
-                              svn_branch__rev_bid_t *predecessor,
                               const char *new_branch_id,
                               int root_eid,
                               apr_pool_t *result_pool,
@@ -1784,7 +1851,7 @@ compat_branch_txn_open_branch(svn_branch
 {
   /* Just forwarding: nothing more is needed. */
   SVN_ERR(svn_branch__txn_open_branch(txn->priv->txn,
-                                      new_branch_p, predecessor,
+                                      new_branch_p,
                                       new_branch_id, root_eid,
                                       result_pool,
                                       scratch_pool));

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=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_delta/branch_nested.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_delta/branch_nested.c Sat Dec 12 11:15:19 2015
@@ -209,8 +209,6 @@ svn_branch__get_subtree(svn_branch__stat
                                                       result_pool);
   new_subtree
     = svn_branch__subtree_create(element_tree->e_map, eid, result_pool);
-  new_subtree->predecessor = svn_branch__rev_bid_dup(branch->predecessor,
-                                                     result_pool);
 
   /* Add subbranches */
   SVN_ERR(svn_branch__get_immediate_subbranch_eids(branch, &subbranch_eids,
@@ -303,7 +301,6 @@ svn_branch__instantiate_elements_r(svn_b
                                             scratch_pool);
         new_branch = svn_branch__txn_add_new_branch(to_branch->txn,
                                                     new_branch_id,
-                                                    this_subtree->predecessor,
                                                     this_subtree->tree->root_eid,
                                                     scratch_pool);
 
@@ -480,14 +477,13 @@ nested_branch_txn_add_branch(svn_branch_
 static svn_branch__state_t *
 nested_branch_txn_add_new_branch(svn_branch__txn_t *txn,
                                  const char *bid,
-                                 svn_branch__rev_bid_t *predecessor,
                                  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, predecessor, root_eid,
+                                     bid, root_eid,
                                      scratch_pool);
 
   return new_branch;
@@ -539,7 +535,6 @@ nested_branch_txn_new_eid(svn_branch__tx
 static svn_error_t *
 nested_branch_txn_open_branch(svn_branch__txn_t *txn,
                               svn_branch__state_t **new_branch_p,
-                              svn_branch__rev_bid_t *predecessor,
                               const char *new_branch_id,
                               int root_eid,
                               apr_pool_t *result_pool,
@@ -547,10 +542,10 @@ nested_branch_txn_open_branch(svn_branch
 {
   /* Just forwarding: nothing more is needed. */
   SVN_ERR(svn_branch__txn_open_branch(txn->priv->wrapped_txn,
-                                      new_branch_p, predecessor,
+                                      new_branch_p,
                                       new_branch_id, root_eid,
                                       result_pool,
-                                     scratch_pool));
+                                      scratch_pool));
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/ra-git/subversion/libsvn_delta/element.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_delta/element.c?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_delta/element.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_delta/element.c Sat Dec 12 11:15:19 2015
@@ -72,7 +72,8 @@ svn_eid__hash_sorted_first(apr_pool_t *p
 
   hi->array = svn_sort__hash(ht, comparison_func, pool);
   hi->i = 0;
-  hi->eid = *(int *)(APR_ARRAY_IDX(hi->array, hi->i, svn_sort__item_t).key);
+  hi->eid = *(const int *)(APR_ARRAY_IDX(hi->array, hi->i,
+                                         svn_sort__item_t).key);
   hi->val = APR_ARRAY_IDX(hi->array, hi->i, svn_sort__item_t).value;
   return hi;
 }
@@ -85,7 +86,8 @@ svn_eid__hash_sorted_next(svn_eid__hash_
     {
       return NULL;
     }
-  hi->eid = *(int *)(APR_ARRAY_IDX(hi->array, hi->i, svn_sort__item_t).key);
+  hi->eid = *(const int *)(APR_ARRAY_IDX(hi->array, hi->i,
+                                         svn_sort__item_t).key);
   hi->val = APR_ARRAY_IDX(hi->array, hi->i, svn_sort__item_t).value;
   return hi;
 }
@@ -124,8 +126,8 @@ svn_element__payload_invariants(const sv
        || payload->kind == svn_node_file
        || payload->kind == svn_node_symlink)
       && (payload->props
-          && (!payload->text == (payload->kind != svn_node_file))
-          && (!payload->target == (payload->kind != svn_node_symlink))))
+          && ((payload->kind == svn_node_file) == !!payload->text)
+          && ((payload->kind == svn_node_symlink) == !!payload->target)))
     return TRUE;
   return FALSE;
 }

Modified: subversion/branches/ra-git/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_diff/parse-diff.c?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_diff/parse-diff.c Sat Dec 12 11:15:19 2015
@@ -345,9 +345,8 @@ read_handler_base85(void *baton, char *b
         b85b->next_pos = b85b->end_pos;
       else
         {
-          b85b->next_pos = 0;
-          SVN_ERR(svn_io_file_seek(b85b->file, APR_CUR, &b85b->next_pos,
-                                   iterpool));
+          SVN_ERR(svn_io_file_get_offset(&b85b->next_pos, b85b->file,
+                                         iterpool));
         }
 
       if (line->len && line->data[0] >= 'A' && line->data[0] <= 'Z')
@@ -669,8 +668,7 @@ hunk_readline_original_or_modified(apr_f
       return SVN_NO_ERROR;
     }
 
-  pos = 0;
-  SVN_ERR(svn_io_file_seek(file, APR_CUR, &pos,  scratch_pool));
+  SVN_ERR(svn_io_file_get_offset(&pos, file, scratch_pool));
   SVN_ERR(svn_io_file_seek(file, APR_SET, &range->current, scratch_pool));
 
   /* It's not ITERPOOL because we use data allocated in LAST_POOL out
@@ -683,8 +681,7 @@ hunk_readline_original_or_modified(apr_f
       max_len = range->end - range->current;
       SVN_ERR(svn_io_file_readline(file, &str, eol, eof, max_len,
                                    last_pool, last_pool));
-      range->current = 0;
-      SVN_ERR(svn_io_file_seek(file, APR_CUR, &range->current, last_pool));
+      SVN_ERR(svn_io_file_get_offset(&range->current, file, last_pool));
       filtered = (str->data[0] == verboten || str->data[0] == '\\');
     }
   while (filtered && ! *eof);
@@ -803,17 +800,15 @@ svn_diff_hunk_readline_diff_text(svn_dif
       return SVN_NO_ERROR;
     }
 
-  pos = 0;
-  SVN_ERR(svn_io_file_seek(hunk->apr_file, APR_CUR, &pos, scratch_pool));
+  SVN_ERR(svn_io_file_get_offset(&pos, hunk->apr_file, scratch_pool));
   SVN_ERR(svn_io_file_seek(hunk->apr_file, APR_SET,
                            &hunk->diff_text_range.current, scratch_pool));
   max_len = hunk->diff_text_range.end - hunk->diff_text_range.current;
   SVN_ERR(svn_io_file_readline(hunk->apr_file, &line, eol, eof, max_len,
                                result_pool,
                    scratch_pool));
-  hunk->diff_text_range.current = 0;
-  SVN_ERR(svn_io_file_seek(hunk->apr_file, APR_CUR,
-                           &hunk->diff_text_range.current, scratch_pool));
+  SVN_ERR(svn_io_file_get_offset(&hunk->diff_text_range.current,
+                                 hunk->apr_file, scratch_pool));
 
   if (*eof && !*eol && *line->data)
     {
@@ -1088,9 +1083,8 @@ parse_next_hunk(svn_diff_hunk_t **hunk,
   modified_end = 0;
   *hunk = apr_pcalloc(result_pool, sizeof(**hunk));
 
-  /* Get current seek position -- APR has no ftell() :( */
-  pos = 0;
-  SVN_ERR(svn_io_file_seek(apr_file, APR_CUR, &pos, scratch_pool));
+  /* Get current seek position. */
+  SVN_ERR(svn_io_file_get_offset(&pos, apr_file, scratch_pool));
 
   /* Start out assuming noise. */
   last_line_type = noise_line;
@@ -1107,8 +1101,7 @@ parse_next_hunk(svn_diff_hunk_t **hunk,
                                    iterpool, iterpool));
 
       /* Update line offset for next iteration. */
-      pos = 0;
-      SVN_ERR(svn_io_file_seek(apr_file, APR_CUR, &pos, iterpool));
+      SVN_ERR(svn_io_file_get_offset(&pos, apr_file, iterpool));
 
       /* Lines starting with a backslash indicate a missing EOL:
        * "\ No newline at end of file" or "end of property". */
@@ -1966,8 +1959,7 @@ parse_binary_patch(svn_patch_t *patch, a
 
   patch->prop_patches = apr_hash_make(result_pool);
 
-  pos = 0;
-  SVN_ERR(svn_io_file_seek(apr_file, APR_CUR, &pos, scratch_pool));
+  SVN_ERR(svn_io_file_get_offset(&pos, apr_file, scratch_pool));
 
   while (!eof)
     {
@@ -1976,8 +1968,7 @@ parse_binary_patch(svn_patch_t *patch, a
                                iterpool, iterpool));
 
       /* Update line offset for next iteration. */
-      pos = 0;
-      SVN_ERR(svn_io_file_seek(apr_file, APR_CUR, &pos, iterpool));
+      SVN_ERR(svn_io_file_get_offset(&pos, apr_file, iterpool));
 
       if (in_blob)
         {
@@ -2158,9 +2149,8 @@ svn_diff_parse_next_patch(svn_patch_t **
       if (! eof)
         {
           /* Update line offset for next iteration. */
-          pos = 0;
-          SVN_ERR(svn_io_file_seek(patch_file->apr_file, APR_CUR, &pos,
-                                   iterpool));
+          SVN_ERR(svn_io_file_get_offset(&pos, patch_file->apr_file,
+                                         iterpool));
         }
 
       /* Run the state machine. */
@@ -2270,9 +2260,8 @@ svn_diff_parse_next_patch(svn_patch_t **
 
   svn_pool_destroy(iterpool);
 
-  patch_file->next_patch_offset = 0;
-  SVN_ERR(svn_io_file_seek(patch_file->apr_file, APR_CUR,
-                           &patch_file->next_patch_offset, scratch_pool));
+  SVN_ERR(svn_io_file_get_offset(&patch_file->next_patch_offset,
+                                 patch_file->apr_file, scratch_pool));
 
   if (patch && patch->hunks)
     {

Modified: subversion/branches/ra-git/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_fs/cached_data.c?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_fs/cached_data.c Sat Dec 12 11:15:19 2015
@@ -746,15 +746,15 @@ typedef struct rep_state_t
   int chunk_index;  /* number of the window to read */
 } rep_state_t;
 
-/* Simple wrapper around svn_fs_fs__get_file_offset to simplify callers. */
+/* Simple wrapper around svn_io_file_get_offset to simplify callers. */
 static svn_error_t *
 get_file_offset(apr_off_t *offset,
                 rep_state_t *rs,
                 apr_pool_t *pool)
 {
-  return svn_error_trace(svn_fs_fs__get_file_offset(offset,
-                                                    rs->sfile->rfile->file,
-                                                    pool));
+  return svn_error_trace(svn_io_file_get_offset(offset,
+                                                rs->sfile->rfile->file,
+                                                pool));
 }
 
 /* Simple wrapper around svn_io_file_aligned_seek to simplify callers. */

Modified: subversion/branches/ra-git/subversion/libsvn_fs_fs/index.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_fs/index.c?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_fs/index.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_fs/index.c Sat Dec 12 11:15:19 2015
@@ -231,7 +231,7 @@ stream_error_create(svn_fs_fs__packed_nu
   apr_off_t offset;
   SVN_ERR(svn_io_file_name_get(&file_name, stream->file,
                                stream->pool));
-  SVN_ERR(svn_fs_fs__get_file_offset(&offset, stream->file, stream->pool));
+  SVN_ERR(svn_io_file_get_offset(&offset, stream->file, stream->pool));
 
   return svn_error_createf(err, NULL, message, file_name,
                            apr_psprintf(stream->pool,

Modified: subversion/branches/ra-git/subversion/libsvn_fs_fs/pack.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_fs/pack.c?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_fs/pack.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_fs/pack.c Sat Dec 12 11:15:19 2015
@@ -481,7 +481,7 @@ copy_item_to_temp(pack_context_t *contex
   svn_fs_fs__p2l_entry_t *new_entry
     = apr_pmemdup(context->info_pool, entry, sizeof(*entry));
 
-  SVN_ERR(svn_fs_fs__get_file_offset(&new_entry->offset, temp_file, pool));
+  SVN_ERR(svn_io_file_get_offset(&new_entry->offset, temp_file, pool));
   APR_ARRAY_PUSH(entries, svn_fs_fs__p2l_entry_t *) = new_entry;
 
   SVN_ERR(copy_file_data(context, temp_file, rev_file, entry->size, pool));
@@ -568,7 +568,7 @@ copy_rep_to_temp(pack_context_t *context
   /* create a copy of ENTRY, make it point to the copy destination and
    * store it in CONTEXT */
   entry = apr_pmemdup(context->info_pool, entry, sizeof(*entry));
-  SVN_ERR(svn_fs_fs__get_file_offset(&entry->offset, context->reps_file, pool));
+  SVN_ERR(svn_io_file_get_offset(&entry->offset, context->reps_file, pool));
   add_item_rep_mapping(context, entry);
 
   /* read & parse the representation header */
@@ -719,8 +719,8 @@ copy_node_to_temp(pack_context_t *contex
   /* create a copy of ENTRY, make it point to the copy destination and
    * store it in CONTEXT */
   entry = apr_pmemdup(context->info_pool, entry, sizeof(*entry));
-  SVN_ERR(svn_fs_fs__get_file_offset(&entry->offset, context->reps_file,
-                                     pool));
+  SVN_ERR(svn_io_file_get_offset(&entry->offset, context->reps_file,
+                                 pool));
   add_item_rep_mapping(context, entry);
 
   /* copy the noderev to our temp file */
@@ -1438,21 +1438,17 @@ append_revision(pack_context_t *context,
   apr_off_t offset = 0;
   apr_pool_t *iterpool = svn_pool_create(pool);
   svn_fs_fs__revision_file_t *rev_file;
-  apr_finfo_t finfo;
-
-  /* Get the size of the file. */
-  const char *path = svn_dirent_join(context->shard_dir,
-                                     apr_psprintf(iterpool, "%ld",
-                                                  context->start_rev),
-                                     pool);
-  SVN_ERR(svn_io_stat(&finfo, path, APR_FINFO_SIZE, pool));
+  svn_filesize_t revfile_size;
 
   /* Copy all the bits from the rev file to the end of the pack file. */
   SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, context->fs,
                                            context->start_rev, pool,
                                            iterpool));
+  /* Get the size of the file. */
+  SVN_ERR(svn_io_file_size_get(&revfile_size, rev_file->file, pool));
+
   SVN_ERR(copy_file_data(context, context->pack_file, rev_file->file,
-                         finfo.size, iterpool));
+                         revfile_size, iterpool));
 
   /* mark the start of a new revision */
   SVN_ERR(svn_fs_fs__l2p_proto_index_add_revision(context->proto_l2p_index,
@@ -1460,7 +1456,7 @@ append_revision(pack_context_t *context,
 
   /* read the phys-to-log index file until we covered the whole rev file.
    * That index contains enough info to build both target indexes from it. */
-  while (offset < finfo.size)
+  while (offset < revfile_size)
     {
       /* read one cluster */
       int i;
@@ -1484,7 +1480,7 @@ append_revision(pack_context_t *context,
 
           /* process entry while inside the rev file */
           offset = entry->offset;
-          if (offset < finfo.size)
+          if (offset < revfile_size)
             {
               entry->offset += context->pack_offset;
               offset += entry->size;
@@ -1498,7 +1494,7 @@ append_revision(pack_context_t *context,
     }
 
   svn_pool_destroy(iterpool);
-  context->pack_offset += finfo.size;
+  context->pack_offset += revfile_size;
 
   SVN_ERR(svn_fs_fs__close_revision_file(rev_file));
 
@@ -1691,7 +1687,6 @@ pack_phys_addressed(const char *pack_fil
   apr_file_t *manifest_file;
   svn_stream_t *manifest_stream;
   svn_revnum_t end_rev, rev;
-  apr_off_t next_offset;
   apr_pool_t *iterpool;
 
   /* Some useful paths. */
@@ -1712,27 +1707,26 @@ pack_phys_addressed(const char *pack_fil
   manifest_stream = svn_stream_from_aprfile2(manifest_file, TRUE, pool);
 
   end_rev = start_rev + max_files_per_dir - 1;
-  next_offset = 0;
   iterpool = svn_pool_create(pool);
 
   /* Iterate over the revisions in this shard, squashing them together. */
   for (rev = start_rev; rev <= end_rev; rev++)
     {
       svn_stream_t *rev_stream;
-      apr_finfo_t finfo;
       const char *path;
+      apr_off_t offset;
 
       svn_pool_clear(iterpool);
 
-      /* Get the size of the file. */
       path = svn_dirent_join(shard_path, apr_psprintf(iterpool, "%ld", rev),
                              iterpool);
-      SVN_ERR(svn_io_stat(&finfo, path, APR_FINFO_SIZE, iterpool));
+
+      /* Obtain current offset in pack file. */
+      SVN_ERR(svn_io_file_get_offset(&offset, pack_file, iterpool));
 
       /* build manifest */
       SVN_ERR(svn_stream_printf(manifest_stream, iterpool,
-                                "%" APR_OFF_T_FMT "\n", next_offset));
-      next_offset += finfo.size;
+                                "%" APR_OFF_T_FMT "\n", offset));
 
       /* Copy all the bits from the rev file to the end of the pack file. */
       SVN_ERR(svn_stream_open_readonly(&rev_stream, path, iterpool, iterpool));

Modified: subversion/branches/ra-git/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_fs/transaction.c?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_fs/transaction.c Sat Dec 12 11:15:19 2015
@@ -2179,7 +2179,7 @@ rep_write_get_baton(struct rep_write_bat
                                                              b->scratch_pool),
                                     b->scratch_pool);
 
-  SVN_ERR(svn_fs_fs__get_file_offset(&b->rep_offset, file, b->scratch_pool));
+  SVN_ERR(svn_io_file_get_offset(&b->rep_offset, file, b->scratch_pool));
 
   /* Get the base for this delta. */
   SVN_ERR(choose_delta_base(&base_rep, fs, noderev, FALSE, b->scratch_pool));
@@ -2202,8 +2202,8 @@ rep_write_get_baton(struct rep_write_bat
                                       b->scratch_pool));
 
   /* Now determine the offset of the actual svndiff data. */
-  SVN_ERR(svn_fs_fs__get_file_offset(&b->delta_start, file,
-                                     b->scratch_pool));
+  SVN_ERR(svn_io_file_get_offset(&b->delta_start, file,
+                                 b->scratch_pool));
 
   /* Cleanup in case something goes wrong. */
   apr_pool_cleanup_register(b->scratch_pool, b, rep_write_cleanup,
@@ -2412,7 +2412,7 @@ rep_write_contents_close(void *baton)
     SVN_ERR(svn_stream_close(b->delta_stream));
 
   /* Determine the length of the svndiff data. */
-  SVN_ERR(svn_fs_fs__get_file_offset(&offset, b->file, b->scratch_pool));
+  SVN_ERR(svn_io_file_get_offset(&offset, b->file, b->scratch_pool));
   rep->size = offset - b->delta_start;
 
   /* Fill in the rest of the representation field. */
@@ -2459,7 +2459,7 @@ rep_write_contents_close(void *baton)
       svn_fs_fs__p2l_entry_t entry;
 
       entry.offset = b->rep_offset;
-      SVN_ERR(svn_fs_fs__get_file_offset(&offset, b->file, b->scratch_pool));
+      SVN_ERR(svn_io_file_get_offset(&offset, b->file, b->scratch_pool));
       entry.size = offset - b->rep_offset;
       entry.type = SVN_FS_FS__ITEM_TYPE_FILE_REP;
       entry.item.revision = SVN_INVALID_REVNUM;
@@ -2672,7 +2672,7 @@ write_container_rep(representation_t *re
   representation_t *old_rep;
   apr_off_t offset = 0;
 
-  SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, scratch_pool));
+  SVN_ERR(svn_io_file_get_offset(&offset, file, scratch_pool));
 
   whb = apr_pcalloc(scratch_pool, sizeof(*whb));
 
@@ -2720,7 +2720,7 @@ write_container_rep(representation_t *re
                                   offset, scratch_pool));
 
       entry.offset = offset;
-      SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, scratch_pool));
+      SVN_ERR(svn_io_file_get_offset(&offset, file, scratch_pool));
       entry.size = offset - entry.offset;
       entry.type = item_type;
       entry.item.revision = SVN_INVALID_REVNUM;
@@ -2787,7 +2787,7 @@ write_container_delta_rep(representation
   SVN_ERR(choose_delta_base(&base_rep, fs, noderev, is_props, scratch_pool));
   SVN_ERR(svn_fs_fs__get_contents(&source, fs, base_rep, FALSE, scratch_pool));
 
-  SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, scratch_pool));
+  SVN_ERR(svn_io_file_get_offset(&offset, file, scratch_pool));
 
   /* Write out the rep header. */
   if (base_rep)
@@ -2807,7 +2807,7 @@ write_container_delta_rep(representation
                                                            scratch_pool),
                                   scratch_pool);
   SVN_ERR(svn_fs_fs__write_rep_header(&header, file_stream, scratch_pool));
-  SVN_ERR(svn_fs_fs__get_file_offset(&delta_start, file, scratch_pool));
+  SVN_ERR(svn_io_file_get_offset(&delta_start, file, scratch_pool));
 
   /* Prepare to write the svndiff data. */
   svn_txdelta_to_svndiff3(&diff_wh,
@@ -2854,14 +2854,14 @@ write_container_delta_rep(representation
       svn_fs_fs__p2l_entry_t entry;
 
       /* Write out our cosmetic end marker. */
-      SVN_ERR(svn_fs_fs__get_file_offset(&rep_end, file, scratch_pool));
+      SVN_ERR(svn_io_file_get_offset(&rep_end, file, scratch_pool));
       SVN_ERR(svn_stream_puts(file_stream, "ENDREP\n"));
 
       SVN_ERR(allocate_item_index(&rep->item_index, fs, &rep->txn_id,
                                   offset, scratch_pool));
 
       entry.offset = offset;
-      SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, scratch_pool));
+      SVN_ERR(svn_io_file_get_offset(&offset, file, scratch_pool));
       entry.size = offset - entry.offset;
       entry.type = item_type;
       entry.item.revision = SVN_INVALID_REVNUM;
@@ -3148,7 +3148,7 @@ write_final_rev(const svn_fs_id_t **new_
     noderev->copyroot_rev = rev;
 
   /* root nodes have a fixed ID in log addressing mode */
-  SVN_ERR(svn_fs_fs__get_file_offset(&my_offset, file, pool));
+  SVN_ERR(svn_io_file_get_offset(&my_offset, file, pool));
   if (svn_fs_fs__use_log_addressing(fs) && at_root)
     {
       /* reference the root noderev from the log-to-phys index */
@@ -3221,7 +3221,7 @@ write_final_rev(const svn_fs_id_t **new_
       rev_item.revision = SVN_INVALID_REVNUM;
 
       entry.offset = my_offset;
-      SVN_ERR(svn_fs_fs__get_file_offset(&my_offset, file, pool));
+      SVN_ERR(svn_io_file_get_offset(&my_offset, file, pool));
       entry.size = my_offset - entry.offset;
       entry.type = SVN_FS_FS__ITEM_TYPE_NODEREV;
       entry.item = rev_item;
@@ -3254,7 +3254,7 @@ write_final_changed_path_info(apr_off_t
   svn_stream_t *stream;
   svn_checksum_ctx_t *fnv1a_checksum_ctx;
 
-  SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, pool));
+  SVN_ERR(svn_io_file_get_offset(&offset, file, pool));
 
   /* write to target file & calculate checksum */
   stream = fnv1a_wrap_stream(&fnv1a_checksum_ctx,
@@ -3270,7 +3270,7 @@ write_final_changed_path_info(apr_off_t
       svn_fs_fs__p2l_entry_t entry;
 
       entry.offset = offset;
-      SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, pool));
+      SVN_ERR(svn_io_file_get_offset(&offset, file, pool));
       entry.size = offset - entry.offset;
       entry.type = SVN_FS_FS__ITEM_TYPE_CHANGES;
       entry.item.revision = SVN_INVALID_REVNUM;
@@ -3642,7 +3642,7 @@ commit_body(void *baton, apr_pool_t *poo
   /* Get a write handle on the proto revision file. */
   SVN_ERR(get_writable_proto_rev(&proto_file, &proto_file_lockcookie,
                                  cb->fs, txn_id, pool));
-  SVN_ERR(svn_fs_fs__get_file_offset(&initial_offset, proto_file, pool));
+  SVN_ERR(svn_io_file_get_offset(&initial_offset, proto_file, pool));
 
   /* Write out all the node-revisions and directory contents. */
   root_id = svn_fs_fs__id_txn_create_root(txn_id, pool);

Modified: subversion/branches/ra-git/subversion/libsvn_fs_fs/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_fs/util.c?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_fs/util.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_fs/util.c Sat Dec 12 11:15:19 2015
@@ -566,22 +566,6 @@ svn_fs_fs__try_stringbuf_from_file(svn_s
 }
 
 svn_error_t *
-svn_fs_fs__get_file_offset(apr_off_t *offset_p,
-                           apr_file_t *file,
-                           apr_pool_t *pool)
-{
-  apr_off_t offset;
-
-  /* Note that, for buffered files, one (possibly surprising) side-effect
-     of this call is to flush any unwritten data to disk. */
-  offset = 0;
-  SVN_ERR(svn_io_file_seek(file, APR_CUR, &offset, pool));
-  *offset_p = offset;
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
 svn_fs_fs__read_content(svn_stringbuf_t **content,
                         const char *fname,
                         apr_pool_t *pool)

Modified: subversion/branches/ra-git/subversion/libsvn_fs_fs/util.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_fs/util.h?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_fs/util.h (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_fs/util.h Sat Dec 12 11:15:19 2015
@@ -363,12 +363,6 @@ svn_fs_fs__try_stringbuf_from_file(svn_s
                                    svn_boolean_t last_attempt,
                                    apr_pool_t *pool);
 
-/* Fetch the current offset of FILE into *OFFSET_P. */
-svn_error_t *
-svn_fs_fs__get_file_offset(apr_off_t *offset_p,
-                           apr_file_t *file,
-                           apr_pool_t *pool);
-
 /* Read the file FNAME and store the contents in *BUF.
    Allocations are performed in POOL. */
 svn_error_t *

Modified: subversion/branches/ra-git/subversion/libsvn_fs_fs/verify.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_fs/verify.c?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_fs/verify.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_fs/verify.c Sat Dec 12 11:15:19 2015
@@ -480,7 +480,7 @@ expect_buffer_nul(apr_file_t *file,
         apr_off_t offset;
 
         SVN_ERR(svn_io_file_name_get(&file_name, file, pool));
-        SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, pool));
+        SVN_ERR(svn_io_file_get_offset(&offset, file, pool));
         offset -= size - i;
 
         return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,

Propchange: subversion/branches/ra-git/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Dec 12 11:15:19 2015
@@ -95,4 +95,4 @@
 /subversion/branches/verify-keep-going/subversion/libsvn_fs_x:1439280-1492639,1546002-1546110
 /subversion/branches/wc-collate-path/subversion/libsvn_fs_x:1402685-1480384
 /subversion/trunk/subversion/libsvn_fs_fs:1415133-1596500,1596567,1597414,1597989,1598273,1599140,1600872,1601633,1603485-1603487,1603499,1603605,1604128,1604188,1604413-1604414,1604416-1604417,1604421,1604442,1604700,1604717,1604720,1604726,1604755,1604794,1604802,1604824,1604836,1604844,1604902-1604903,1604911,1604925,1604933,1604947,1605059-1605060,1605064-1605065,1605068,1605071-1605073,1605075,1605123,1605188-1605189,1605191,1605197,1605444,1605633,1606132,1606142,1606144,1606514,1606526,1606528,1606551,1606554,1606564,1606598-1606599,1606656,1606658,1606662,1606744,1606840,1607085,1607572,1612407,1612810,1613339,1613872,1614611,1615348,1615351-1615352,1615356,1616338-1616339,1616613,1617586,1617688,1618138,1618151,1618153,1618226,1618641,1618653,1618662,1619068,1619358,1619413,1619769,1619774,1620602,1620909,1620912,1620928,1620930,1621275,1621635,1622931,1622937,1622942,1622946,1622959-1622960,1622963,1622987,1623007,1623368,1623373,1623377,1623379,1623381,1623398,1623402,162
 4011,1624265,1624512,1626246,1626871,1626873,1626886,1627497-1627498,1627502,1627947-1627949,1627966,1628083,1628093,1628158-1628159,1628161,1628392-1628393,1628415,1628427,1628676,1628738,1628762,1628764,1629854-1629855,1629857,1629865,1629873,1629875,1629879,1630067,1630070,1631049-1631051,1631075,1631115,1631171,1631180,1631185-1631186,1631196-1631197,1631239-1631240,1631548,1631550,1631563,1631567,1631588,1631598,1632646,1632776,1632849,1632851-1632853,1632856-1632857,1632868,1632908,1632926,1633232,1633617-1633618,1634872,1634875,1634879-1634880,1634920,1636478,1636483,1636629,1636644,1637184,1637186,1637330,1637358,1637363,1637393,1639319,1639322,1639335,1639348,1639352,1639355,1639358,1639414,1639419,1639426,1639430,1639436,1639440,1639549,1640061-1640062,1640197,1640915,1640966,1641013,1643139,1643233,1645567,1646021,1646712,1646716,1647537,1647540-1647541,1647820,1647905,1648230,1648238,1648241-1648243,1648253,1648272,1648532,1648537-1648539,1648542,1648591,1648612,1649590,
 1651567,1652068,1652076,1652441,1652451,1653608,1654932,1654934,1654937,1655635,1655649,1655651,1655664,1656176,1657525,1657972,1657978,1658482,1659212,1659217,1659314,1659509,1662668,1665318,1665854,1665894,1667090,1667101,1667538,1669743,1669746,1669749,1669945,1670139,1670953,1673170,1673197,1673202,1673204,1673445,1673454,1673685,1673689,1673875,1674165,1674341,1674400,1674404,1674631,1674669,1674673,1675396,1676667,1677431,1678149,1678151,1678718,1678725,1679169,1679907,1679920-1679924,1679926,1680347,1680460,1680464,1680476,1680819,1681949,1681966,1681974,1681994,1682008,1682076,1682086,1682093,1682259,1682265,1682739,1682864,1683311,1683330,1683378,1683544,1683553,1684047,1686232,1686542,1686546,1686554,1686557,1687061,1687064,1687070-1687071,1687074,1687078-1687079,1688270,1688425,1692650,1693886,1694489,1694848,1696171,1696185,1696627-1696628,1696630,1696758,1697372,1697381,1697387,1697393,1697403,1697405,1701017,1701053,1702600,1702922,1703069,1703142,1703237,1703240,17052
 66,1705638,1705643,1705646,1705724,1705730,1705739,1706612,1706615,1706617,1706619,1706675-1706676,1706679,1706979-1706980,1707308,1707971-1707973,1707986,1707988-1707989,1708004,1709799,1710017,1710359,1711582,1711672,1712927,1715793,1715947,1716047,1716067,1716784,1716973-1716974,1717332,1717334
-/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914,1583624-1717578
+/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914,1583624-1719651

Modified: subversion/branches/ra-git/subversion/libsvn_fs_x/low_level.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_x/low_level.c?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_x/low_level.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_x/low_level.c Sat Dec 12 11:15:19 2015
@@ -1148,7 +1148,7 @@ svn_fs_x__write_changes(svn_stream_t *st
 
 svn_error_t *
 svn_fs_x__parse_properties(apr_hash_t **properties,
-                           svn_string_t *content,
+                           const svn_string_t *content,
                            apr_pool_t *result_pool)
 {
   const apr_byte_t *p = (const apr_byte_t *)content->data;

Modified: subversion/branches/ra-git/subversion/libsvn_fs_x/low_level.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_x/low_level.h?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_x/low_level.h (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_x/low_level.h Sat Dec 12 11:15:19 2015
@@ -216,7 +216,7 @@ svn_fs_x__write_changes(svn_stream_t *st
  */
 svn_error_t *
 svn_fs_x__parse_properties(apr_hash_t **properties,
-                           svn_string_t *content,
+                           const svn_string_t *content,
                            apr_pool_t *result_pool);
 
 /* Write the property list PROPLIST to STREAM in serialized format.

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=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_repos/commit.c Sat Dec 12 11:15:19 2015
@@ -73,7 +73,7 @@ struct edit_baton
   svn_repos_t *repos;
 
   /* URL to the root of the open repository. */
-  const char *repos_root_url;
+  const char *repos_url_decoded;
 
   /* The name of the repository (here for convenience). */
   const char *repos_name;
@@ -344,16 +344,13 @@ 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_uri_canonicalize(copy_path, subpool);
-      copy_path = svn_uri_skip_ancestor(eb->repos_root_url, copy_path,
-                                        subpool);
-      if (!copy_path)
+      copy_path = svn_path_uri_decode(copy_path, subpool);
+      fs_path = svn_cstring_skip_prefix(copy_path, eb->repos_url_decoded);
+      if (!fs_path)
         return svn_error_createf
           (SVN_ERR_FS_GENERAL, NULL,
            _("Source url '%s' is from different repository"), copy_path);
 
-      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. */
       SVN_ERR(svn_fs_revision_root(&copy_root, eb->fs,
@@ -1009,9 +1006,7 @@ 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);
-  /* 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);
+  const char *repos_url = svn_path_uri_encode(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. */
@@ -1053,7 +1048,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_root_url = repos_url;
+  eb->repos_url_decoded = repos_url_decoded;
   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_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_repos/dump.c?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_repos/dump.c Sat Dec 12 11:15:19 2015
@@ -326,7 +326,7 @@ store_delta(apr_file_t **tempfile, svn_f
             svn_fs_root_t *newroot, const char *newpath, apr_pool_t *pool)
 {
   svn_stream_t *temp_stream;
-  apr_off_t offset = 0;
+  apr_off_t offset;
   svn_txdelta_stream_t *delta_stream;
   svn_txdelta_window_handler_t wh;
   void *whb;
@@ -346,7 +346,7 @@ store_delta(apr_file_t **tempfile, svn_f
   SVN_ERR(svn_txdelta_send_txstream(delta_stream, wh, whb, pool));
 
   /* Get the length of the temporary file and rewind it. */
-  SVN_ERR(svn_io_file_seek(*tempfile, APR_CUR, &offset, pool));
+  SVN_ERR(svn_io_file_get_offset(&offset, *tempfile, pool));
   *len = offset;
   offset = 0;
   return svn_io_file_seek(*tempfile, APR_SET, &offset, pool);

Modified: subversion/branches/ra-git/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/io.c?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/io.c Sat Dec 12 11:15:19 2015
@@ -3757,6 +3757,22 @@ svn_io_file_size_get(svn_filesize_t *fil
 }
 
 svn_error_t *
+svn_io_file_get_offset(apr_off_t *offset_p,
+                       apr_file_t *file,
+                       apr_pool_t *pool)
+{
+  apr_off_t offset;
+
+  /* Note that, for buffered files, one (possibly surprising) side-effect
+     of this call is to flush any unwritten data to disk. */
+  offset = 0;
+  SVN_ERR(svn_io_file_seek(file, APR_CUR, &offset, pool));
+  *offset_p = offset;
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_io_file_read(apr_file_t *file, void *buf,
                  apr_size_t *nbytes, apr_pool_t *pool)
 {
@@ -5367,8 +5383,7 @@ svn_io_file_readline(apr_file_t *file,
               apr_off_t pos;
 
               /* Check for "\r\n" by peeking at the next byte. */
-              pos = 0;
-              SVN_ERR(svn_io_file_seek(file, APR_CUR, &pos, scratch_pool));
+              SVN_ERR(svn_io_file_get_offset(&pos, file, scratch_pool));
               SVN_ERR(svn_io_file_read_full2(file, &c, sizeof(c), &numbytes,
                                              &found_eof, scratch_pool));
               if (numbytes == 1 && c == '\n')

Modified: subversion/branches/ra-git/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/stream.c?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/stream.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/stream.c Sat Dec 12 11:15:19 2015
@@ -925,8 +925,7 @@ mark_handler_apr(void *baton, svn_stream
   struct mark_apr *mark_apr;
 
   mark_apr = apr_palloc(pool, sizeof(*mark_apr));
-  mark_apr->off = 0;
-  SVN_ERR(svn_io_file_seek(btn->file, APR_CUR, &mark_apr->off, btn->pool));
+  SVN_ERR(svn_io_file_get_offset(&mark_apr->off, btn->file, btn->pool));
   *mark = (svn_stream_mark_t *)mark_apr;
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/ra-git/subversion/tests/cmdline/svnmover_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/svnmover_tests.py?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/cmdline/svnmover_tests.py (original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/svnmover_tests.py Sat Dec 12 11:15:19 2015
@@ -563,7 +563,7 @@ def reported_br_params(path1, path2):
   return subbranch_rpath, subbranch_fullpath
 
 def reported_mg_diff():
-  return [r'--- .*merge history.*']
+  return []  #[r'--- history ...']
 
 def reported_br_diff(path1, path2=None):
   """Return expected header lines for diff of a branch, or subtree in a branch.

Modified: subversion/branches/ra-git/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/libsvn_fs/fs-test.c?rev=1719652&r1=1719651&r2=1719652&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/branches/ra-git/subversion/tests/libsvn_fs/fs-test.c Sat Dec 12 11:15:19 2015
@@ -5400,7 +5400,7 @@ test_fs_info_format(const svn_test_opts_
   opts2 = *opts;
   opts2.server_minor_version = is_fsx ? 10 : 5;
 
-  SVN_ERR(svn_test__create_fs(&fs, "test-fs-format-info", &opts2, pool));
+  SVN_ERR(svn_test__create_fs(&fs, "test-repo-fs-format-info", &opts2, pool));
   SVN_ERR(svn_fs_info_format(&fs_format, &supports_version, fs, pool, pool));
 
   if (is_fsx)
@@ -5442,7 +5442,7 @@ commit_timestamp(const svn_test_opts_t *
   svn_string_t *svn_date;
   svn_string_t *txn_svn_date;
 
-  SVN_ERR(svn_test__create_fs(&fs, "test-fs-commit-timestamp",
+  SVN_ERR(svn_test__create_fs(&fs, "test-repo-fs-commit-timestamp",
                               opts, pool));
 
   /* Commit with a specified svn:date. */
@@ -5595,7 +5595,8 @@ dir_prop_merge(const svn_test_opts_t *op
   svn_boolean_t is_bdb = strcmp(opts->fs_type, SVN_FS_TYPE_BDB) == 0;
 
   /* Create test repository. */
-  SVN_ERR(svn_test__create_fs(&fs, "test-fs-dir_prop-merge", opts, pool));
+  SVN_ERR(svn_test__create_fs(&fs, "test-repo-fs-dir_prop-merge", opts,
+                              pool));
 
   SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, pool));
   SVN_ERR(svn_fs_txn_root(&root, txn, pool));
@@ -5679,7 +5680,7 @@ upgrade_while_committing(const svn_test_
                             "pre-1.6 SVN doesn't support FSFS packing");
 
   /* Create test repository with greek tree. */
-  fs_path = "test-upgrade-while-committing";
+  fs_path = "test-repo-upgrade-while-committing";
 
   svn_hash_sets(fs_config, SVN_FS_CONFIG_COMPATIBLE_VERSION, "1.7");
   svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_SHARD_SIZE, "2");
@@ -5768,7 +5769,7 @@ test_paths_changed(const svn_test_opts_t
     has_mergeinfo_mod = TRUE;
 
   /* Create test repository with greek tree. */
-  fs_path = "test-paths-changed";
+  fs_path = "test-repo-paths-changed";
 
   SVN_ERR(svn_test__create_fs2(&fs, fs_path, opts, NULL, pool));
 
@@ -5865,7 +5866,7 @@ test_delete_replaced_paths_changed(const
   const svn_fs_id_t *file_id;
 
   /* Create test repository with greek tree. */
-  fs_path = "test-delete-replace-paths-changed";
+  fs_path = "test-repo-delete-replace-paths-changed";
 
   SVN_ERR(svn_test__create_fs2(&fs, fs_path, opts, NULL, pool));
 
@@ -6707,7 +6708,8 @@ test_fsfs_config_opts(const svn_test_opt
                             "this will test FSFS repositories only");
 
   /* Remove the test directory from previous runs. */
-  SVN_ERR(svn_io_remove_dir2("test-fsfs-config-opts", TRUE, NULL, NULL, pool));
+  SVN_ERR(svn_io_remove_dir2("test-repo-fsfs-config-opts", TRUE, NULL, NULL,
+                             pool));
 
   /* Create the test directory and add it to the test cleanup list. */
   SVN_ERR(svn_io_dir_make("test-fsfs-config-opts", APR_OS_DEFAULT, pool));
@@ -6813,7 +6815,7 @@ test_modify_txn_being_written(const svn_
                             "this will not test BDB repositories");
 
   /* Create a new repo. */
-  SVN_ERR(svn_test__create_fs(&fs, "test-modify-txn-being-written",
+  SVN_ERR(svn_test__create_fs(&fs, "test-repo-modify-txn-being-written",
                               opts, pool));
 
   /* Create a TXN_ROOT referencing FS. */
@@ -6861,7 +6863,7 @@ test_prop_and_text_rep_sharing_collision
   svn_fs_root_t *rev_root;
   svn_revnum_t new_rev;
   svn_filesize_t length;
-  const char *testdir = "test-prop-and-text-rep-sharing-collision";
+  const char *testdir = "test-repo-prop-and-text-rep-sharing-collision";
 
   /* Create a new repo. */
   SVN_ERR(svn_test__create_fs(&fs, testdir, opts, pool));
@@ -6985,7 +6987,8 @@ freeze_and_commit(const svn_test_opts_t
     return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
                             "this will not test BDB repositories");
 
-  SVN_ERR(svn_test__create_fs(&fs, "test-freeze-and-commit", opts, subpool));
+  SVN_ERR(svn_test__create_fs(&fs, "test-repo-freeze-and-commit", opts,
+                              subpool));
 
   /* This test used to FAIL with an SQLite error since svn_fs_freeze()
    * wouldn't unlock rep-cache.db.  Therefore, part of the role of creating