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

svn commit: r1546002 [15/39] - in /subversion/branches/verify-keep-going: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ build/win32/ contrib/client-side/emacs/ contrib/server-side/ contrib/server-side/svnc...

Modified: subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.c Wed Nov 27 11:52:35 2013
@@ -41,8 +41,8 @@
 #include <apr_pools.h>
 #include <apr_hash.h>
 
-#include "svn_hash.h"
 #include "svn_private_config.h"
+#include "svn_hash.h"
 #include "svn_pools.h"
 #include "svn_error.h"
 #include "svn_path.h"
@@ -51,13 +51,16 @@
 #include "svn_props.h"
 
 #include "fs.h"
-#include "key-gen.h"
+#include "cached_data.h"
 #include "dag.h"
 #include "lock.h"
 #include "tree.h"
 #include "fs_fs.h"
 #include "id.h"
+#include "pack.h"
 #include "temp_serializer.h"
+#include "transaction.h"
+#include "util.h"
 
 #include "private/svn_mergeinfo_private.h"
 #include "private/svn_subr_private.h"
@@ -100,24 +103,13 @@
    kept in the FS object and shared among multiple revision root
    objects.
 */
-typedef struct fs_rev_root_data_t
-{
-  /* A dag node for the revision's root directory. */
-  dag_node_t *root_dir;
-
-  /* Cache structure for mapping const char * PATH to const char
-     *COPYFROM_STRING, so that paths_changed can remember all the
-     copyfrom information in the changes file.
-     COPYFROM_STRING has the format "REV PATH", or is the empty string if
-     the path was added without history. */
-  apr_hash_t *copyfrom_cache;
-
-} fs_rev_root_data_t;
+typedef dag_node_t fs_rev_root_data_t;
 
 typedef struct fs_txn_root_data_t
 {
-  const char *txn_id;
-
+  /* TXN_ID value from the main struct but as a struct instead of a string */
+  svn_fs_fs__id_part_t txn_id;
+  
   /* Cache of txn DAG nodes (without their nested noderevs, because
    * it's mutable). Same keys/values as ffd->rev_node_cache. */
   svn_cache__t *txn_node_cache;
@@ -135,10 +127,18 @@ static svn_fs_root_t *make_revision_root
                                          apr_pool_t *pool);
 
 static svn_error_t *make_txn_root(svn_fs_root_t **root_p,
-                                  svn_fs_t *fs, const char *txn,
-                                  svn_revnum_t base_rev, apr_uint32_t flags,
+                                  svn_fs_t *fs,
+                                  const svn_fs_fs__id_part_t *txn,
+                                  svn_revnum_t base_rev,
+                                  apr_uint32_t flags,
                                   apr_pool_t *pool);
 
+static svn_error_t *fs_closest_copy(svn_fs_root_t **root_p,
+                                    const char **path_p,
+                                    svn_fs_root_t *root,
+                                    const char *path,
+                                    apr_pool_t *pool);
+
 
 /*** Node Caching ***/
 
@@ -635,7 +635,8 @@ svn_fs_fs__txn_root(svn_fs_root_t **root
         flags |= SVN_FS_TXN_CHECK_LOCKS;
     }
 
-  return make_txn_root(root_p, txn->fs, txn->id, txn->base_rev, flags, pool);
+  return make_txn_root(root_p, txn->fs, svn_fs_fs__txn_get_id(txn),
+                       txn->base_rev, flags, pool);
 }
 
 
@@ -660,6 +661,15 @@ svn_fs_fs__revision_root(svn_fs_root_t *
 
 /* Getting dag nodes for roots.  */
 
+/* Return the transaction ID to a given transaction ROOT. */
+static const svn_fs_fs__id_part_t *
+root_txn_id(svn_fs_root_t *root)
+{
+  fs_txn_root_data_t *frd = root->fsap_data;
+  assert(root->is_txn_root);
+  
+  return &frd->txn_id;
+}
 
 /* Set *NODE_P to a freshly opened dag node referring to the root
    directory of ROOT, allocating from POOL.  */
@@ -671,14 +681,15 @@ root_node(dag_node_t **node_p,
   if (root->is_txn_root)
     {
       /* It's a transaction root.  Open a fresh copy.  */
-      return svn_fs_fs__dag_txn_root(node_p, root->fs, root->txn, pool);
+      return svn_fs_fs__dag_txn_root(node_p, root->fs, root_txn_id(root),
+                                     pool);
     }
   else
     {
       /* It's a revision root, so we already have its root directory
          opened.  */
-      fs_rev_root_data_t *frd = root->fsap_data;
-      *node_p = svn_fs_fs__dag_dup(frd->root_dir, pool);
+      dag_node_t *root_dir = root->fsap_data;
+      *node_p = svn_fs_fs__dag_dup(root_dir, pool);
       return SVN_NO_ERROR;
     }
 }
@@ -694,7 +705,11 @@ mutable_root_node(dag_node_t **node_p,
                   apr_pool_t *pool)
 {
   if (root->is_txn_root)
-    return svn_fs_fs__dag_clone_root(node_p, root->fs, root->txn, pool);
+    {
+      /* It's a transaction root.  Open a fresh copy.  */
+      return svn_fs_fs__dag_clone_root(node_p, root->fs, root_txn_id(root),
+                                       pool);
+    }
   else
     /* If it's not a transaction root, we can't change its contents.  */
     return SVN_FS__ERR_NOT_MUTABLE(root->fs, root->rev, error_path);
@@ -782,25 +797,23 @@ parent_path_relpath(parent_path_t *child
    the inheritance method is copy_id_inherit_new, also return a
    *COPY_SRC_PATH on which to base the new copy ID (else return NULL
    for that path).  CHILD must have a parent (it cannot be the root
-   node).  TXN_ID is the transaction in which these items might be
-   mutable.  Allocations are taken from POOL. */
+   node).  Allocations are taken from POOL. */
 static svn_error_t *
 get_copy_inheritance(copy_id_inherit_t *inherit_p,
                      const char **copy_src_path,
                      svn_fs_t *fs,
                      parent_path_t *child,
-                     const char *txn_id,
                      apr_pool_t *pool)
 {
   const svn_fs_id_t *child_id, *parent_id, *copyroot_id;
-  const char *child_copy_id, *parent_copy_id;
+  const svn_fs_fs__id_part_t *child_copy_id, *parent_copy_id;
   const char *id_path = NULL;
   svn_fs_root_t *copyroot_root;
   dag_node_t *copyroot_node;
   svn_revnum_t copyroot_rev;
   const char *copyroot_path;
 
-  SVN_ERR_ASSERT(child && child->parent && txn_id);
+  SVN_ERR_ASSERT(child && child->parent);
 
   /* Initialize some convenience variables. */
   child_id = svn_fs_fs__dag_get_id(child->node);
@@ -809,7 +822,7 @@ get_copy_inheritance(copy_id_inherit_t *
   parent_copy_id = svn_fs_fs__id_copy_id(parent_id);
 
   /* If this child is already mutable, we have nothing to do. */
-  if (svn_fs_fs__id_txn_id(child_id))
+  if (svn_fs_fs__id_is_txn(child_id))
     {
       *inherit_p = copy_id_inherit_self;
       *copy_src_path = NULL;
@@ -823,14 +836,14 @@ get_copy_inheritance(copy_id_inherit_t *
 
   /* Special case: if the child's copy ID is '0', use the parent's
      copy ID. */
-  if (strcmp(child_copy_id, "0") == 0)
+  if (svn_fs_fs__id_part_is_root(child_copy_id))
     return SVN_NO_ERROR;
 
   /* Compare the copy IDs of the child and its parent.  If they are
      the same, then the child is already on the same branch as the
      parent, and should use the same mutability copy ID that the
      parent will use. */
-  if (svn_fs_fs__key_compare(child_copy_id, parent_copy_id) == 0)
+  if (svn_fs_fs__id_part_eq(child_copy_id, parent_copy_id))
     return SVN_NO_ERROR;
 
   /* If the child is on the same branch that the parent is on, the
@@ -910,10 +923,9 @@ typedef enum open_path_flags_t {
    *element, for the root directory.  PATH must be in canonical form.
 
    If resulting *PARENT_PATH_P will eventually be made mutable and
-   modified, or if copy ID inheritance information is otherwise
-   needed, TXN_ID should be the ID of the mutability transaction.  If
-   TXN_ID is NULL, no copy ID inheritance information will be
-   calculated for the *PARENT_PATH_P chain.
+   modified, or if copy ID inheritance information is otherwise needed,
+   IS_TXN_PATH must be set.  If IS_TXN_PATH is FALSE, no copy ID
+   inheritance information will be calculated for the *PARENT_PATH_P chain.
 
    If FLAGS & open_path_last_optional is zero, return the error
    SVN_ERR_FS_NOT_FOUND if the node PATH refers to does not exist.  If
@@ -937,7 +949,7 @@ open_path(parent_path_t **parent_path_p,
           svn_fs_root_t *root,
           const char *path,
           int flags,
-          const char *txn_id,
+          svn_boolean_t is_txn_path,
           apr_pool_t *pool)
 {
   svn_fs_t *fs = root->fs;
@@ -1072,10 +1084,10 @@ open_path(parent_path_t **parent_path_p,
             {
               /* Now, make a parent_path item for CHILD. */
               parent_path = make_parent_path(child, entry, parent_path, pool);
-              if (txn_id)
+              if (is_txn_path)
                 {
                   SVN_ERR(get_copy_inheritance(&inherit, &copy_path, fs,
-                                               parent_path, txn_id, iterpool));
+                                               parent_path, iterpool));
                   parent_path->copy_inherit = inherit;
                   parent_path->copy_src_path = apr_pstrdup(pool, copy_path);
                 }
@@ -1118,7 +1130,7 @@ make_path_mutable(svn_fs_root_t *root,
                   apr_pool_t *pool)
 {
   dag_node_t *clone;
-  const char *txn_id = root->txn;
+  const svn_fs_fs__id_part_t *txn_id = root_txn_id(root);
 
   /* Is the node mutable already?  */
   if (svn_fs_fs__dag_check_mutable(parent_path->node))
@@ -1128,7 +1140,8 @@ make_path_mutable(svn_fs_root_t *root,
   if (parent_path->parent)
     {
       const svn_fs_id_t *parent_id, *child_id, *copyroot_id;
-      const char *copy_id = NULL;
+      svn_fs_fs__id_part_t copy_id = { SVN_INVALID_REVNUM, 0 };
+      svn_fs_fs__id_part_t *copy_id_ptr = &copy_id;
       copy_id_inherit_t inherit = parent_path->copy_inherit;
       const char *clone_path, *copyroot_path;
       svn_revnum_t copyroot_rev;
@@ -1145,7 +1158,7 @@ make_path_mutable(svn_fs_root_t *root,
         {
         case copy_id_inherit_parent:
           parent_id = svn_fs_fs__dag_get_id(parent_path->parent->node);
-          copy_id = svn_fs_fs__id_copy_id(parent_id);
+          copy_id = *svn_fs_fs__id_copy_id(parent_id);
           break;
 
         case copy_id_inherit_new:
@@ -1154,7 +1167,7 @@ make_path_mutable(svn_fs_root_t *root,
           break;
 
         case copy_id_inherit_self:
-          copy_id = NULL;
+          copy_id_ptr = NULL;
           break;
 
         case copy_id_inherit_unknown:
@@ -1173,8 +1186,8 @@ make_path_mutable(svn_fs_root_t *root,
 
       child_id = svn_fs_fs__dag_get_id(parent_path->node);
       copyroot_id = svn_fs_fs__dag_get_id(copyroot_node);
-      if (strcmp(svn_fs_fs__id_node_id(child_id),
-                 svn_fs_fs__id_node_id(copyroot_id)) != 0)
+      if (!svn_fs_fs__id_part_eq(svn_fs_fs__id_node_id(child_id),
+                                 svn_fs_fs__id_node_id(copyroot_id)))
         is_parent_copyroot = TRUE;
 
       /* Now make this node mutable.  */
@@ -1183,7 +1196,7 @@ make_path_mutable(svn_fs_root_t *root,
                                          parent_path->parent->node,
                                          clone_path,
                                          parent_path->entry,
-                                         copy_id, txn_id,
+                                         copy_id_ptr, txn_id,
                                          is_parent_copyroot,
                                          pool));
 
@@ -1228,15 +1241,14 @@ get_dag(dag_node_t **dag_node_p,
 
   if (! node)
     {
-      /* Canonicalize the input PATH. */
-      if (! svn_fs__is_canonical_abspath(path))
-        {
-          path = svn_fs__canonicalize_abspath(path, pool);
-
-          /* Try again with the corrected path. */
-          SVN_ERR(dag_node_cache_get(&node, root, path, needs_lock_cache,
-                                     pool));
-        }
+      /* Canonicalize the input PATH.  As it turns out, >95% of all paths
+       * seen here during e.g. svnadmin verify are non-canonical, i.e.
+       * miss the leading '/'.  Unconditional canonicalization has a net
+       * performance benefit over previously checking path for being
+       * canonical. */
+      path = svn_fs__canonicalize_abspath(path, pool);
+      SVN_ERR(dag_node_cache_get(&node, root, path, needs_lock_cache,
+                                 pool));
 
       if (! node)
         {
@@ -1244,7 +1256,7 @@ get_dag(dag_node_t **dag_node_p,
            * error if the node for which we are searching doesn't exist. */
           SVN_ERR(open_path(&parent_path, root, path,
                             open_path_uncached | open_path_node_only,
-                            NULL, pool));
+                            FALSE, pool));
           node = parent_path->node;
 
           /* No need to cache our find -- open_path() will do that for us. */
@@ -1269,7 +1281,7 @@ get_dag(dag_node_t **dag_node_p,
    be SVN_INVALID_REVNUM.  Do all this as part of POOL.  */
 static svn_error_t *
 add_change(svn_fs_t *fs,
-           const char *txn_id,
+           const svn_fs_fs__id_part_t *txn_id,
            const char *path,
            const svn_fs_id_t *noderev_id,
            svn_fs_path_change_kind_t change_kind,
@@ -1306,8 +1318,8 @@ svn_fs_fs__node_id(const svn_fs_id_t **i
          The root directory ("" or "/") node is stored in the
          svn_fs_root_t object, and never changes when it's a revision
          root, so we can just reach in and grab it directly. */
-      fs_rev_root_data_t *frd = root->fsap_data;
-      *id_p = svn_fs_fs__id_copy(svn_fs_fs__dag_get_id(frd->root_dir), pool);
+      dag_node_t *root_dir = root->fsap_data;
+      *id_p = svn_fs_fs__id_copy(svn_fs_fs__dag_get_id(root_dir), pool);
     }
   else
     {
@@ -1465,14 +1477,14 @@ fs_change_node_prop(svn_fs_root_t *root,
 {
   parent_path_t *parent_path;
   apr_hash_t *proplist;
-  const char *txn_id;
+  const svn_fs_fs__id_part_t *txn_id;
 
   if (! root->is_txn_root)
     return SVN_FS__NOT_TXN(root);
-  txn_id = root->txn;
+  txn_id = root_txn_id(root);
 
   path = svn_fs__canonicalize_abspath(path, pool);
-  SVN_ERR(open_path(&parent_path, root, path, 0, txn_id, pool));
+  SVN_ERR(open_path(&parent_path, root, path, 0, TRUE, pool));
 
   /* Check (non-recursively) to see if path is locked; if so, check
      that we can use it. */
@@ -1607,7 +1619,7 @@ merge(svn_stringbuf_t *conflict_p,
       dag_node_t *target,
       dag_node_t *source,
       dag_node_t *ancestor,
-      const char *txn_id,
+      const svn_fs_fs__id_part_t *txn_id,
       apr_int64_t *mergeinfo_increment_out,
       apr_pool_t *pool)
 {
@@ -1861,14 +1873,14 @@ merge(svn_stringbuf_t *conflict_p,
 
           /* If either SOURCE-ENTRY or TARGET-ENTRY is not a direct
              modification of ANCESTOR-ENTRY, declare a conflict. */
-          if (strcmp(svn_fs_fs__id_node_id(s_entry->id),
-                     svn_fs_fs__id_node_id(a_entry->id)) != 0
-              || strcmp(svn_fs_fs__id_copy_id(s_entry->id),
-                        svn_fs_fs__id_copy_id(a_entry->id)) != 0
-              || strcmp(svn_fs_fs__id_node_id(t_entry->id),
-                        svn_fs_fs__id_node_id(a_entry->id)) != 0
-              || strcmp(svn_fs_fs__id_copy_id(t_entry->id),
-                        svn_fs_fs__id_copy_id(a_entry->id)) != 0)
+          if (!svn_fs_fs__id_part_eq(svn_fs_fs__id_node_id(s_entry->id),
+                                     svn_fs_fs__id_node_id(a_entry->id))
+              || !svn_fs_fs__id_part_eq(svn_fs_fs__id_copy_id(s_entry->id),
+                                        svn_fs_fs__id_copy_id(a_entry->id))
+              || !svn_fs_fs__id_part_eq(svn_fs_fs__id_node_id(t_entry->id),
+                                        svn_fs_fs__id_node_id(a_entry->id))
+              || !svn_fs_fs__id_part_eq(svn_fs_fs__id_copy_id(t_entry->id),
+                                        svn_fs_fs__id_copy_id(a_entry->id)))
             return conflict_err(conflict_p,
                                 svn_fspath__join(target_path,
                                                  a_entry->name,
@@ -1971,8 +1983,8 @@ merge_changes(dag_node_t *ancestor_node,
 {
   dag_node_t *txn_root_node;
   svn_fs_t *fs = txn->fs;
-  const char *txn_id = txn->id;
-
+  const svn_fs_fs__id_part_t *txn_id = svn_fs_fs__txn_get_id(txn);
+  
   SVN_ERR(svn_fs_fs__dag_txn_root(&txn_root_node, fs, txn_id, pool));
 
   if (ancestor_node == NULL)
@@ -2001,6 +2013,7 @@ svn_error_t *
 svn_fs_fs__commit_txn(const char **conflict_p,
                       svn_revnum_t *new_rev,
                       svn_fs_txn_t *txn,
+                      svn_boolean_t set_timestamp,
                       apr_pool_t *pool)
 {
   /* How do commits work in Subversion?
@@ -2097,7 +2110,7 @@ svn_fs_fs__commit_txn(const char **confl
       txn->base_rev = youngish_rev;
 
       /* Try to commit. */
-      err = svn_fs_fs__commit(new_rev, fs, txn, iterpool);
+      err = svn_fs_fs__commit(new_rev, fs, txn, set_timestamp, iterpool);
       if (err && (err->apr_err == SVN_ERR_FS_TXN_OUT_OF_DATE))
         {
           /* Did someone else finish committing a new revision while we
@@ -2229,6 +2242,17 @@ fs_dir_entries(apr_hash_t **table_p,
   return svn_fs_fs__dag_dir_entries(table_p, node, pool);
 }
 
+static svn_error_t *
+fs_dir_optimal_order(apr_array_header_t **ordered_p,
+                     svn_fs_root_t *root,
+                     apr_hash_t *entries,
+                     apr_pool_t *pool)
+{
+  *ordered_p = svn_fs_fs__order_dir_entries(root->fs, entries, pool);
+
+  return SVN_NO_ERROR;
+}
+
 /* Raise an error if PATH contains a newline because FSFS cannot handle
  * such paths. See issue #4340. */
 static svn_error_t *
@@ -2255,13 +2279,13 @@ fs_make_dir(svn_fs_root_t *root,
 {
   parent_path_t *parent_path;
   dag_node_t *sub_dir;
-  const char *txn_id = root->txn;
+  const svn_fs_fs__id_part_t *txn_id = root_txn_id(root);
 
   SVN_ERR(check_newline(path, pool));
 
   path = svn_fs__canonicalize_abspath(path, pool);
   SVN_ERR(open_path(&parent_path, root, path, open_path_last_optional,
-                    txn_id, pool));
+                    TRUE, pool));
 
   /* Check (recursively) to see if some lock is 'reserving' a path at
      that location, or even some child-path; if so, check that we can
@@ -2304,15 +2328,16 @@ fs_delete_node(svn_fs_root_t *root,
                apr_pool_t *pool)
 {
   parent_path_t *parent_path;
-  const char *txn_id = root->txn;
+  const svn_fs_fs__id_part_t *txn_id;
   apr_int64_t mergeinfo_count = 0;
   svn_node_kind_t kind;
 
   if (! root->is_txn_root)
     return SVN_FS__NOT_TXN(root);
 
+  txn_id = root_txn_id(root);
   path = svn_fs__canonicalize_abspath(path, pool);
-  SVN_ERR(open_path(&parent_path, root, path, 0, txn_id, pool));
+  SVN_ERR(open_path(&parent_path, root, path, 0, TRUE, pool));
   kind = svn_fs_fs__dag_node_kind(parent_path->node);
 
   /* We can't remove the root of the filesystem.  */
@@ -2366,20 +2391,94 @@ fs_same_p(svn_boolean_t *same_p,
   return SVN_NO_ERROR;
 }
 
+/* Type to select the various behavioral modes of copy_helper.
+ */
+typedef enum copy_type_t
+{
+  /* add without history */
+  copy_type_plain_add,
+
+  /* add with history */
+  copy_type_add_with_history,
+
+  /* move (always with history) */
+  copy_type_move
+} copy_type_t;
+
+/* Set CHANGES to TRUE if PATH in ROOT is unchanged in REVISION if the
+   same files system.  If the content is identical, parent path copies and
+   deletions still count as changes.  Use POOL for temporary allocations.
+   Not that we will return an error if PATH does not exist in ROOT or
+   REVISION- */
+static svn_error_t *
+is_changed_node(svn_boolean_t *changed,
+                svn_fs_root_t *root,
+                const char *path,
+                svn_revnum_t revision,
+                apr_pool_t *pool)
+{
+  dag_node_t *node, *rev_node;
+  svn_fs_root_t *rev_root;
+  svn_fs_root_t *copy_from_root1, *copy_from_root2;
+  const char *copy_from_path1, *copy_from_path2;
+
+  SVN_ERR(svn_fs_fs__revision_root(&rev_root, root->fs, revision, pool));
+
+  /* Get the NODE for FROM_PATH in FROM_ROOT.*/
+  SVN_ERR(get_dag(&node, root, path, TRUE, pool));
+  SVN_ERR(get_dag(&rev_node, rev_root, path, TRUE, pool));
+
+  /* different ID -> got changed */
+  if (!svn_fs_fs__id_eq(svn_fs_fs__dag_get_id(node),
+                        svn_fs_fs__dag_get_id(rev_node)))
+    {
+      *changed = TRUE;
+       return SVN_NO_ERROR;
+    }
+
+  /* same node. might still be a lazy copy with separate history */
+  SVN_ERR(fs_closest_copy(&copy_from_root1, &copy_from_path1, root,
+                          path, pool));
+  SVN_ERR(fs_closest_copy(&copy_from_root2, &copy_from_path2, rev_root,
+                          path, pool));
+
+  if (copy_from_root1 == NULL && copy_from_root2 == NULL)
+    {
+      /* never copied -> same line of history */
+      *changed = FALSE;
+    }
+  else if (copy_from_root1 != NULL && copy_from_root2 != NULL)
+    {
+      /* both got copied. At the same time & location? */
+      *changed = (copy_from_root1->rev != copy_from_root2->rev)
+                 || strcmp(copy_from_path1, copy_from_path2);
+    }
+  else
+    {
+      /* one is a copy while the other one is not
+       * -> different lines of history */
+      *changed = TRUE;
+    }
+
+  return SVN_NO_ERROR;
+}
+
+
 /* Copy the node at FROM_PATH under FROM_ROOT to TO_PATH under
-   TO_ROOT.  If PRESERVE_HISTORY is set, then the copy is recorded in
-   the copies table.  Perform temporary allocations in POOL. */
+   TO_ROOT.  COPY_TYPE determines whether then the copy is recorded in
+   the copies table and whether it is being marked as a move.
+   Perform temporary allocations in POOL. */
 static svn_error_t *
 copy_helper(svn_fs_root_t *from_root,
             const char *from_path,
             svn_fs_root_t *to_root,
             const char *to_path,
-            svn_boolean_t preserve_history,
+            copy_type_t copy_type,
             apr_pool_t *pool)
 {
   dag_node_t *from_node;
   parent_path_t *to_parent_path;
-  const char *txn_id = to_root->txn;
+  const svn_fs_fs__id_part_t *txn_id = root_txn_id(to_root);
   svn_boolean_t same_p;
 
   /* Use an error check, not an assert, because even the caller cannot
@@ -2391,11 +2490,52 @@ copy_helper(svn_fs_root_t *from_root,
        _("Cannot copy between two different filesystems ('%s' and '%s')"),
        from_root->fs->path, to_root->fs->path);
 
+  /* more things that we can't do ATM */
   if (from_root->is_txn_root)
     return svn_error_create
       (SVN_ERR_UNSUPPORTED_FEATURE, NULL,
        _("Copy from mutable tree not currently supported"));
 
+  if (! to_root->is_txn_root)
+    return svn_error_create
+      (SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+       _("Copy immutable tree not supported"));
+
+  /* move support comes with a number of conditions ... */
+  if (copy_type == copy_type_move)
+    {
+      /* if we don't copy from the TXN's base rev, check that the path has
+         not been touched in that revision range */
+      if (from_root->rev != txn_id->revision)
+        {
+          svn_boolean_t changed = TRUE;
+          svn_error_t *err = is_changed_node(&changed, from_root,
+                                             from_path, txn_id->revision,
+                                             pool);
+
+          /* Only "not found" is considered to be caused by out-of-date-ness.
+             Everything else means something got very wrong ... */
+          if (err && err->apr_err != SVN_ERR_FS_NOT_FOUND)
+            return svn_error_trace(err);
+
+          /* here error means "out of data" */
+          if (err || changed)
+            {
+              svn_error_clear(err);
+              return svn_error_create(SVN_ERR_FS_OUT_OF_DATE, NULL,
+                                      _("Move-from node is out-of-date"));
+            }
+
+          /* always move from the txn's base rev */
+          SVN_ERR(svn_fs_fs__revision_root(&from_root, from_root->fs,
+                                           txn_id->revision, pool));
+        }
+
+      /* does the FS support moves at all? */
+      if (!svn_fs_fs__supports_move(to_root->fs))
+        copy_type = copy_type_add_with_history;
+    }
+
   /* Get the NODE for FROM_PATH in FROM_ROOT.*/
   SVN_ERR(get_dag(&from_node, from_root, from_path, TRUE, pool));
 
@@ -2403,7 +2543,7 @@ copy_helper(svn_fs_root_t *from_root,
      component does not exist, it's not that big a deal.  We'll just
      make one there. */
   SVN_ERR(open_path(&to_parent_path, to_root, to_path,
-                    open_path_last_optional, txn_id, pool));
+                    open_path_last_optional, TRUE, pool));
 
   /* Check to see if path (or any child thereof) is locked; if so,
      check that we can use the existing lock(s). */
@@ -2432,14 +2572,20 @@ copy_helper(svn_fs_root_t *from_root,
          operation is a replacement, not an addition. */
       if (to_parent_path->node)
         {
-          kind = svn_fs_path_change_replace;
+          kind = copy_type == copy_type_move
+               ? svn_fs_path_change_movereplace
+               : svn_fs_path_change_replace;
+
           if (svn_fs_fs__fs_supports_mergeinfo(to_root->fs))
             SVN_ERR(svn_fs_fs__dag_get_mergeinfo_count(&mergeinfo_start,
                                                        to_parent_path->node));
         }
       else
         {
-          kind = svn_fs_path_change_add;
+          kind = copy_type == copy_type_move
+               ? svn_fs_path_change_move
+               : svn_fs_path_change_add;
+
           mergeinfo_start = 0;
         }
 
@@ -2457,12 +2603,12 @@ copy_helper(svn_fs_root_t *from_root,
       SVN_ERR(svn_fs_fs__dag_copy(to_parent_path->parent->node,
                                   to_parent_path->entry,
                                   from_node,
-                                  preserve_history,
+                                  copy_type != copy_type_plain_add,
                                   from_root->rev,
                                   from_canonpath,
                                   txn_id, pool));
 
-      if (kind == svn_fs_path_change_replace)
+      if (kind != svn_fs_path_change_add)
         SVN_ERR(dag_node_cache_invalidate(to_root,
                                           parent_path_path(to_parent_path,
                                                            pool), pool));
@@ -2519,7 +2665,7 @@ fs_copy(svn_fs_root_t *from_root,
                                      to_root,
                                      svn_fs__canonicalize_abspath(to_path,
                                                                   pool),
-                                     TRUE, pool));
+                                     copy_type_add_with_history, pool));
 }
 
 
@@ -2537,7 +2683,29 @@ fs_revision_link(svn_fs_root_t *from_roo
 
   path = svn_fs__canonicalize_abspath(path, pool);
   return svn_error_trace(copy_helper(from_root, path, to_root, path,
-                                     FALSE, pool));
+                                     copy_type_plain_add, pool));
+}
+
+
+/* Create a copy of FROM_PATH in FROM_ROOT named TO_PATH in TO_ROOT and mark
+   it as a Move.  If FROM_PATH is a directory, copy it recursively. 
+   Temporary allocations are from POOL.*/
+static svn_error_t *
+fs_move(svn_fs_root_t *from_root,
+        const char *from_path,
+        svn_fs_root_t *to_root,
+        const char *to_path,
+        apr_pool_t *pool)
+{
+  SVN_ERR(check_newline(to_path, pool));
+
+  return svn_error_trace(copy_helper(from_root,
+                                     svn_fs__canonicalize_abspath(from_path,
+                                                                  pool),
+                                     to_root,
+                                     svn_fs__canonicalize_abspath(to_path,
+                                                                  pool),
+                                     copy_type_move, pool));
 }
 
 
@@ -2552,46 +2720,12 @@ fs_copied_from(svn_revnum_t *rev_p,
                apr_pool_t *pool)
 {
   dag_node_t *node;
-  const char *copyfrom_path, *copyfrom_str = NULL;
-  svn_revnum_t copyfrom_rev;
-  char *str, *buf;
-
-  /* Check to see if there is a cached version of this copyfrom
-     entry. */
-  if (! root->is_txn_root) {
-    fs_rev_root_data_t *frd = root->fsap_data;
-    copyfrom_str = svn_hash_gets(frd->copyfrom_cache, path);
-  }
-
-  if (copyfrom_str)
-    {
-      if (*copyfrom_str == 0)
-        {
-          /* We have a cached entry that says there is no copyfrom
-             here. */
-          copyfrom_rev = SVN_INVALID_REVNUM;
-          copyfrom_path = NULL;
-        }
-      else
-        {
-          /* Parse the copyfrom string for our cached entry. */
-          buf = apr_pstrdup(pool, copyfrom_str);
-          str = svn_cstring_tokenize(" ", &buf);
-          copyfrom_rev = SVN_STR_TO_REV(str);
-          copyfrom_path = buf;
-        }
-    }
-  else
-    {
-      /* There is no cached entry, look it up the old-fashioned
-         way. */
-      SVN_ERR(get_dag(&node, root, path, TRUE, pool));
-      SVN_ERR(svn_fs_fs__dag_get_copyfrom_rev(&copyfrom_rev, node));
-      SVN_ERR(svn_fs_fs__dag_get_copyfrom_path(&copyfrom_path, node));
-    }
 
-  *rev_p  = copyfrom_rev;
-  *path_p = copyfrom_path;
+  /* There is no cached entry, look it up the old-fashioned
+      way. */
+  SVN_ERR(get_dag(&node, root, path, TRUE, pool));
+  SVN_ERR(svn_fs_fs__dag_get_copyfrom_rev(rev_p, node));
+  SVN_ERR(svn_fs_fs__dag_get_copyfrom_path(path_p, node));
 
   return SVN_NO_ERROR;
 }
@@ -2609,13 +2743,13 @@ fs_make_file(svn_fs_root_t *root,
 {
   parent_path_t *parent_path;
   dag_node_t *child;
-  const char *txn_id = root->txn;
+  const svn_fs_fs__id_part_t *txn_id = root_txn_id(root);
 
   SVN_ERR(check_newline(path, pool));
 
   path = svn_fs__canonicalize_abspath(path, pool);
   SVN_ERR(open_path(&parent_path, root, path, open_path_last_optional,
-                   txn_id, pool));
+                    TRUE, pool));
 
   /* If there's already a file by that name, complain.
      This also catches the case of trying to make a file named `/'.  */
@@ -2845,11 +2979,11 @@ apply_textdelta(void *baton, apr_pool_t 
 {
   txdelta_baton_t *tb = (txdelta_baton_t *) baton;
   parent_path_t *parent_path;
-  const char *txn_id = tb->root->txn;
+  const svn_fs_fs__id_part_t *txn_id = root_txn_id(tb->root);
 
   /* Call open_path with no flags, as we want this to return an error
      if the node for which we are searching doesn't exist. */
-  SVN_ERR(open_path(&parent_path, tb->root, tb->path, 0, txn_id, pool));
+  SVN_ERR(open_path(&parent_path, tb->root, tb->path, 0, TRUE, pool));
 
   /* Check (non-recursively) to see if path is locked; if so, check
      that we can use it. */
@@ -3010,11 +3144,11 @@ apply_text(void *baton, apr_pool_t *pool
 {
   struct text_baton_t *tb = baton;
   parent_path_t *parent_path;
-  const char *txn_id = tb->root->txn;
+  const svn_fs_fs__id_part_t *txn_id = root_txn_id(tb->root);
 
   /* Call open_path with no flags, as we want this to return an error
      if the node for which we are searching doesn't exist. */
-  SVN_ERR(open_path(&parent_path, tb->root, tb->path, 0, txn_id, pool));
+  SVN_ERR(open_path(&parent_path, tb->root, tb->path, 0, TRUE, pool));
 
   /* Check (non-recursively) to see if path is locked; if so, check
      that we can use it. */
@@ -3148,14 +3282,11 @@ fs_paths_changed(apr_hash_t **changed_pa
                  apr_pool_t *pool)
 {
   if (root->is_txn_root)
-    return svn_fs_fs__txn_changes_fetch(changed_paths_p, root->fs, root->txn,
-                                        pool);
+    return svn_fs_fs__txn_changes_fetch(changed_paths_p, root->fs,
+                                        root_txn_id(root), pool);
   else
-    {
-      fs_rev_root_data_t *frd = root->fsap_data;
-      return svn_fs_fs__paths_changed(changed_paths_p, root->fs, root->rev,
-                                      frd->copyfrom_cache, pool);
-    }
+    return svn_fs_fs__paths_changed(changed_paths_p, root->fs, root->rev,
+                                    pool);
 }
 
 
@@ -3277,7 +3408,7 @@ static svn_error_t *fs_closest_copy(svn_
   *path_p = NULL;
 
   path = svn_fs__canonicalize_abspath(path, pool);
-  SVN_ERR(open_path(&parent_path, root, path, 0, NULL, pool));
+  SVN_ERR(open_path(&parent_path, root, path, 0, FALSE, pool));
 
   /* Find the youngest copyroot in the path of this node-rev, which
      will indicate the target of the innermost copy affecting the
@@ -3295,7 +3426,7 @@ static svn_error_t *fs_closest_copy(svn_
   if (kind == svn_node_none)
     return SVN_NO_ERROR;
   SVN_ERR(open_path(&copy_dst_parent_path, copy_dst_root, path,
-                    open_path_node_only, NULL, pool));
+                    open_path_node_only, FALSE, pool));
   copy_dst_node = copy_dst_parent_path->node;
   if (! svn_fs_fs__id_check_related(svn_fs_fs__dag_get_id(copy_dst_node),
                                     svn_fs_fs__dag_get_id(parent_path->node)))
@@ -3391,7 +3522,7 @@ fs_node_origin_rev(svn_revnum_t *revisio
 {
   svn_fs_t *fs = root->fs;
   const svn_fs_id_t *given_noderev_id, *cached_origin_id;
-  const char *node_id, *dash;
+  const svn_fs_fs__id_part_t *node_id;
 
   path = svn_fs__canonicalize_abspath(path, pool);
 
@@ -3399,27 +3530,13 @@ fs_node_origin_rev(svn_revnum_t *revisio
   SVN_ERR(svn_fs_fs__node_id(&given_noderev_id, root, path, pool));
   node_id = svn_fs_fs__id_node_id(given_noderev_id);
 
-  /* Is it a brand new uncommitted node? */
-  if (node_id[0] == '_')
-    {
-      *revision = SVN_INVALID_REVNUM;
-      return SVN_NO_ERROR;
-    }
-
-  /* Maybe this is a new-style node ID that just has the revision
-     sitting right in it. */
-  dash = strchr(node_id, '-');
-  if (dash && *(dash+1))
+  /* Is it a brand new uncommitted node or a new-style node ID?
+   * (committed old-style nodes will have a 0 revision value;
+   * rev 0, number 0 is rev 0 root node). Note that != 0 includes
+   * SVN_INVALID_REVNUM for uncommitted nodes. */
+  if (node_id->revision != 0 || node_id->number == 0)
     {
-      *revision = SVN_STR_TO_REV(dash + 1);
-      return SVN_NO_ERROR;
-    }
-
-  /* The root node always has ID 0, created in revision 0 and will never
-     use the new-style ID format. */
-  if (strcmp(node_id, "0") == 0)
-    {
-      *revision = 0;
+      *revision = node_id->revision;
       return SVN_NO_ERROR;
     }
 
@@ -3499,7 +3616,7 @@ fs_node_origin_rev(svn_revnum_t *revisio
 
     /* Wow, I don't want to have to do all that again.  Let's cache
        the result. */
-    if (node_id[0] != '_')
+    if (node_id->revision != SVN_INVALID_REVNUM)
       SVN_ERR(svn_fs_fs__set_node_origin(fs, node_id,
                                          svn_fs_fs__dag_get_id(node), pool));
 
@@ -3550,7 +3667,7 @@ history_prev(svn_fs_history_t **prev_his
 
   /* Open PATH/REVISION, and get its node and a bunch of other
      goodies.  */
-  SVN_ERR(open_path(&parent_path, root, path, 0, NULL, scratch_pool));
+  SVN_ERR(open_path(&parent_path, root, path, 0, FALSE, scratch_pool));
   node = parent_path->node;
   commit_path = svn_fs_fs__dag_get_created_path(node);
   SVN_ERR(svn_fs_fs__dag_get_revision(&commit_rev, node, scratch_pool));
@@ -3900,7 +4017,7 @@ get_mergeinfo_for_path_internal(svn_merg
 
   path = svn_fs__canonicalize_abspath(path, scratch_pool);
 
-  SVN_ERR(open_path(&parent_path, rev_root, path, 0, NULL, scratch_pool));
+  SVN_ERR(open_path(&parent_path, rev_root, path, 0, FALSE, scratch_pool));
 
   if (inherit == svn_mergeinfo_nearest_ancestor && ! parent_path->parent)
     return SVN_NO_ERROR;
@@ -4163,6 +4280,9 @@ static root_vtable_t root_vtable = {
   fs_node_origin_rev,
   fs_node_created_path,
   fs_delete_node,
+  fs_copy,
+  fs_revision_link,
+  fs_move,
   fs_copied_from,
   fs_closest_copy,
   fs_node_prop,
@@ -4170,9 +4290,8 @@ static root_vtable_t root_vtable = {
   fs_change_node_prop,
   fs_props_changed,
   fs_dir_entries,
+  fs_dir_optimal_order,
   fs_make_dir,
-  fs_copy,
-  fs_revision_link,
   fs_file_length,
   fs_file_checksum,
   fs_file_contents,
@@ -4210,15 +4329,10 @@ make_revision_root(svn_fs_t *fs,
                    apr_pool_t *pool)
 {
   svn_fs_root_t *root = make_root(fs, pool);
-  fs_rev_root_data_t *frd = apr_pcalloc(root->pool, sizeof(*frd));
 
   root->is_txn_root = FALSE;
   root->rev = rev;
-
-  frd->root_dir = root_dir;
-  frd->copyfrom_cache = svn_hash__make(root->pool);
-
-  root->fsap_data = frd;
+  root->fsap_data = root_dir;
 
   return root;
 }
@@ -4230,21 +4344,20 @@ make_revision_root(svn_fs_t *fs,
 static svn_error_t *
 make_txn_root(svn_fs_root_t **root_p,
               svn_fs_t *fs,
-              const char *txn,
+              const svn_fs_fs__id_part_t *txn,
               svn_revnum_t base_rev,
               apr_uint32_t flags,
               apr_pool_t *pool)
 {
   svn_fs_root_t *root = make_root(fs, pool);
   fs_txn_root_data_t *frd = apr_pcalloc(root->pool, sizeof(*frd));
+  frd->txn_id = *txn;
 
   root->is_txn_root = TRUE;
-  root->txn = apr_pstrdup(root->pool, txn);
+  root->txn = svn_fs_fs__id_txn_unparse(txn, root->pool);
   root->txn_flags = flags;
   root->rev = base_rev;
 
-  frd->txn_id = txn;
-
   /* Because this cache actually tries to invalidate elements, keep
      the number of elements per page down.
 
@@ -4256,14 +4369,14 @@ make_txn_root(svn_fs_root_t **root_p,
                                       APR_HASH_KEY_STRING,
                                       32, 20, FALSE,
                                       apr_pstrcat(pool, txn, ":TXN",
-                                                  (char *)NULL),
+                                                  SVN_VA_NULL),
                                       root->pool));
 
   /* Initialize transaction-local caches in FS.
 
      Note that we cannot put those caches in frd because that content
      fs root object is not available where we would need it. */
-  SVN_ERR(svn_fs_fs__initialize_txn_caches(fs, txn, pool));
+  SVN_ERR(svn_fs_fs__initialize_txn_caches(fs, root->txn, pool));
 
   root->fsap_data = frd;
 
@@ -4360,19 +4473,28 @@ verify_node(dag_node_t *node,
         {
           svn_fs_dirent_t *dirent = svn__apr_hash_index_val(hi);
           dag_node_t *child;
-          svn_revnum_t child_rev;
           apr_int64_t child_mergeinfo;
 
           svn_pool_clear(iterpool);
 
           /* Compute CHILD_REV. */
-          SVN_ERR(svn_fs_fs__dag_get_node(&child, fs, dirent->id, iterpool));
-          SVN_ERR(svn_fs_fs__dag_get_revision(&child_rev, child, iterpool));
-
-          if (child_rev == rev)
-            SVN_ERR(verify_node(child, rev, iterpool));
+          if (svn_fs_fs__id_rev(dirent->id) == rev)
+            {
+              SVN_ERR(svn_fs_fs__dag_get_node(&child, fs, dirent->id,
+                                              iterpool));
+              SVN_ERR(verify_node(child, rev, iterpool));
+              SVN_ERR(svn_fs_fs__dag_get_mergeinfo_count(&child_mergeinfo,
+                                                         child));
+            }
+          else
+            {
+              /* access mergeinfo counter with minimal overhead */
+              node_revision_t *noderev;
+              SVN_ERR(svn_fs_fs__get_node_revision(&noderev, fs, dirent->id,
+                                                   iterpool));
+              child_mergeinfo = noderev->mergeinfo_count;
+            }
 
-          SVN_ERR(svn_fs_fs__dag_get_mergeinfo_count(&child_mergeinfo, child));
           children_mergeinfo += child_mergeinfo;
         }
 
@@ -4412,12 +4534,11 @@ svn_fs_fs__verify_root(svn_fs_root_t *ro
   if (root->is_txn_root)
     {
       fs_txn_root_data_t *frd = root->fsap_data;
-      SVN_ERR(svn_fs_fs__dag_txn_root(&root_dir, fs, frd->txn_id, pool));
+      SVN_ERR(svn_fs_fs__dag_txn_root(&root_dir, fs, &frd->txn_id, pool));
     }
   else
     {
-      fs_rev_root_data_t *frd = root->fsap_data;
-      root_dir = frd->root_dir;
+      root_dir = root->fsap_data;
     }
 
   /* Recursively verify ROOT_DIR. */

Modified: subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.h?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.h (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.h Wed Nov 27 11:52:35 2013
@@ -48,10 +48,12 @@ svn_error_t *svn_fs_fs__deltify(svn_fs_t
 /* Commit the transaction TXN as a new revision.  Return the new
    revision in *NEW_REV.  If the transaction conflicts with other
    changes return SVN_ERR_FS_CONFLICT and set *CONFLICT_P to a string
-   that details the cause of the conflict.  Perform temporary
-   allocations in POOL. */
+   that details the cause of the conflict.
+   Update commit time to ensure that svn:date revprops remain ordered if
+   SET_TIMESTAMP is non-zero. Perform temporary allocations in POOL. */
 svn_error_t *svn_fs_fs__commit_txn(const char **conflict_p,
                                    svn_revnum_t *new_rev, svn_fs_txn_t *txn,
+                                   svn_boolean_t set_timestamp,
                                    apr_pool_t *pool);
 
 /* Set ROOT_P to the root directory of transaction TXN.  Allocate the

Modified: subversion/branches/verify-keep-going/subversion/libsvn_fs_util/fs-util.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_fs_util/fs-util.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_fs_util/fs-util.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_fs_util/fs-util.c Wed Nov 27 11:52:35 2013
@@ -26,11 +26,11 @@
 #include <apr_pools.h>
 #include <apr_strings.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_fs.h"
 #include "svn_dirent_uri.h"
 #include "svn_path.h"
-#include "svn_private_config.h"
 
 #include "private/svn_fs_util.h"
 #include "private/svn_fspath.h"

Propchange: subversion/branches/verify-keep-going/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Nov 27 11:52:35 2013
@@ -0,0 +1,11 @@
+Debug
+Release
+*.lo
+*.la
+.libs
+*.la-a
+*.o
+*~
+.*~
+rep-cache-db.h
+revprops-db.h

Propchange: subversion/branches/verify-keep-going/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Nov 27 11:52:35 2013
@@ -0,0 +1,81 @@
+/subversion/branches/1.5.x-r30215/subversion/libsvn_fs_x:870312
+/subversion/branches/1.7.x-fs-verify/subversion/libsvn_fs_x:1146708,1161180
+/subversion/branches/10Gb/subversion/libsvn_fs_x:1388102,1388163-1388190,1388195,1388202,1388205,1388211,1388276,1388362,1388375,1388394,1388636,1388639-1388640,1388643-1388644,1388654,1388720,1388789,1388795,1388801,1388805,1388807,1388810,1388816,1389044,1389276,1389289,1389662,1389867,1390017,1390209,1390216,1390407,1390409,1390414,1390419,1390955
+/subversion/branches/atomic-revprop/subversion/libsvn_fs_x:965046-1000689
+/subversion/branches/auto-props-sdc/subversion/libsvn_fs_x:1384106-1401643
+/subversion/branches/bdb-reverse-deltas/subversion/libsvn_fs_x:872050-872529
+/subversion/branches/cache-server/subversion/libsvn_fs_x:1458643-1476567
+/subversion/branches/diff-callbacks3/subversion/libsvn_fs_x:870059-870761
+/subversion/branches/diff-optimizations/subversion/libsvn_fs_x:1031270-1037352
+/subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_x:1037353-1067789
+/subversion/branches/dont-save-plaintext-passwords-by-default/subversion/libsvn_fs_x:870728-871118
+/subversion/branches/double-delete/subversion/libsvn_fs_x:870511-872970
+/subversion/branches/ev2-export/subversion/libsvn_fs_x:1325914,1332738,1413107
+/subversion/branches/explore-wc/subversion/libsvn_fs_x:875486,875493,875497,875507,875511,875514,875559,875580-875581,875584,875587,875611,875627,875647,875667-875668,875711-875712,875733-875734,875736,875744-875748,875751,875758,875782,875795-875796,875830,875836,875838,875842,875852,875855,875864,875870,875873,875880,875885-875888,875890,875897-875898,875905,875907-875909,875935,875943-875944,875946,875979,875982-875983,875985-875986,875990,875997
+/subversion/branches/file-externals/subversion/libsvn_fs_x:871779-873302
+/subversion/branches/fs-rep-sharing/subversion/libsvn_fs_x:869036-873803
+/subversion/branches/fsfs-format7/subversion/libsvn_fs_x:1426304,1430673,1433848,1438408,1438982,1441129,1442051,1442068,1442504,1442910,1443171,1443803,1444690,1444693,1444695,1445040,1445080,1446103,1451129,1453590,1454307,1460579,1461851,1461865,1462837,1462904,1463120,1467362,1467382,1469487,1471208,1477166,1478055,1481447,1489817,1489949,1490673-1490674,1491784,1493042,1498029,1498103,1498155,1500054,1507729-1507731,1507735-1507736
+/subversion/branches/fsfs-improvements/subversion/libsvn_fs_x:1499981-1517476
+/subversion/branches/fsfs-pack/subversion/libsvn_fs_x:873717-874575
+/subversion/branches/fsx/subversion/libsvn_fs_x:1507845-1509914
+/subversion/branches/gnome-keyring/subversion/libsvn_fs_x:870558-871410
+/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_x:1005036-1150766
+/subversion/branches/gtest_addition/subversion/libsvn_fs_x:1452117-1502138
+/subversion/branches/http-protocol-v2/subversion/libsvn_fs_x:874395-876041
+/subversion/branches/in-memory-cache/subversion/libsvn_fs_x:869829-871452
+/subversion/branches/in-repo-authz/subversion/libsvn_fs_x:1414342-1424779
+/subversion/branches/inheritable-props/subversion/libsvn_fs_x:1297080-1395089
+/subversion/branches/integrate-cache-item-serialization/subversion/libsvn_fs_x:1068724-1068739
+/subversion/branches/integrate-cache-membuffer/subversion/libsvn_fs_x:998649-998852
+/subversion/branches/integrate-compression-level/subversion/libsvn_fs_x:1068651-1072287
+/subversion/branches/integrate-io-improvements/subversion/libsvn_fs_x:1068684-1072297
+/subversion/branches/integrate-is-cachable/subversion/libsvn_fs_x:1072568-1074082
+/subversion/branches/integrate-partial-getter/subversion/libsvn_fs_x:1072558-1076552
+/subversion/branches/integrate-readline-speedup/subversion/libsvn_fs_x:1072553-1072555
+/subversion/branches/integrate-stream-api-extensions/subversion/libsvn_fs_x:1068695-1072516
+/subversion/branches/integrate-string-improvements/subversion/libsvn_fs_x:1068251-1190617
+/subversion/branches/integrate-txdelta-caching/subversion/libsvn_fs_x:1072541-1078213
+/subversion/branches/issue-2779-dev/subversion/libsvn_fs_x:965496-984198
+/subversion/branches/issue-2843-dev/subversion/libsvn_fs_x:871432-874179
+/subversion/branches/issue-3000/subversion/libsvn_fs_x:871713,871716-871719,871721-871726,871728,871734
+/subversion/branches/issue-3067-deleted-subtrees/subversion/libsvn_fs_x:873375-874084
+/subversion/branches/issue-3148-dev/subversion/libsvn_fs_x:875193-875204
+/subversion/branches/issue-3220-dev/subversion/libsvn_fs_x:872210-872226
+/subversion/branches/issue-3242-dev/subversion/libsvn_fs_x:879653-896436
+/subversion/branches/issue-3334-dirs/subversion/libsvn_fs_x:875156-875867
+/subversion/branches/issue-3975/subversion/libsvn_fs_x:1152931-1160746
+/subversion/branches/issue-4116-dev/subversion/libsvn_fs_x:1424719-1425040
+/subversion/branches/issue-4194-dev/subversion/libsvn_fs_x:1410507-1414880
+/subversion/branches/javahl-ra/subversion/libsvn_fs_x:991978-1494640
+/subversion/branches/kwallet/subversion/libsvn_fs_x:870785-871314
+/subversion/branches/log-g-performance/subversion/libsvn_fs_x:870941-871032
+/subversion/branches/merge-skips-obstructions/subversion/libsvn_fs_x:874525-874615
+/subversion/branches/multi-layer-moves/subversion/libsvn_fs_x:1239019-1300930
+/subversion/branches/nfc-nfd-aware-client/subversion/libsvn_fs_x:870276,870376
+/subversion/branches/node_pool/subversion/libsvn_fs_x:1304828-1305388
+/subversion/branches/performance/subversion/libsvn_fs_x:979193,980118,981087,981090,981189,981194,981287,981684,981827,982043,982355,983398,983406,983430,983474,983488,983490,983760,983764,983766,983770,984927,984973,984984,985014,985037,985046,985472,985477,985482,985487-985488,985493,985497,985500,985514,985601,985603,985606,985669,985673,985695,985697,986453,986465,986485,986491-986492,986517,986521,986605,986608,986817,986832,987865,987868-987869,987872,987886-987888,987893,988319,988898,990330,990533,990535-990537,990541,990568,990572,990574-990575,990600,990759,992899,992904,992911,993127,993141,994956,995478,995507,995603,998012,998858,999098,1001413,1001417,1004291,1022668,1022670,1022676,1022715,1022719,1025660,1025672,1027193,1027203,1027206,1027214,1027227,1028077,1028092,1028094,1028104,1028107,1028111,1028354,1029038,1029042-1029043,1029054-1029055,1029062-1029063,1029078,1029080,1029090,1029092-1029093,1029111,1029151,1029158,1029229-1029230,1029232,1029335-1029336,102
 9339-1029340,1029342,1029344,1030763,1030827,1031203,1031235,1032285,1032333,1033040,1033057,1033294,1035869,1035882,1039511,1043705,1053735,1056015,1066452,1067683,1067697-1078365
+/subversion/branches/py-tests-as-modules/subversion/libsvn_fs_x:956579-1033052
+/subversion/branches/ra_serf-digest-authn/subversion/libsvn_fs_x:875693-876404
+/subversion/branches/reintegrate-improvements/subversion/libsvn_fs_x:873853-874164
+/subversion/branches/revprop-cache/subversion/libsvn_fs_x:1298521-1326293
+/subversion/branches/revprop-packing/subversion/libsvn_fs_x:1143907,1143971,1143997,1144017,1144499,1144568,1146145
+/subversion/branches/subtree-mergeinfo/subversion/libsvn_fs_x:876734-878766
+/subversion/branches/svn-mergeinfo-enhancements/subversion/libsvn_fs_x:870119-870195,870197-870288
+/subversion/branches/svn-patch-improvements/subversion/libsvn_fs_x:918519-934609
+/subversion/branches/svn_mutex/subversion/libsvn_fs_x:1141683-1182099
+/subversion/branches/svnpatch-diff/subversion/libsvn_fs_x:865738-876477
+/subversion/branches/svnraisetc/subversion/libsvn_fs_x:874709-875149
+/subversion/branches/svnserve-logging/subversion/libsvn_fs_x:869828-870893
+/subversion/branches/tc-issue-3334/subversion/libsvn_fs_x:874697-874773
+/subversion/branches/tc-merge-notify/subversion/libsvn_fs_x:874017-874062
+/subversion/branches/tc-resolve/subversion/libsvn_fs_x:874191-874239
+/subversion/branches/tc_url_rev/subversion/libsvn_fs_x:874351-874483
+/subversion/branches/tree-conflicts/subversion/libsvn_fs_x:868291-873154
+/subversion/branches/tree-conflicts-notify/subversion/libsvn_fs_x:873926-874008
+/subversion/branches/tristate-chunked-request/subversion/libsvn_fs_x:1502394-1502681
+/subversion/branches/tweak-build-take-two/subversion/libsvn_fs_x:1424288-1425049,1425051-1425613
+/subversion/branches/uris-as-urls/subversion/libsvn_fs_x:1060426-1064427
+/subversion/branches/verify-at-commit/subversion/libsvn_fs_x:1462039-1462408
+/subversion/branches/verify-keep-going/subversion/libsvn_fs_x:1439280-1492639
+/subversion/branches/wc-collate-path/subversion/libsvn_fs_x:1402685-1480384
+/subversion/trunk/subversion/libsvn_fs_x:1414756-1545994

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra/compat.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra/compat.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra/compat.c Wed Nov 27 11:52:35 2013
@@ -23,6 +23,7 @@
 
 #include <apr_pools.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_error.h"
 #include "svn_pools.h"
@@ -36,7 +37,6 @@
 
 #include "private/svn_fspath.h"
 #include "ra_loader.h"
-#include "svn_private_config.h"
 
 
 
@@ -363,8 +363,9 @@ svn_ra__locations_from_log(svn_ra_sessio
      Notice that we always run on the youngest rev of the 3 inputs. */
   targets = apr_array_make(pool, 1, sizeof(const char *));
   APR_ARRAY_PUSH(targets, const char *) = path;
-  SVN_ERR(svn_ra_get_log2(session, targets, youngest, oldest, 0,
+  SVN_ERR(svn_ra_get_log3(session, targets, youngest, oldest, 0,
                           TRUE, FALSE, FALSE,
+                          svn_move_behavior_explicit_moves,
                           apr_array_make(pool, 0, sizeof(const char *)),
                           log_receiver, &lrb, pool));
 
@@ -585,8 +586,9 @@ svn_ra__location_segments_from_log(svn_r
      Notice that we always run on the youngest rev of the 3 inputs. */
   targets = apr_array_make(pool, 1, sizeof(const char *));
   APR_ARRAY_PUSH(targets, const char *) = path;
-  SVN_ERR(svn_ra_get_log2(session, targets, peg_revision, end_rev, 0,
+  SVN_ERR(svn_ra_get_log3(session, targets, peg_revision, end_rev, 0,
                           TRUE, FALSE, FALSE,
+                          svn_move_behavior_explicit_moves,
                           apr_array_make(pool, 0, sizeof(const char *)),
                           gls_log_receiver, &lrb, pool));
 
@@ -684,10 +686,11 @@ svn_ra__file_revs_from_log(svn_ra_sessio
   /* Accumulate revision metadata by walking the revisions
      backwards; this allows us to follow moves/copies
      correctly. */
-  SVN_ERR(svn_ra_get_log2(ra_session,
+  SVN_ERR(svn_ra_get_log3(ra_session,
                           condensed_targets,
                           end, start, 0, /* no limit */
                           TRUE, FALSE, FALSE,
+                          svn_move_behavior_explicit_moves,
                           NULL, fr_log_message_receiver, &lmb,
                           pool));
 
@@ -853,8 +856,9 @@ svn_ra__get_deleted_rev_from_log(svn_ra_
 
   /* Examine the logs of SESSION's URL to find when DELETED_PATH was first
      deleted or replaced. */
-  SVN_ERR(svn_ra_get_log2(session, NULL, peg_revision, end_revision, 0,
+  SVN_ERR(svn_ra_get_log3(session, NULL, peg_revision, end_revision, 0,
                           TRUE, TRUE, FALSE,
+                          svn_move_behavior_explicit_moves,
                           apr_array_make(pool, 0, sizeof(char *)),
                           log_path_del_receiver, &log_path_deleted_baton,
                           pool));

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra/deprecated.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra/deprecated.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra/deprecated.c Wed Nov 27 11:52:35 2013
@@ -26,6 +26,7 @@
    deprecated functions in this file. */
 #define SVN_DEPRECATED
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_ra.h"
 #include "svn_path.h"
@@ -36,9 +37,6 @@
 #include "ra_loader.h"
 #include "deprecated.h"
 
-#include "svn_private_config.h"
-
-
 
 
 /*** From ra_loader.c ***/
@@ -294,6 +292,25 @@ svn_error_t *svn_ra_do_diff(svn_ra_sessi
                          versus_url, diff_editor, diff_baton, pool);
 }
 
+svn_error_t *svn_ra_get_log2(svn_ra_session_t *session,
+                             const apr_array_header_t *paths,
+                             svn_revnum_t start,
+                             svn_revnum_t end,
+                             int limit,
+                             svn_boolean_t discover_changed_paths,
+                             svn_boolean_t strict_node_history,
+                             svn_boolean_t include_merged_revisions,
+                             const apr_array_header_t *revprops,
+                             svn_log_entry_receiver_t receiver,
+                             void *receiver_baton,
+                             apr_pool_t *pool)
+{
+  return svn_ra_get_log3(session, paths, start, end, limit,
+                         discover_changed_paths, strict_node_history,
+                         include_merged_revisions, svn_move_behavior_no_moves,
+                         revprops, receiver, receiver_baton, pool);
+}
+
 svn_error_t *svn_ra_get_log(svn_ra_session_t *session,
                             const apr_array_header_t *paths,
                             svn_revnum_t start,

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra/ra_loader.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra/ra_loader.c Wed Nov 27 11:52:35 2013
@@ -33,6 +33,7 @@
 #include <apr_hash.h>
 #include <apr_uri.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_version.h"
 #include "svn_types.h"
@@ -52,7 +53,6 @@
 #include "deprecated.h"
 
 #include "private/svn_ra_private.h"
-#include "svn_private_config.h"
 
 
 
@@ -877,7 +877,7 @@ svn_error_t *svn_ra_do_diff3(svn_ra_sess
                                   diff_baton, pool);
 }
 
-svn_error_t *svn_ra_get_log2(svn_ra_session_t *session,
+svn_error_t *svn_ra_get_log3(svn_ra_session_t *session,
                              const apr_array_header_t *paths,
                              svn_revnum_t start,
                              svn_revnum_t end,
@@ -885,6 +885,7 @@ svn_error_t *svn_ra_get_log2(svn_ra_sess
                              svn_boolean_t discover_changed_paths,
                              svn_boolean_t strict_node_history,
                              svn_boolean_t include_merged_revisions,
+                             svn_move_behavior_t move_behavior,
                              const apr_array_header_t *revprops,
                              svn_log_entry_receiver_t receiver,
                              void *receiver_baton,
@@ -905,8 +906,8 @@ svn_error_t *svn_ra_get_log2(svn_ra_sess
 
   return session->vtable->get_log(session, paths, start, end, limit,
                                   discover_changed_paths, strict_node_history,
-                                  include_merged_revisions, revprops,
-                                  receiver, receiver_baton, pool);
+                                  include_merged_revisions, move_behavior,
+                                  revprops, receiver, receiver_baton, pool);
 }
 
 svn_error_t *svn_ra_check_path(svn_ra_session_t *session,
@@ -1436,7 +1437,7 @@ svn_ra_print_modules(svn_stringbuf_t *ou
              built with SASL. */
           line = apr_psprintf(iterpool, "* ra_%s : %s\n",
                               defn->ra_name,
-                              vtable->get_description());
+                              vtable->get_description(iterpool));
           svn_stringbuf_appendcstr(output, line);
 
           for (schemes = vtable->get_schemes(iterpool); *schemes != NULL;

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra/ra_loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra/ra_loader.h?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra/ra_loader.h (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra/ra_loader.h Wed Nov 27 11:52:35 2013
@@ -45,7 +45,7 @@ typedef struct svn_ra__vtable_t {
 
   /* Return a short description of the RA implementation, as a localized
    * string. */
-  const char *(*get_description)(void);
+  const char *(*get_description)(apr_pool_t *pool);
 
   /* Return a list of actual URI schemes supported by this implementation.
    * The returned array is NULL-terminated. */
@@ -194,6 +194,7 @@ typedef struct svn_ra__vtable_t {
                           svn_boolean_t discover_changed_paths,
                           svn_boolean_t strict_node_history,
                           svn_boolean_t include_merged_revisions,
+                          svn_move_behavior_t move_behavior,
                           const apr_array_header_t *revprops,
                           svn_log_entry_receiver_t receiver,
                           void *receiver_baton,

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra/wrapper_template.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra/wrapper_template.h?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra/wrapper_template.h (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra/wrapper_template.h Wed Nov 27 11:52:35 2013
@@ -395,6 +395,7 @@ static svn_error_t *compat_get_log(void 
   return VTBL.get_log(session_baton, paths, start, end, 0, /* limit */
                       discover_changed_paths, strict_node_history,
                       FALSE, /* include_merged_revisions */
+                      svn_move_behavior_no_moves,
                       svn_compat_log_revprops_in(pool), /* revprops */
                       receiver2, receiver2_baton, pool);
 }

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_local/ra_plugin.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_local/ra_plugin.c Wed Nov 27 11:52:35 2013
@@ -21,6 +21,7 @@
  * ====================================================================
  */
 
+#include "svn_private_config.h"
 #include "ra_local.h"
 #include "svn_hash.h"
 #include "svn_ra.h"
@@ -35,7 +36,6 @@
 #include "svn_version.h"
 #include "svn_cache_config.h"
 
-#include "svn_private_config.h"
 #include "../libsvn_ra/ra_loader.h"
 #include "private/svn_mergeinfo_private.h"
 #include "private/svn_repos_private.h"
@@ -240,7 +240,7 @@ reporter_link_path(void *reporter_baton,
   if (relpath[0] == '\0')
     fs_path = "/";
   else
-    fs_path = apr_pstrcat(pool, "/", relpath, (char *)NULL);
+    fs_path = apr_pstrcat(pool, "/", relpath, SVN_VA_NULL);
 
   return svn_repos_link_path3(rbaton->report_baton, path, fs_path, revision,
                               depth, start_empty, lock_token, pool);
@@ -327,7 +327,7 @@ make_reporter(svn_ra_session_t *session,
              "'%s'"), other_url, sess->repos_url);
 
       other_fs_path = apr_pstrcat(scratch_pool, "/", other_relpath,
-                                  (char *)NULL);
+                                  SVN_VA_NULL);
     }
 
   /* Pass back our reporter */
@@ -502,7 +502,7 @@ apply_lock_tokens(svn_fs_t *fs,
         N_("Module for accessing a repository on local disk.")
 
 static const char *
-svn_ra_local__get_description(void)
+svn_ra_local__get_description(apr_pool_t *pool)
 {
   return _(RA_LOCAL_DESCRIPTION);
 }
@@ -604,7 +604,7 @@ svn_ra_local__open(svn_ra_session_t *ses
 
   if (client_string)
     sess->useragent = apr_pstrcat(pool, USER_AGENT " ",
-                                  client_string, (char *)NULL);
+                                  client_string, SVN_VA_NULL);
   else
     sess->useragent = USER_AGENT;
 
@@ -989,6 +989,7 @@ svn_ra_local__get_log(svn_ra_session_t *
                       svn_boolean_t discover_changed_paths,
                       svn_boolean_t strict_node_history,
                       svn_boolean_t include_merged_revisions,
+                      svn_move_behavior_t move_behavior,
                       const apr_array_header_t *revprops,
                       svn_log_entry_receiver_t receiver,
                       void *receiver_baton,
@@ -1017,7 +1018,7 @@ svn_ra_local__get_log(svn_ra_session_t *
   receiver = log_receiver_wrapper;
   receiver_baton = &lb;
 
-  return svn_repos_get_logs4(sess->repos,
+  return svn_repos_get_logs5(sess->repos,
                              abs_paths,
                              start,
                              end,
@@ -1025,6 +1026,7 @@ svn_ra_local__get_log(svn_ra_session_t *
                              discover_changed_paths,
                              strict_node_history,
                              include_merged_revisions,
+                             move_behavior,
                              revprops,
                              NULL, NULL,
                              receiver,
@@ -1764,7 +1766,7 @@ svn_ra_local__init(const svn_version_t *
                                "ra_local"),
                              loader_version->major);
 
-  SVN_ERR(svn_ver_check_list(ra_local_version(), checklist));
+  SVN_ERR(svn_ver_check_list2(ra_local_version(), checklist, svn_ver_equal));
 
 #ifndef SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL
   /* This assumes that POOL was the pool used to load the dso. */

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_local/split_url.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_local/split_url.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_local/split_url.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_local/split_url.c Wed Nov 27 11:52:35 2013
@@ -39,6 +39,7 @@ svn_ra_local__split_URL(svn_repos_t **re
   const char *repos_dirent;
   const char *repos_root_dirent;
   svn_stringbuf_t *urlbuf;
+  apr_size_t root_end;
 
   SVN_ERR(svn_uri_get_dirent_from_file_url(&repos_dirent, URL, pool));
 
@@ -65,10 +66,17 @@ svn_ra_local__split_URL(svn_repos_t **re
                    "/",
                    svn_dirent_skip_ancestor(repos_root_dirent, repos_dirent),
                    (const char *)NULL); */
-  *fs_path = &repos_dirent[strlen(repos_root_dirent)];
-
-  if (**fs_path == '\0')
+  root_end = strlen(repos_root_dirent);
+  if (! repos_dirent[root_end])
     *fs_path = "/";
+  else if (repos_dirent[root_end] == '/')
+    *fs_path = &repos_dirent[root_end];
+  else
+    {
+      /* On Windows "C:/" is the parent directory of "C:/dir" */
+      *fs_path = &repos_dirent[root_end-1];
+      SVN_ERR_ASSERT((*fs_path)[0] == '/');
+    }
 
   /* Remove the path components after the root dirent from the original URL,
      to get a URL to the repository root.

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/blame.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/blame.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/blame.c Wed Nov 27 11:52:35 2013
@@ -24,6 +24,7 @@
 #include <apr_uri.h>
 #include <serf.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_pools.h"
 #include "svn_ra.h"
@@ -35,8 +36,6 @@
 #include "svn_base64.h"
 #include "svn_props.h"
 
-#include "svn_private_config.h"
-
 #include "private/svn_string_private.h"
 
 #include "ra_serf.h"
@@ -287,7 +286,7 @@ create_file_revs_body(serf_bucket_t **bo
   svn_ra_serf__add_open_tag_buckets(buckets, alloc,
                                     "S:file-revs-report",
                                     "xmlns:S", SVN_XML_NAMESPACE,
-                                    NULL);
+                                    SVN_VA_NULL);
 
   svn_ra_serf__add_tag_buckets(buckets,
                                "S:start-revision", apr_ltoa(pool, blame_ctx->start),

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/blncache.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/blncache.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/blncache.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/blncache.c Wed Nov 27 11:52:35 2013
@@ -23,6 +23,7 @@
 
 #include <apr_pools.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_dirent_uri.h"
 #include "svn_types.h"

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/commit.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/commit.c Wed Nov 27 11:52:35 2013
@@ -24,6 +24,7 @@
 #include <apr_uri.h>
 #include <serf.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_pools.h"
 #include "svn_ra.h"
@@ -36,7 +37,6 @@
 #include "svn_path.h"
 #include "svn_props.h"
 
-#include "svn_private_config.h"
 #include "private/svn_dep_compat.h"
 #include "private/svn_fspath.h"
 #include "private/svn_skel.h"
@@ -244,9 +244,11 @@ create_checkout_body(serf_bucket_t **bkt
   svn_ra_serf__add_xml_header_buckets(body_bkt, alloc);
   svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:checkout",
                                     "xmlns:D", "DAV:",
-                                    NULL);
-  svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:activity-set", NULL);
-  svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:href", NULL);
+                                    SVN_VA_NULL);
+  svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:activity-set",
+                                    SVN_VA_NULL);
+  svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:href",
+                                    SVN_VA_NULL);
 
   SVN_ERR_ASSERT(activity_url != NULL);
   svn_ra_serf__add_cdata_len_buckets(body_bkt, alloc,
@@ -382,7 +384,7 @@ checkout_dir(dir_context_t *dir,
              apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
-  dir_context_t *p_dir = dir;
+  dir_context_t *c_dir = dir;
   const char *checkout_url;
   const char **working;
 
@@ -393,17 +395,25 @@ checkout_dir(dir_context_t *dir,
 
   /* Is this directory or one of our parent dirs newly added?
    * If so, we're already implicitly checked out. */
-  while (p_dir)
+  while (c_dir)
     {
-      if (p_dir->added)
+      if (c_dir->added)
         {
+          /* Calculate the working_url by skipping the shared ancestor between
+           * the c_dir_parent->relpath and dir->relpath. This is safe since an
+           * add is guaranteed to have a parent that is checked out. */
+          dir_context_t *c_dir_parent = c_dir->parent_dir;
+          const char *relpath = svn_relpath_skip_ancestor(c_dir_parent->relpath,
+                                                          dir->relpath);
+
           /* Implicitly checkout this dir now. */
+          SVN_ERR_ASSERT(c_dir_parent->working_url);
           dir->working_url = svn_path_url_add_component2(
-                                   dir->parent_dir->working_url,
-                                   dir->name, dir->pool);
+                                   c_dir_parent->working_url,
+                                   relpath, dir->pool);
           return SVN_NO_ERROR;
         }
-      p_dir = p_dir->parent_dir;
+      c_dir = c_dir->parent_dir;
     }
 
   /* We could be called twice for the root: once to checkout the baseline;
@@ -544,6 +554,7 @@ checkout_file(file_context_t *file,
       if (parent_dir->added)
         {
           /* Implicitly checkout this file now. */
+          SVN_ERR_ASSERT(parent_dir->working_url);
           file->working_url = svn_path_url_add_component2(
                                     parent_dir->working_url,
                                     svn_relpath_skip_ancestor(
@@ -717,18 +728,18 @@ proppatch_walker(void *baton,
   /* Use the namespace prefix instead of adding the xmlns attribute to support
      property names containing ':' */
   if (strcmp(ns, SVN_DAV_PROP_NS_SVN) == 0)
-    prop_name = apr_pstrcat(wb->body_pool, "S:", name, (char *)NULL);
+    prop_name = apr_pstrcat(wb->body_pool, "S:", name, SVN_VA_NULL);
   else if (strcmp(ns, SVN_DAV_PROP_NS_CUSTOM) == 0)
-    prop_name = apr_pstrcat(wb->body_pool, "C:", name, (char *)NULL);
+    prop_name = apr_pstrcat(wb->body_pool, "C:", name, SVN_VA_NULL);
 
   if (cdata_bkt)
     svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, prop_name,
                                       "V:encoding", encoding,
-                                      NULL);
+                                      SVN_VA_NULL);
   else
     svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, prop_name,
                                       "V:" SVN_DAV__OLD_VALUE__ABSENT, "1",
-                                      NULL);
+                                      SVN_VA_NULL);
 
   if (have_old_val)
     {
@@ -755,12 +766,12 @@ proppatch_walker(void *baton,
         svn_ra_serf__add_open_tag_buckets(body_bkt, alloc,
                                           "V:" SVN_DAV__OLD_VALUE,
                                           "V:encoding", encoding2,
-                                          NULL);
+                                          SVN_VA_NULL);
       else
         svn_ra_serf__add_open_tag_buckets(body_bkt, alloc,
                                           "V:" SVN_DAV__OLD_VALUE,
                                           "V:" SVN_DAV__OLD_VALUE__ABSENT, "1",
-                                          NULL);
+                                          SVN_VA_NULL);
 
       if (cdata_bkt2)
         serf_bucket_aggregate_append(body_bkt, cdata_bkt2);
@@ -815,7 +826,7 @@ maybe_set_lock_token_header(serf_bucket_
           token_uri = apr_uri_unparse(pool, &uri, 0);
 
           token_header = apr_pstrcat(pool, "<", token_uri, "> (<", token, ">)",
-                                     (char *)NULL);
+                                     SVN_VA_NULL);
           serf_bucket_headers_set(headers, "If", token_header);
         }
     }
@@ -871,7 +882,7 @@ create_proppatch_body(serf_bucket_t **bk
                                     "xmlns:V", SVN_DAV_PROP_NS_DAV,
                                     "xmlns:C", SVN_DAV_PROP_NS_CUSTOM,
                                     "xmlns:S", SVN_DAV_PROP_NS_SVN,
-                                    NULL);
+                                    SVN_VA_NULL);
 
   wb.body_bkt = body_bkt;
   wb.body_pool = pbb->body_pool;
@@ -881,8 +892,8 @@ create_proppatch_body(serf_bucket_t **bk
 
   if (apr_hash_count(ctx->changed_props) > 0)
     {
-      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:set", NULL);
-      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", NULL);
+      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:set", SVN_VA_NULL);
+      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", SVN_VA_NULL);
 
       wb.filter = filter_all_props;
       wb.deleting = FALSE;
@@ -897,8 +908,8 @@ create_proppatch_body(serf_bucket_t **bk
 
   if (apr_hash_count(ctx->removed_props) > 0)
     {
-      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:set", NULL);
-      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", NULL);
+      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:set", SVN_VA_NULL);
+      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", SVN_VA_NULL);
 
       wb.filter = filter_props_with_old_value;
       wb.deleting = TRUE;
@@ -913,8 +924,8 @@ create_proppatch_body(serf_bucket_t **bk
 
   if (apr_hash_count(ctx->removed_props) > 0)
     {
-      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:remove", NULL);
-      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", NULL);
+      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:remove", SVN_VA_NULL);
+      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", SVN_VA_NULL);
 
       wb.filter = filter_props_without_old_value;
       wb.deleting = TRUE;
@@ -1123,7 +1134,7 @@ setup_delete_headers(serf_bucket_t *head
           const char *token_header;
 
           token_header = apr_pstrcat(pool, "<", ctx->path, "> (<",
-                                     ctx->lock_token, ">)", (char *)NULL);
+                                     ctx->lock_token, ">)", SVN_VA_NULL);
 
           serf_bucket_headers_set(headers, "If", token_header);
 
@@ -1924,7 +1935,11 @@ add_file(const char *path,
 
       if (handler->sline.code != 404)
         {
-          return svn_error_createf(SVN_ERR_RA_DAV_ALREADY_EXISTS, NULL,
+          SVN_ERR(svn_ra_serf__error_on_status(handler->sline,
+                                               handler->path,
+                                               handler->location));
+
+         return svn_error_createf(SVN_ERR_FS_ALREADY_EXISTS, NULL,
                                    _("File '%s' already exists"), path);
         }
     }
@@ -2159,8 +2174,8 @@ close_file(void *file_baton,
     {
       proppatch_context_t *proppatch;
 
-      proppatch = apr_pcalloc(ctx->pool, sizeof(*proppatch));
-      proppatch->pool = ctx->pool;
+      proppatch = apr_pcalloc(scratch_pool, sizeof(*proppatch));
+      proppatch->pool = scratch_pool;
       proppatch->relpath = ctx->relpath;
       proppatch->path = ctx->url;
       proppatch->commit = ctx->commit;
@@ -2168,7 +2183,7 @@ close_file(void *file_baton,
       proppatch->removed_props = ctx->removed_props;
       proppatch->base_revision = ctx->base_revision;
 
-      SVN_ERR(proppatch_resource(proppatch, ctx->commit, ctx->pool));
+      SVN_ERR(proppatch_resource(proppatch, ctx->commit, scratch_pool));
     }
 
   return SVN_NO_ERROR;
@@ -2269,7 +2284,9 @@ abort_edit(void *edit_baton,
       && handler->sline.code != 404
       )
     {
-      SVN_ERR_MALFUNCTION();
+      return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
+                               _("DELETE returned unexpected status: %d"),
+                               handler->sline.code);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/get_deleted_rev.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/get_deleted_rev.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/get_deleted_rev.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/get_deleted_rev.c Wed Nov 27 11:52:35 2013
@@ -101,7 +101,7 @@ create_getdrev_body(serf_bucket_t **body
                                     "S:get-deleted-rev-report",
                                     "xmlns:S", SVN_XML_NAMESPACE,
                                     "xmlns:D", "DAV:",
-                                    NULL, NULL);
+                                    SVN_VA_NULL);
 
   svn_ra_serf__add_tag_buckets(buckets,
                                "S:path", drev_ctx->path,

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getdate.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getdate.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getdate.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getdate.c Wed Nov 27 11:52:35 2013
@@ -107,7 +107,7 @@ create_getdate_body(serf_bucket_t **body
   svn_ra_serf__add_open_tag_buckets(buckets, alloc, "S:dated-rev-report",
                                     "xmlns:S", SVN_XML_NAMESPACE,
                                     "xmlns:D", "DAV:",
-                                    NULL);
+                                    SVN_VA_NULL);
 
   svn_ra_serf__add_tag_buckets(buckets,
                                "D:" SVN_DAV__CREATIONDATE,

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getlocations.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getlocations.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getlocations.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getlocations.c Wed Nov 27 11:52:35 2013
@@ -27,12 +27,12 @@
 
 #include <serf.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_path.h"
 #include "svn_pools.h"
 #include "svn_ra.h"
 #include "svn_xml.h"
-#include "svn_private_config.h"
 
 #include "../libsvn_ra/ra_loader.h"
 
@@ -121,7 +121,7 @@ create_get_locations_body(serf_bucket_t 
                                     "S:get-locations",
                                     "xmlns:S", SVN_XML_NAMESPACE,
                                     "xmlns:D", "DAV:",
-                                    NULL);
+                                    SVN_VA_NULL);
 
   svn_ra_serf__add_tag_buckets(buckets,
                                "S:path", loc_ctx->path,

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getlocationsegments.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getlocationsegments.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getlocationsegments.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getlocationsegments.c Wed Nov 27 11:52:35 2013
@@ -27,12 +27,12 @@
 #include <apr_uri.h>
 #include <serf.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_pools.h"
 #include "svn_ra.h"
 #include "svn_xml.h"
 #include "svn_path.h"
-#include "svn_private_config.h"
 #include "../libsvn_ra/ra_loader.h"
 
 #include "ra_serf.h"
@@ -119,7 +119,7 @@ create_gls_body(serf_bucket_t **body_bkt
   svn_ra_serf__add_open_tag_buckets(buckets, alloc,
                                     "S:get-location-segments",
                                     "xmlns:S", SVN_XML_NAMESPACE,
-                                    NULL);
+                                    SVN_VA_NULL);
 
   svn_ra_serf__add_tag_buckets(buckets,
                                "S:path", gls_ctx->path,

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getlocks.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getlocks.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getlocks.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/getlocks.c Wed Nov 27 11:52:35 2013
@@ -27,6 +27,7 @@
 
 #include <serf.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_path.h"
 #include "svn_pools.h"
@@ -37,7 +38,6 @@
 
 #include "private/svn_dav_protocol.h"
 #include "private/svn_fspath.h"
-#include "svn_private_config.h"
 
 #include "../libsvn_ra/ra_loader.h"
 
@@ -215,7 +215,7 @@ create_getlocks_body(serf_bucket_t **bod
 
   svn_ra_serf__add_open_tag_buckets(
     buckets, alloc, "S:get-locks-report", "xmlns:S", SVN_XML_NAMESPACE,
-    "depth", svn_depth_to_word(lock_ctx->requested_depth), NULL);
+    "depth", svn_depth_to_word(lock_ctx->requested_depth), SVN_VA_NULL);
   svn_ra_serf__add_close_tag_buckets(buckets, alloc, "S:get-locks-report");
 
   *body_bkt = buckets;
@@ -241,7 +241,7 @@ svn_ra_serf__get_locks(svn_ra_session_t 
 
   lock_ctx = apr_pcalloc(pool, sizeof(*lock_ctx));
   lock_ctx->pool = pool;
-  lock_ctx->path = apr_pstrcat(pool, "/", rel_path, (char *)NULL);
+  lock_ctx->path = apr_pstrcat(pool, "/", rel_path, SVN_VA_NULL);
   lock_ctx->requested_depth = depth;
   lock_ctx->hash = apr_hash_make(pool);
 

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/inherited_props.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/inherited_props.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/inherited_props.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/inherited_props.c Wed Nov 27 11:52:35 2013
@@ -25,6 +25,7 @@
 #include <apr_tables.h>
 #include <apr_xml.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_path.h"
 #include "svn_ra.h"
@@ -35,7 +36,6 @@
 
 #include "private/svn_dav_protocol.h"
 #include "../libsvn_ra/ra_loader.h"
-#include "svn_private_config.h"
 #include "ra_serf.h"
 
 
@@ -207,7 +207,7 @@ create_iprops_body(serf_bucket_t **bkt,
   svn_ra_serf__add_open_tag_buckets(body_bkt, alloc,
                                     "S:" SVN_DAV__INHERITED_PROPS_REPORT,
                                     "xmlns:S", SVN_XML_NAMESPACE,
-                                    NULL);
+                                    SVN_VA_NULL);
   svn_ra_serf__add_tag_buckets(body_bkt,
                                "S:" SVN_DAV__REVISION,
                                apr_ltoa(pool, iprops_ctx->revision),

Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/locks.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/locks.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/locks.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/locks.c Wed Nov 27 11:52:35 2013
@@ -302,8 +302,8 @@ create_getlock_body(serf_bucket_t **body
   svn_ra_serf__add_xml_header_buckets(buckets, alloc);
   svn_ra_serf__add_open_tag_buckets(buckets, alloc, "propfind",
                                     "xmlns", "DAV:",
-                                    NULL);
-  svn_ra_serf__add_open_tag_buckets(buckets, alloc, "prop", NULL);
+                                    SVN_VA_NULL);
+  svn_ra_serf__add_open_tag_buckets(buckets, alloc, "prop", SVN_VA_NULL);
   svn_ra_serf__add_tag_buckets(buckets, "lockdiscovery", NULL, alloc);
   svn_ra_serf__add_close_tag_buckets(buckets, alloc, "prop");
   svn_ra_serf__add_close_tag_buckets(buckets, alloc, "propfind");
@@ -337,13 +337,13 @@ create_lock_body(serf_bucket_t **body_bk
   svn_ra_serf__add_xml_header_buckets(buckets, alloc);
   svn_ra_serf__add_open_tag_buckets(buckets, alloc, "lockinfo",
                                     "xmlns", "DAV:",
-                                    NULL);
+                                    SVN_VA_NULL);
 
-  svn_ra_serf__add_open_tag_buckets(buckets, alloc, "lockscope", NULL);
+  svn_ra_serf__add_open_tag_buckets(buckets, alloc, "lockscope", SVN_VA_NULL);
   svn_ra_serf__add_tag_buckets(buckets, "exclusive", NULL, alloc);
   svn_ra_serf__add_close_tag_buckets(buckets, alloc, "lockscope");
 
-  svn_ra_serf__add_open_tag_buckets(buckets, alloc, "locktype", NULL);
+  svn_ra_serf__add_open_tag_buckets(buckets, alloc, "locktype", SVN_VA_NULL);
   svn_ra_serf__add_tag_buckets(buckets, "write", NULL, alloc);
   svn_ra_serf__add_close_tag_buckets(buckets, alloc, "locktype");
 
@@ -602,7 +602,7 @@ svn_ra_serf__unlock(svn_ra_session_t *ra
         }
 
       unlock_ctx.force = force;
-      unlock_ctx.token = apr_pstrcat(iterpool, "<", token, ">", (char *)NULL);
+      unlock_ctx.token = apr_pstrcat(iterpool, "<", token, ">", SVN_VA_NULL);
 
       req_url = svn_path_url_add_component2(session->session_url.path, path,
                                             iterpool);