subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1575685 [8/13] - in /subversion/branches/fsfs-ucsnorm: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ contrib/cgi/ contrib/client-side/emacs/ contrib/client-side/svn2cl/ contrib/hook-scripts/ contrib/server-side/svn...
Date Sun, 09 Mar 2014 10:08:53 GMT
Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/transaction.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/transaction.c Sun Mar  9 10:08:46 2014
@@ -357,26 +357,10 @@ unlock_proto_rev(svn_fs_t *fs,
   return with_txnlist_lock(fs, unlock_proto_rev_body, &b, pool);
 }
 
-/* Same as unlock_proto_rev(), but requires that the transaction list
-   lock is already held. */
-static svn_error_t *
-unlock_proto_rev_list_locked(svn_fs_t *fs,
-                             svn_fs_x__txn_id_t txn_id,
-                             void *lockcookie,
-                             apr_pool_t *pool)
-{
-  struct unlock_proto_rev_baton b;
-
-  b.txn_id = txn_id;
-  b.lockcookie = lockcookie;
-  return unlock_proto_rev_body(fs, &b, pool);
-}
-
 /* A structure used by get_writable_proto_rev() and
    get_writable_proto_rev_body(), which see. */
 struct get_writable_proto_rev_baton
 {
-  apr_file_t **file;
   void **lockcookie;
   svn_fs_x__txn_id_t txn_id;
 };
@@ -386,9 +370,7 @@ static svn_error_t *
 get_writable_proto_rev_body(svn_fs_t *fs, const void *baton, apr_pool_t *pool)
 {
   const struct get_writable_proto_rev_baton *b = baton;
-  apr_file_t **file = b->file;
   void **lockcookie = b->lockcookie;
-  svn_error_t *err;
   fs_x_shared_txn_data_t *txn = get_shared_txn(fs, b->txn_id, TRUE);
 
   /* First, ensure that no thread in this process (including this one)
@@ -449,10 +431,37 @@ get_writable_proto_rev_body(svn_fs_t *fs
   /* We've successfully locked the transaction; mark it as such. */
   txn->being_written = TRUE;
 
+  return SVN_NO_ERROR;
+}
+
+/* Get a handle to the prototype revision file for transaction TXN_ID in
+   filesystem FS, and lock it for writing.  Return FILE, a file handle
+   positioned at the end of the file, and LOCKCOOKIE, a cookie that
+   should be passed to unlock_proto_rev() to unlock the file once FILE
+   has been closed.
+
+   If the prototype revision file is already locked, return error
+   SVN_ERR_FS_REP_BEING_WRITTEN.
+
+   Perform all allocations in POOL. */
+static svn_error_t *
+get_writable_proto_rev(apr_file_t **file,
+                       void **lockcookie,
+                       svn_fs_t *fs,
+                       svn_fs_x__txn_id_t txn_id,
+                       apr_pool_t *pool)
+{
+  struct get_writable_proto_rev_baton b;
+  svn_error_t *err;
+
+  b.lockcookie = lockcookie;
+  b.txn_id = txn_id;
+
+  SVN_ERR(with_txnlist_lock(fs, get_writable_proto_rev_body, &b, pool));
 
   /* Now open the prototype revision file and seek to the end. */
   err = svn_io_file_open(file,
-                         svn_fs_x__path_txn_proto_rev(fs, b->txn_id, pool),
+                         svn_fs_x__path_txn_proto_rev(fs, txn_id, pool),
                          APR_WRITE | APR_BUFFERED, APR_OS_DEFAULT, pool);
 
   /* You might expect that we could dispense with the following seek
@@ -472,7 +481,7 @@ get_writable_proto_rev_body(svn_fs_t *fs
     {
       err = svn_error_compose_create(
               err,
-              unlock_proto_rev_list_locked(fs, b->txn_id, *lockcookie, pool));
+              unlock_proto_rev(fs, txn_id, *lockcookie, pool));
 
       *lockcookie = NULL;
     }
@@ -480,32 +489,6 @@ get_writable_proto_rev_body(svn_fs_t *fs
   return svn_error_trace(err);
 }
 
-/* Get a handle to the prototype revision file for transaction TXN_ID in
-   filesystem FS, and lock it for writing.  Return FILE, a file handle
-   positioned at the end of the file, and LOCKCOOKIE, a cookie that
-   should be passed to unlock_proto_rev() to unlock the file once FILE
-   has been closed.
-
-   If the prototype revision file is already locked, return error
-   SVN_ERR_FS_REP_BEING_WRITTEN.
-
-   Perform all allocations in POOL. */
-static svn_error_t *
-get_writable_proto_rev(apr_file_t **file,
-                       void **lockcookie,
-                       svn_fs_t *fs,
-                       svn_fs_x__txn_id_t txn_id,
-                       apr_pool_t *pool)
-{
-  struct get_writable_proto_rev_baton b;
-
-  b.file = file;
-  b.lockcookie = lockcookie;
-  b.txn_id = txn_id;
-
-  return with_txnlist_lock(fs, get_writable_proto_rev_body, &b, pool);
-}
-
 /* Callback used in the implementation of purge_shared_txn(). */
 static svn_error_t *
 purge_shared_txn_body(svn_fs_t *fs, const void *baton, apr_pool_t *pool)
@@ -513,7 +496,6 @@ purge_shared_txn_body(svn_fs_t *fs, cons
   svn_fs_x__txn_id_t txn_id = *(const svn_fs_x__txn_id_t *)baton;
 
   free_shared_txn(fs, txn_id);
-  svn_fs_x__reset_txn_caches(fs);
 
   return SVN_NO_ERROR;
 }
@@ -959,7 +941,8 @@ create_new_txn_noderev_from_rev(svn_fs_t
   SVN_ERR(svn_fs_x__get_node_revision(&noderev, fs, src, pool));
 
   /* This must be a root node. */
-  SVN_ERR_ASSERT(svn_fs_x__id_node_id(noderev->id)->number == 0);
+  SVN_ERR_ASSERT(   svn_fs_x__id_node_id(noderev->id)->number == 0
+                 && svn_fs_x__id_copy_id(noderev->id)->number == 0);
 
   if (svn_fs_x__id_is_txn(noderev->id))
     return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
@@ -1273,18 +1256,13 @@ store_p2l_index_entry(svn_fs_t *fs,
   return SVN_NO_ERROR;
 }
 
-/* Allocate an item index for the given MY_OFFSET in the transaction TXN_ID
- * of file system FS and return it in *ITEM_INDEX.  For old formats, it
- * will simply return the offset as item index; in new formats, it will
- * increment the txn's item index counter file and store the mapping in
- * the proto index file.
- * Use POOL for allocations.
+/* Allocate an item index in the transaction TXN_ID of file system FS and
+ * return it in *ITEM_INDEX.  Use POOL for allocations.
  */
 static svn_error_t *
 allocate_item_index(apr_uint64_t *item_index,
                     svn_fs_t *fs,
                     svn_fs_x__txn_id_t txn_id,
-                    apr_off_t my_offset,
                     apr_pool_t *pool)
 {
   apr_file_t *file;
@@ -1294,7 +1272,7 @@ allocate_item_index(apr_uint64_t *item_i
   apr_size_t read;
   apr_off_t offset = 0;
 
-  /* read number, increment it and write it back to disk */
+  /* read number */
   SVN_ERR(svn_io_file_open(&file,
                             svn_fs_x__path_txn_item_index(fs, txn_id, pool),
                             APR_READ | APR_WRITE
@@ -1307,15 +1285,14 @@ allocate_item_index(apr_uint64_t *item_i
   else
     *item_index = SVN_FS_X__ITEM_INDEX_FIRST_USER;
 
+  /* increment it */
   to_write = svn__ui64toa(buffer, *item_index + 1);
+
+  /* write it back to disk */
   SVN_ERR(svn_io_file_seek(file, SEEK_SET, &offset, pool));
   SVN_ERR(svn_io_file_write_full(file, buffer, to_write, NULL, pool));
   SVN_ERR(svn_io_file_close(file, pool));
 
-  /* write log-to-phys index */
-  SVN_ERR(store_l2p_index_entry(fs, txn_id, my_offset, *item_index,
-                                pool));
-
   return SVN_NO_ERROR;
 }
 
@@ -1398,7 +1375,7 @@ get_new_txn_node_id(svn_fs_x__id_part_t 
   /* First read in the current next-ids file. */
   SVN_ERR(read_next_ids(&node_id, &copy_id, fs, txn_id, pool));
 
-  node_id_p->change_set = SVN_FS_X__INVALID_CHANGE_SET;
+  node_id_p->change_set = svn_fs_x__change_set_by_txn(txn_id);
   node_id_p->number = node_id;
 
   SVN_ERR(write_next_ids(fs, txn_id, ++node_id, copy_id, pool));
@@ -1417,7 +1394,7 @@ svn_fs_x__reserve_copy_id(svn_fs_x__id_p
   /* First read in the current next-ids file. */
   SVN_ERR(read_next_ids(&node_id, &copy_id, fs, txn_id, pool));
 
-  copy_id_p->change_set = SVN_FS_X__INVALID_CHANGE_SET;
+  copy_id_p->change_set = svn_fs_x__change_set_by_txn(txn_id);
   copy_id_p->number = copy_id;
 
   SVN_ERR(write_next_ids(fs, txn_id, node_id, ++copy_id, pool));
@@ -1435,12 +1412,16 @@ svn_fs_x__create_node(const svn_fs_id_t 
 {
   svn_fs_x__id_part_t node_id;
   const svn_fs_id_t *id;
+  apr_uint64_t number;
 
   /* Get a new node-id for this node. */
   SVN_ERR(get_new_txn_node_id(&node_id, fs, txn_id, pool));
 
-  id = svn_fs_x__id_txn_create(&node_id, copy_id, txn_id, pool);
+  /* Item number within this change set. */
+  SVN_ERR(allocate_item_index(&number, fs, txn_id, pool));
 
+  /* Construct the ID object from all the above parts. */
+  id = svn_fs_x__id_txn_create(&node_id, copy_id, txn_id, number, pool);
   noderev->id = id;
 
   SVN_ERR(svn_fs_x__put_node_revision(fs, noderev->id, noderev, FALSE, pool));
@@ -1543,12 +1524,11 @@ svn_fs_x__set_entry(svn_fs_t *fs,
       out = svn_stream_from_aprfile2(file, TRUE, pool);
     }
 
-  /* if we have a directory cache for this transaction, update it */
-  if (ffd->txn_dir_cache)
+  /* update directory cache */
     {
       /* build parameters: (name, new entry) pair */
-      const char *key =
-          svn_fs_x__id_unparse(parent_noderev->id, subpool)->data;
+      const svn_fs_x__id_part_t *key
+        = svn_fs_x__id_noderev_id(parent_noderev->id);
       replace_baton_t baton;
 
       baton.name = name;
@@ -1563,7 +1543,7 @@ svn_fs_x__set_entry(svn_fs_t *fs,
         }
 
       /* actually update the cached directory (if cached) */
-      SVN_ERR(svn_cache__set_partial(ffd->txn_dir_cache, key,
+      SVN_ERR(svn_cache__set_partial(ffd->dir_cache, key,
                                      svn_fs_x__replace_dir_entry, &baton,
                                      subpool));
     }
@@ -1811,7 +1791,7 @@ rep_write_cleanup(void *data)
   err = svn_io_file_trunc(b->file, b->rep_offset, b->pool);
   err = svn_error_compose_create(err, svn_io_file_close(b->file, b->pool));
 
-  /* Remove our lock regardless of any preceeding errors so that the
+  /* Remove our lock regardless of any preceding errors so that the
      being_written flag is always removed and stays consistent with the
      file lock which will be removed no matter what since the pool is
      going away. */
@@ -2081,8 +2061,9 @@ rep_write_contents_close(void *baton)
     {
       /* Write out our cosmetic end marker. */
       SVN_ERR(svn_stream_puts(b->rep_stream, "ENDREP\n"));
-      SVN_ERR(allocate_item_index(&rep->id.number, b->fs, txn_id,
-                                  b->rep_offset, b->pool));
+      SVN_ERR(allocate_item_index(&rep->id.number, b->fs, txn_id, b->pool));
+      SVN_ERR(store_l2p_index_entry(b->fs, txn_id, b->rep_offset,
+                                    rep->id.number, b->pool));
 
       b->noderev->data_rep = rep;
     }
@@ -2168,11 +2149,14 @@ svn_fs_x__create_successor(const svn_fs_
                            apr_pool_t *pool)
 {
   const svn_fs_id_t *id;
+  apr_uint64_t number;
 
   if (! copy_id)
     copy_id = svn_fs_x__id_copy_id(old_idp);
+
+  SVN_ERR(allocate_item_index(&number, fs, txn_id, pool));
   id = svn_fs_x__id_txn_create(svn_fs_x__id_node_id(old_idp), copy_id,
-                               txn_id, pool);
+                               txn_id, number, pool);
 
   new_noderev->id = id;
 
@@ -2216,7 +2200,9 @@ svn_fs_x__set_proplist(svn_fs_t *fs,
     {
       noderev->prop_rep = apr_pcalloc(pool, sizeof(*noderev->prop_rep));
       noderev->prop_rep->id.change_set
-        = svn_fs_x__change_set_by_txn(svn_fs_x__id_txn_id(noderev->id));
+        = svn_fs_x__id_noderev_id(noderev->id)->change_set;
+      SVN_ERR(allocate_item_index(&noderev->prop_rep->id.number, fs,
+                                  svn_fs_x__id_txn_id(noderev->id), pool));
       SVN_ERR(svn_fs_x__put_node_revision(fs, noderev->id, noderev, FALSE,
                                           pool));
     }
@@ -2360,8 +2346,8 @@ write_hash_delta_rep(representation_t *r
       SVN_ERR(svn_fs_x__get_file_offset(&rep_end, file, pool));
       SVN_ERR(svn_stream_puts(file_stream, "ENDREP\n"));
 
-      SVN_ERR(allocate_item_index(&rep->id.number, fs, txn_id, offset,
-                                  pool));
+      SVN_ERR(allocate_item_index(&rep->id.number, fs, txn_id, pool));
+      SVN_ERR(store_l2p_index_entry(fs, txn_id, offset, rep->id.number, pool));
 
       noderev_id.change_set = SVN_FS_X__INVALID_CHANGE_SET;
       noderev_id.number = rep->id.number;
@@ -2451,7 +2437,7 @@ static void
 get_final_id(svn_fs_x__id_part_t *part,
              svn_revnum_t revision)
 {
-  if (part->change_set == SVN_FS_X__INVALID_CHANGE_SET)
+  if (!svn_fs_x__is_revision(part->change_set))
     part->change_set = svn_fs_x__change_set_by_rev(revision);
 }
 
@@ -2590,25 +2576,17 @@ write_final_rev(const svn_fs_id_t **new_
   get_final_id(&node_id, rev);
   copy_id = *svn_fs_x__id_copy_id(noderev->id);
   get_final_id(&copy_id, rev);
+  noderev_id = *svn_fs_x__id_noderev_id(noderev->id);
+  get_final_id(&noderev_id, rev);
 
   if (noderev->copyroot_rev == SVN_INVALID_REVNUM)
     noderev->copyroot_rev = rev;
 
   SVN_ERR(svn_fs_x__get_file_offset(&my_offset, file, pool));
-  if (at_root)
-    {
-      /* reference the root noderev from the log-to-phys index */
-      noderev_id.number = SVN_FS_X__ITEM_INDEX_ROOT_NODE;
-      SVN_ERR(store_l2p_index_entry(fs, txn_id, my_offset, noderev_id.number,
-                                    pool));
-    }
-  else
-    SVN_ERR(allocate_item_index(&noderev_id.number, fs, txn_id, my_offset,
-                                pool));
 
-  noderev_id.change_set = change_set;
+  SVN_ERR(store_l2p_index_entry(fs, txn_id, my_offset, noderev_id.number,
+                                pool));
   new_id = svn_fs_x__id_create(&node_id, &copy_id, &noderev_id, pool);
-
   noderev->id = new_id;
 
   if (ffd->rep_sharing_allowed)
@@ -3434,16 +3412,14 @@ svn_fs_x__delete_node_revision(svn_fs_t 
       && noderev->kind == svn_node_dir)
     {
       fs_x_data_t *ffd = fs->fsap_data;
+      const svn_fs_x__id_part_t *key = svn_fs_x__id_noderev_id(id);
+
       SVN_ERR(svn_io_remove_file2(svn_fs_x__path_txn_node_children(fs, id,
                                                                    pool),
                                   FALSE, pool));
 
       /* remove the corresponding entry from the cache, if such exists */
-      if (ffd->txn_dir_cache)
-        {
-          const char *key = svn_fs_x__id_unparse(id, pool)->data;
-          SVN_ERR(svn_cache__set(ffd->txn_dir_cache, key, NULL, pool));
-        }
+      SVN_ERR(svn_cache__set(ffd->dir_cache, key, NULL, pool));
     }
 
   return svn_io_remove_file2(svn_fs_x__path_txn_node_rev(fs, id, pool),

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/tree.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/tree.c Sun Mar  9 10:08:46 2014
@@ -528,18 +528,18 @@ dag_node_cache_set(svn_fs_root_t *root,
 }
 
 
-/* Baton for find_descendents_in_cache. */
+/* Baton for find_descendants_in_cache. */
 struct fdic_baton {
   const char *path;
   apr_array_header_t *list;
   apr_pool_t *pool;
 };
 
-/* If the given item is a descendent of BATON->PATH, push
+/* If the given item is a descendant of BATON->PATH, push
  * it onto BATON->LIST (copying into BATON->POOL).  Implements
  * the svn_iter_apr_hash_cb_t prototype. */
 static svn_error_t *
-find_descendents_in_cache(void *baton,
+find_descendants_in_cache(void *baton,
                           const void *key,
                           apr_ssize_t klen,
                           void *val,
@@ -574,16 +574,16 @@ dag_node_cache_invalidate(svn_fs_root_t 
   locate_cache(&cache, NULL, root, NULL, b.pool);
 
 
-  SVN_ERR(svn_cache__iter(NULL, cache, find_descendents_in_cache,
+  SVN_ERR(svn_cache__iter(NULL, cache, find_descendants_in_cache,
                           &b, b.pool));
 
   iterpool = svn_pool_create(b.pool);
 
   for (i = 0; i < b.list->nelts; i++)
     {
-      const char *descendent = APR_ARRAY_IDX(b.list, i, const char *);
+      const char *descendant = APR_ARRAY_IDX(b.list, i, const char *);
       svn_pool_clear(iterpool);
-      SVN_ERR(svn_cache__set(cache, descendent, NULL, iterpool));
+      SVN_ERR(svn_cache__set(cache, descendant, NULL, iterpool));
     }
 
   svn_pool_destroy(iterpool);
@@ -838,7 +838,7 @@ get_copy_inheritance(copy_id_inherit_t *
   SVN_ERR(get_dag(&copyroot_node, copyroot_root, copyroot_path, FALSE, pool));
   copyroot_id = svn_fs_x__dag_get_id(copyroot_node);
 
-  if (svn_fs_x__id_compare(copyroot_id, child_id) == -1)
+  if (svn_fs_x__id_compare(copyroot_id, child_id) == svn_fs_node_unrelated)
     return SVN_NO_ERROR;
 
   /* Determine if we are looking at the child via its original path or
@@ -1327,9 +1327,8 @@ x_node_relation(svn_fs_node_relation_t *
   svn_boolean_t b_is_root_dir
     = (path_b[0] == '\0') || ((path_b[0] == '/') && (path_b[1] == '\0'));
 
-  /* Root paths are never related to non-root paths and path from different
-   * repository are always unrelated. */
-  if (a_is_root_dir ^ b_is_root_dir || root_a->fs != root_b->fs)
+  /* Path from different repository are always unrelated. */
+  if (root_a->fs != root_b->fs)
     {
       *relation = svn_fs_node_unrelated;
       return SVN_NO_ERROR;
@@ -1345,11 +1344,11 @@ x_node_relation(svn_fs_node_relation_t *
 
   /* Are both (!) root paths? Then, they are related and we only test how
    * direct the relation is. */
-  if (a_is_root_dir)
+  if (a_is_root_dir && b_is_root_dir)
     {
       *relation = root_a->rev == root_b->rev
                 ? svn_fs_node_same
-                : svn_fs_node_common_anchestor;
+                : svn_fs_node_common_ancestor;
       return SVN_NO_ERROR;
     }
 
@@ -1368,7 +1367,7 @@ x_node_relation(svn_fs_node_relation_t *
   if (svn_fs_x__id_part_eq(&noderev_id_a, &noderev_id_b))
     *relation = svn_fs_node_same;
   else if (svn_fs_x__id_part_eq(&node_id_a, &node_id_b))
-    *relation = svn_fs_node_common_anchestor;
+    *relation = svn_fs_node_common_ancestor;
   else
     *relation = svn_fs_node_unrelated;
 
@@ -1591,6 +1590,7 @@ x_props_changed(svn_boolean_t *changed_p
                 const char *path1,
                 svn_fs_root_t *root2,
                 const char *path2,
+                svn_boolean_t strict,
                 apr_pool_t *pool)
 {
   dag_node_t *node1, *node2;
@@ -1603,7 +1603,8 @@ x_props_changed(svn_boolean_t *changed_p
 
   SVN_ERR(get_dag(&node1, root1, path1, TRUE, pool));
   SVN_ERR(get_dag(&node2, root2, path2, TRUE, pool));
-  return svn_fs_x__dag_things_different(changed_p, NULL, node1, node2);
+  return svn_fs_x__dag_things_different(changed_p, NULL, node1, node2,
+                                        strict, pool);
 }
 
 
@@ -1842,6 +1843,7 @@ merge(svn_stringbuf_t *conflict_p,
   */
   {
     node_revision_t *tgt_nr, *anc_nr, *src_nr;
+    svn_boolean_t same;
 
     /* Get node revisions for our id's. */
     SVN_ERR(svn_fs_x__get_node_revision(&tgt_nr, fs, target_id, pool));
@@ -1850,16 +1852,15 @@ merge(svn_stringbuf_t *conflict_p,
 
     /* Now compare the prop-keys of the skels.  Note that just because
        the keys are different -doesn't- mean the proplists have
-       different contents.  But merge() isn't concerned with contents;
-       it doesn't do a brute-force comparison on textual contents, so
-       it won't do that here either.  Checking to see if the propkey
-       atoms are `equal' is enough. */
-    if (! svn_fs_x__noderev_same_rep_key(src_nr->prop_rep, anc_nr->prop_rep))
+       different contents. */
+    SVN_ERR(svn_fs_x__prop_rep_equal(&same, fs, src_nr, anc_nr, TRUE, pool));
+    if (! same)
       return conflict_err(conflict_p, target_path);
 
     /* The directory entries got changed in the repository but the directory
        properties did not. */
-    if (! svn_fs_x__noderev_same_rep_key(tgt_nr->prop_rep, anc_nr->prop_rep))
+    SVN_ERR(svn_fs_x__prop_rep_equal(&same, fs, tgt_nr, anc_nr, TRUE, pool));
+    if (! same)
       {
         /* There is an incoming prop change for this directory.
            We will accept it only if the directory changes were mere updates
@@ -1932,7 +1933,7 @@ merge(svn_stringbuf_t *conflict_p,
                                               s_entry->id,
                                               s_entry->kind,
                                               txn_id,
-                                              iterpool));
+                                              pool));
             }
           else
             {
@@ -2227,8 +2228,6 @@ svn_fs_x__commit_txn(const char **confli
 
  cleanup:
 
-  svn_fs_x__reset_txn_caches(fs);
-
   svn_pool_destroy(iterpool);
   return svn_error_trace(err);
 }
@@ -3269,6 +3268,7 @@ x_contents_changed(svn_boolean_t *change
                    const char *path1,
                    svn_fs_root_t *root2,
                    const char *path2,
+                   svn_boolean_t strict,
                    apr_pool_t *pool)
 {
   dag_node_t *node1, *node2;
@@ -3296,7 +3296,8 @@ x_contents_changed(svn_boolean_t *change
 
   SVN_ERR(get_dag(&node1, root1, path1, TRUE, pool));
   SVN_ERR(get_dag(&node2, root2, path2, TRUE, pool));
-  return svn_fs_x__dag_things_different(NULL, changed_p, node1, node2);
+  return svn_fs_x__dag_things_different(NULL, changed_p, node1, node2,
+                                        strict, pool);
 }
 
 
@@ -4273,12 +4274,6 @@ make_txn_root(svn_fs_root_t **root_p,
                                                   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_x__initialize_txn_caches(fs, root->txn, root->pool));
-
   root->fsap_data = frd;
 
   *root_p = root;

Propchange: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sun Mar  9 10:08:46 2014
@@ -7,3 +7,5 @@ Release
 *~
 .*~
 libsvn_ra.def
+libsvn_ra.pc.in
+libsvn_ra.pc

Propchange: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_local/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sun Mar  9 10:08:46 2014
@@ -7,4 +7,5 @@ Debug
 *.o
 *~
 .*~
-
+libsvn_ra_local.pc.in
+libsvn_ra_local.pc

Propchange: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sun Mar  9 10:08:46 2014
@@ -1 +1,3 @@
 .libs
+libsvn_ra_serf.pc.in
+libsvn_ra_serf.pc

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/README
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/README?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/README (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/README Sun Mar  9 10:08:46 2014
@@ -22,7 +22,7 @@ support for ra_serf:
 
 For more about how ra_serf/ra_neon talk WebDAV, consult notes/webdav-protocol.
 
-Working copies are interchangable between ra_serf and ra_neon.  (They both use
+Working copies are interchangeable between ra_serf and ra_neon.  (They both use
 the svn:wc:ra_dav:version-url property to store the latest revision of a file.)
 
 Completed tasks

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/commit.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/commit.c Sun Mar  9 10:08:46 2014
@@ -954,9 +954,7 @@ create_put_body(serf_bucket_t **body_bkt
    * bucket for us on the buffered svndiff handle.
    */
   SVN_ERR(svn_io_file_flush(ctx->svndiff, pool));
-#if APR_VERSION_AT_LEAST(1, 3, 0)
   apr_file_buffer_set(ctx->svndiff, NULL, 0);
-#endif
   offset = 0;
   SVN_ERR(svn_io_file_seek(ctx->svndiff, APR_SET, &offset, pool));
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/log.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/log.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/log.c Sun Mar  9 10:08:46 2014
@@ -475,9 +475,10 @@ create_log_body(serf_bucket_t **body_bkt
 
   if (log_ctx->move_behavior != svn_move_behavior_no_moves)
     {
+      const char *value = svn_move_behavior_to_word(log_ctx->move_behavior);
       svn_ra_serf__add_tag_buckets(buckets,
                                    "S:move-behavior",
-                                   apr_ltoa(pool, log_ctx->move_behavior),
+                                   value,
                                    alloc);
     }
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/options.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/options.c Sun Mar  9 10:08:46 2014
@@ -481,14 +481,16 @@ svn_ra_serf__v1_get_activity_collection(
 svn_error_t *
 svn_ra_serf__exchange_capabilities(svn_ra_serf__session_t *serf_sess,
                                    const char **corrected_url,
-                                   apr_pool_t *pool)
+                                   apr_pool_t *result_pool,
+                                   apr_pool_t *scratch_pool)
 {
   options_context_t *opt_ctx;
 
   /* This routine automatically fills in serf_sess->capabilities */
-  SVN_ERR(create_options_req(&opt_ctx, serf_sess, serf_sess->conns[0], pool));
+  SVN_ERR(create_options_req(&opt_ctx, serf_sess, serf_sess->conns[0],
+                             scratch_pool));
 
-  SVN_ERR(svn_ra_serf__context_run_one(opt_ctx->handler, pool));
+  SVN_ERR(svn_ra_serf__context_run_one(opt_ctx->handler, scratch_pool));
 
   /* If our caller cares about server redirections, and our response
      carries such a thing, report as much.  We'll disregard ERR --
@@ -496,7 +498,7 @@ svn_ra_serf__exchange_capabilities(svn_r
      successfully parsing as XML or somesuch. */
   if (corrected_url && (opt_ctx->handler->sline.code == 301))
     {
-      *corrected_url = opt_ctx->handler->location;
+      *corrected_url = apr_pstrdup(result_pool, opt_ctx->handler->location);
       return SVN_NO_ERROR;
     }
 
@@ -594,7 +596,7 @@ svn_ra_serf__has_capability(svn_ra_sessi
 
   /* If any capability is unknown, they're all unknown, so ask. */
   if (cap_result == NULL)
-    SVN_ERR(svn_ra_serf__exchange_capabilities(serf_sess, NULL, pool));
+    SVN_ERR(svn_ra_serf__exchange_capabilities(serf_sess, NULL, pool, pool));
 
   /* Try again, now that we've fetched the capabilities. */
   cap_result = svn_hash_gets(serf_sess->capabilities, capability);

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/ra_serf.h?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/ra_serf.h Sun Mar  9 10:08:46 2014
@@ -1582,7 +1582,8 @@ svn_ra_serf__get_mergeinfo(svn_ra_sessio
 svn_error_t *
 svn_ra_serf__exchange_capabilities(svn_ra_serf__session_t *serf_sess,
                                    const char **corrected_url,
-                                   apr_pool_t *pool);
+                                   apr_pool_t *result_pool,
+                                   apr_pool_t *scratch_pool);
 
 /* Implements svn_ra__vtable_t.has_capability(). */
 svn_error_t *

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/serf.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/serf.c Sun Mar  9 10:08:46 2014
@@ -489,6 +489,7 @@ svn_ra_serf__open(svn_ra_session_t *sess
   apr_uri_t url;
   const char *client_string = NULL;
   svn_error_t *err;
+  apr_pool_t *subpool;
 
   if (corrected_url)
     *corrected_url = NULL;
@@ -584,12 +585,16 @@ svn_ra_serf__open(svn_ra_session_t *sess
 
   session->priv = serf_sess;
 
-  err = svn_ra_serf__exchange_capabilities(serf_sess, corrected_url, pool);
+  subpool = svn_pool_create(pool);
+
+  err = svn_ra_serf__exchange_capabilities(serf_sess, corrected_url,
+                                           pool, subpool);
 
   /* serf should produce a usable error code instead of APR_EGENERAL */
   if (err && err->apr_err == APR_EGENERAL)
     err = svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, err,
                             _("Connection to '%s' failed"), session_URL);
+  svn_pool_clear(subpool);
   SVN_ERR(err);
 
   /* We have set up a useful connection (that doesn't indication a redirect).
@@ -598,7 +603,9 @@ svn_ra_serf__open(svn_ra_session_t *sess
      problems in any proxy.  */
   if ((corrected_url == NULL || *corrected_url == NULL)
       && serf_sess->detect_chunking && !serf_sess->http10)
-    SVN_ERR(svn_ra_serf__probe_proxy(serf_sess, pool));
+    SVN_ERR(svn_ra_serf__probe_proxy(serf_sess, subpool));
+
+  svn_pool_destroy(subpool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/stat.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/stat.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/stat.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/stat.c Sun Mar  9 10:08:46 2014
@@ -172,7 +172,7 @@ dirent_walker(void *baton,
         }
       else if (strcmp(name, "creator-displayname") == 0)
         {
-          dwb->entry->last_author = val->data;
+          dwb->entry->last_author = apr_pstrdup(dwb->result_pool, val->data);
         }
       else if (strcmp(name, SVN_DAV__CREATIONDATE) == 0)
         {

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/update.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/update.c Sun Mar  9 10:08:46 2014
@@ -570,9 +570,7 @@ body_done_fn(void *baton)
         */
 
       SVN_ERR(svn_io_file_flush(bcb->file, bcb->scratch_pool));
-#if APR_VERSION_AT_LEAST(1, 3, 0)
       apr_file_buffer_set(bcb->file, NULL, 0);
-#endif
     }
   else if (bcb->collect_bucket)
     bcb->all_data = body_allocate_all(bcb, bcb->result_pool);

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/util.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/util.c Sun Mar  9 10:08:46 2014
@@ -131,6 +131,7 @@ construct_realm(svn_ra_serf__session_t *
 static char *
 convert_organisation_to_str(apr_hash_t *org, apr_pool_t *pool)
 {
+  const char *cn = svn_hash_gets(org, "CN");
   const char *org_unit = svn_hash_gets(org, "OU");
   const char *org_name = svn_hash_gets(org, "O");
   const char *locality = svn_hash_gets(org, "L");
@@ -139,6 +140,12 @@ convert_organisation_to_str(apr_hash_t *
   const char *email = svn_hash_gets(org, "E");
   svn_stringbuf_t *buf = svn_stringbuf_create_empty(pool);
 
+  if (cn)
+    {
+      svn_stringbuf_appendcstr(buf, cn);
+      svn_stringbuf_appendcstr(buf, ", ");
+    }
+
   if (org_unit)
     {
       svn_stringbuf_appendcstr(buf, org_unit);

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/xml.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/xml.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/xml.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_serf/xml.c Sun Mar  9 10:08:46 2014
@@ -57,7 +57,7 @@
  || ((major) == XML_MAJOR_VERSION && (minor) < XML_MINOR_VERSION)    \
  || ((major) == XML_MAJOR_VERSION && (minor) == XML_MINOR_VERSION && \
      (patch) <= XML_MICRO_VERSION))
-#endif /* APR_VERSION_AT_LEAST */
+#endif /* XML_VERSION_AT_LEAST */
 
 /* Read/write chunks of this size into the spillbuf.  */
 #define PARSE_CHUNK_SIZE 8000

Propchange: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_svn/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sun Mar  9 10:08:46 2014
@@ -7,3 +7,5 @@ Debug
 *.o
 *~
 .*~
+libsvn_ra_svn.pc.in
+libsvn_ra_svn.pc

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_svn/client.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_svn/client.c Sun Mar  9 10:08:46 2014
@@ -1674,13 +1674,13 @@ perform_ra_svn_log(svn_error_t **outer_e
           else
             want_custom_revprops = TRUE;
         }
-      SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!)n)",
-                                      (apr_uint64_t) move_behavior));
+      SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!)w)",
+                                svn_move_behavior_to_word(move_behavior)));
     }
   else
     {
-      SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!w()n)", "all-revprops",
-                                      (apr_uint64_t) move_behavior));
+      SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!w()w)", "all-revprops",
+                                svn_move_behavior_to_word(move_behavior)));
 
       want_author = TRUE;
       want_date = TRUE;

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_svn/protocol
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_svn/protocol?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_svn/protocol (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_ra_svn/protocol Sun Mar  9 10:08:46 2014
@@ -337,7 +337,7 @@ second place for auth-request point as n
 
   get-mergeinfo
     params:   ( ( path:string ... ) [ rev:number ] inherit:word 
-                descendents:bool)
+                descendants:bool)
     response: ( ( ( path:string merge-info:string ) ... ) )
     New in svn 1.5.  If no paths are specified, an empty response is
     returned.  If rev is not specified, the youngest revision is used.
@@ -383,12 +383,11 @@ second place for auth-request point as n
                 ? limit:number
                 ? include-merged-revisions:bool
                 all-revprops | revprops ( revprop:string ... )
-                ? move-behavior:number )
+                ? move-behavior:word )
     Before sending response, server sends log entries, ending with "done".
     If a client does not want to specify a limit, it should send 0 as the
     limit parameter.  rev-props excludes author, date, and log; they are
     sent separately for backwards-compatibility.
-    Move-behavior is encoded like enum svn_move_behavior_t.
     log-entry: ( ( change:changed-path-entry ... ) rev:number
                  [ author:string ] [ date:string ] [ message:string ]
                  ? has-children:bool invalid-revnum:bool

Propchange: subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sun Mar  9 10:08:46 2014
@@ -8,3 +8,5 @@ Release
 *~
 .*~
 libsvn_repos.def
+libsvn_repos.pc.in
+libsvn_repos.pc

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/delta.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/delta.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/delta.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/delta.c Sun Mar  9 10:08:46 2014
@@ -523,8 +523,8 @@ delta_proplists(struct context *c,
       svn_boolean_t changed;
 
       /* Is this deltification worth our time? */
-      SVN_ERR(svn_fs_props_changed(&changed, c->target_root, target_path,
-                                   c->source_root, source_path, subpool));
+      SVN_ERR(svn_fs_props_different(&changed, c->target_root, target_path,
+                                     c->source_root, source_path, subpool));
       if (! changed)
         goto cleanup;
 
@@ -604,62 +604,8 @@ svn_repos__compare_files(svn_boolean_t *
                          const char *path2,
                          apr_pool_t *pool)
 {
-  svn_filesize_t size1, size2;
-  svn_checksum_t *checksum1, *checksum2;
-  svn_stream_t *stream1, *stream2;
-  svn_boolean_t same;
-
-  /* If the filesystem claims the things haven't changed, then they
-     haven't changed. */
-  SVN_ERR(svn_fs_contents_changed(changed_p, root1, path1,
-                                  root2, path2, pool));
-  if (!*changed_p)
-    return SVN_NO_ERROR;
-
-  /* If the SHA1 checksums match for these things, we'll claim they
-     have the same contents.  (We don't give quite as much weight to
-     MD5 checksums.)  */
-  SVN_ERR(svn_fs_file_checksum(&checksum1, svn_checksum_sha1,
-                               root1, path1, FALSE, pool));
-  SVN_ERR(svn_fs_file_checksum(&checksum2, svn_checksum_sha1,
-                               root2, path2, FALSE, pool));
-  if (checksum1 && checksum2)
-    {
-      *changed_p = !svn_checksum_match(checksum1, checksum2);
-      return SVN_NO_ERROR;
-    }
-
-  /* From this point on, our default answer is "Nothing's changed". */
-  *changed_p = FALSE;
-
-  /* Different filesizes means the contents are different. */
-  SVN_ERR(svn_fs_file_length(&size1, root1, path1, pool));
-  SVN_ERR(svn_fs_file_length(&size2, root2, path2, pool));
-  if (size1 != size2)
-    {
-      *changed_p = TRUE;
-      return SVN_NO_ERROR;
-    }
-
-  /* Different MD5 checksums means the contents are different. */
-  SVN_ERR(svn_fs_file_checksum(&checksum1, svn_checksum_md5, root1, path1,
-                               FALSE, pool));
-  SVN_ERR(svn_fs_file_checksum(&checksum2, svn_checksum_md5, root2, path2,
-                               FALSE, pool));
-  if (! svn_checksum_match(checksum1, checksum2))
-    {
-      *changed_p = TRUE;
-      return SVN_NO_ERROR;
-    }
-
-  /* And finally, different contents means the ... uh ... contents are
-     different. */
-  SVN_ERR(svn_fs_file_contents(&stream1, root1, path1, pool));
-  SVN_ERR(svn_fs_file_contents(&stream2, root2, path2, pool));
-  SVN_ERR(svn_stream_contents_same2(&same, stream1, stream2, pool));
-  *changed_p = !same;
-
-  return SVN_NO_ERROR;
+  return svn_error_trace(svn_fs_contents_different(changed_p, root1, path1,
+                                                   root2, path2, pool));
 }
 
 
@@ -686,19 +632,7 @@ delta_files(struct context *c,
 
   if (source_path)
     {
-      /* Is this delta calculation worth our time?  If we are ignoring
-         ancestry, then our editor implementor isn't concerned by the
-         theoretical differences between "has contents which have not
-         changed with respect to" and "has the same actual contents
-         as".  We'll do everything we can to avoid transmitting even
-         an empty text-delta in that case.  */
-      if (c->ignore_ancestry)
-        SVN_ERR(svn_repos__compare_files(&changed,
-                                         c->target_root, target_path,
-                                         c->source_root, source_path,
-                                         subpool));
-      else
-        SVN_ERR(svn_fs_contents_changed(&changed,
+      SVN_ERR(svn_fs_contents_different(&changed,
                                         c->target_root, target_path,
                                         c->source_root, source_path,
                                         subpool));
@@ -941,10 +875,10 @@ delta_dirs(struct context *c,
      from the target tree. */
   for (hi = apr_hash_first(pool, t_entries); hi; hi = apr_hash_next(hi))
     {
-      const svn_fs_dirent_t *s_entry, *t_entry;
-      const void *key;
-      void *val;
-      apr_ssize_t klen;
+      const void *key = svn__apr_hash_index_key(hi);
+      apr_ssize_t klen = svn__apr_hash_index_klen(hi);
+      const svn_fs_dirent_t *t_entry = svn__apr_hash_index_val(hi);
+      const svn_fs_dirent_t *s_entry;
       const char *t_fullpath;
       const char *e_fullpath;
       const char *s_fullpath;
@@ -953,9 +887,6 @@ delta_dirs(struct context *c,
       /* Clear out our subpool for the next iteration... */
       svn_pool_clear(subpool);
 
-      /* KEY is the entry name in target, VAL the dirent */
-      apr_hash_this(hi, &key, &klen, &val);
-      t_entry = val;
       tgt_kind = t_entry->kind;
       t_fullpath = svn_relpath_join(target_path, t_entry->name, subpool);
       e_fullpath = svn_relpath_join(edit_path, t_entry->name, subpool);
@@ -1030,17 +961,13 @@ delta_dirs(struct context *c,
     {
       for (hi = apr_hash_first(pool, s_entries); hi; hi = apr_hash_next(hi))
         {
-          const svn_fs_dirent_t *s_entry;
-          void *val;
+          const svn_fs_dirent_t *s_entry = svn__apr_hash_index_val(hi);
           const char *e_fullpath;
           svn_node_kind_t src_kind;
 
           /* Clear out our subpool for the next iteration... */
           svn_pool_clear(subpool);
 
-          /* KEY is the entry name in source, VAL the dirent */
-          apr_hash_this(hi, NULL, NULL, &val);
-          s_entry = val;
           src_kind = s_entry->kind;
           e_fullpath = svn_relpath_join(edit_path, s_entry->name, subpool);
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/dump.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/dump.c Sun Mar  9 10:08:46 2014
@@ -21,6 +21,8 @@
  */
 
 
+#include <stdarg.h>
+
 #include "svn_private_config.h"
 #include "svn_pools.h"
 #include "svn_error.h"
@@ -350,6 +352,34 @@ store_delta(apr_file_t **tempfile, svn_f
 }
 
 
+/* Send a notification of type #svn_repos_notify_warning, subtype WARNING,
+   with message WARNING_FMT formatted with the remaining variable arguments.
+   Send it by calling NOTIFY_FUNC (if not null) with NOTIFY_BATON.
+ */
+static void
+notify_warning(apr_pool_t *scratch_pool,
+               svn_repos_notify_func_t notify_func,
+               void *notify_baton,
+               svn_repos_notify_warning_t warning,
+               const char *warning_fmt,
+               ...)
+{
+  va_list va;
+  svn_repos_notify_t *notify;
+
+  if (notify_func == NULL)
+    return;
+
+  notify = svn_repos_notify_create(svn_repos_notify_warning, scratch_pool);
+  notify->warning = warning;
+  va_start(va, warning_fmt);
+  notify->warning_str = apr_pvsprintf(scratch_pool, warning_fmt, va);
+  va_end(va);
+
+  notify_func(notify_baton, notify, scratch_pool);
+}
+
+
 /*----------------------------------------------------------------------*/
 
 /** An editor which dumps node-data in 'dumpfile format' to a file. **/
@@ -586,6 +616,43 @@ node_must_not_exist(struct edit_baton *e
   return SVN_NO_ERROR;
 }
 
+/* If the mergeinfo in MERGEINFO_STR refers to any revisions older than
+ * OLDEST_DUMPED_REV, issue a warning and set *FOUND_OLD_MERGEINFO to TRUE,
+ * otherwise leave *FOUND_OLD_MERGEINFO unchanged.
+ */
+static svn_error_t *
+verify_mergeinfo_revisions(svn_boolean_t *found_old_mergeinfo,
+                           const char *mergeinfo_str,
+                           svn_revnum_t oldest_dumped_rev,
+                           svn_repos_notify_func_t notify_func,
+                           void *notify_baton,
+                           apr_pool_t *pool)
+{
+  svn_mergeinfo_t mergeinfo, old_mergeinfo;
+
+  SVN_ERR(svn_mergeinfo_parse(&mergeinfo, mergeinfo_str, pool));
+  SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(
+            &old_mergeinfo, mergeinfo,
+            oldest_dumped_rev - 1, 0,
+            TRUE, pool, pool));
+
+  if (apr_hash_count(old_mergeinfo))
+    {
+      notify_warning(pool, notify_func, notify_baton,
+                     svn_repos_notify_warning_found_old_mergeinfo,
+                     _("Mergeinfo referencing revision(s) prior "
+                       "to the oldest dumped revision (r%ld). "
+                       "Loading this dump may result in invalid "
+                       "mergeinfo."),
+                     oldest_dumped_rev);
+
+      if (found_old_mergeinfo)
+        *found_old_mergeinfo = TRUE;
+    }
+
+  return SVN_NO_ERROR;
+}
+
 /* Unique string pointers used by verify_mergeinfo_normalization()
    and check_name_collision() */
 static const char normalized_unique[] = "normalized_unique";
@@ -676,19 +743,15 @@ verify_mergeinfo_normalization(void *bat
   else
     {
       /* Report path collision in mergeinfo */
-      svn_repos_notify_t *notify;
-
       svn_hash_sets(vb->normalized_paths,
                     apr_pstrdup(vb->buffer.pool, normpath),
                     normalized_collision);
 
-      notify = svn_repos_notify_create(svn_repos_notify_warning, iterpool);
-      notify->warning = svn_repos_notify_warning_mergeinfo_collision;
-      notify->warning_str = apr_psprintf(
-          iterpool, _("Duplicate representation of path '%s'"
-                  " in %s property of '%s'"),
-          normpath, SVN_PROP_MERGEINFO, vb->path);
-      vb->notify_func(vb->notify_baton, notify, iterpool);
+      notify_warning(iterpool, vb->notify_func, vb->notify_baton,
+                     svn_repos_notify_warning_mergeinfo_collision,
+                     _("Duplicate representation of path '%s'"
+                       " in %s property of '%s'"),
+                     normpath, SVN_PROP_MERGEINFO, vb->path);
     }
   return SVN_NO_ERROR;
 }
@@ -799,17 +862,12 @@ dump_node(struct edit_baton *eb,
           if (eb->notify_func)
             {
               char errbuf[512]; /* ### svn_strerror() magic number  */
-              svn_repos_notify_t *notify;
-              notify = svn_repos_notify_create(svn_repos_notify_warning, pool);
-
-              notify->warning = svn_repos_notify_warning_invalid_fspath;
-              notify->warning_str = apr_psprintf(
-                     pool,
-                     _("E%06d: While validating fspath '%s': %s"),
-                     err->apr_err, path,
-                     svn_err_best_message(err, errbuf, sizeof(errbuf)));
 
-              eb->notify_func(eb->notify_baton, notify, pool);
+              notify_warning(pool, eb->notify_func, eb->notify_baton,
+                             svn_repos_notify_warning_invalid_fspath,
+                             _("E%06d: While validating fspath '%s': %s"),
+                             err->apr_err, path,
+                             svn_err_best_message(err, errbuf, sizeof(errbuf)));
             }
 
           /* Return the error in addition to notifying about it. */
@@ -857,13 +915,13 @@ dump_node(struct edit_baton *eb,
                                    svn_fs_root_fs(eb->fs_root),
                                    compare_rev, pool));
 
-      SVN_ERR(svn_fs_props_changed(&must_dump_props,
-                                   compare_root, compare_path,
-                                   eb->fs_root, path, pool));
+      SVN_ERR(svn_fs_props_different(&must_dump_props,
+                                     compare_root, compare_path,
+                                     eb->fs_root, path, pool));
       if (kind == svn_node_file)
-        SVN_ERR(svn_fs_contents_changed(&must_dump_text,
-                                        compare_root, compare_path,
-                                        eb->fs_root, path, pool));
+        SVN_ERR(svn_fs_contents_different(&must_dump_text,
+                                          compare_root, compare_path,
+                                          eb->fs_root, path, pool));
     }
   else if (action == svn_node_action_replace)
     {
@@ -979,21 +1037,16 @@ dump_node(struct edit_baton *eb,
           if (!eb->verify && cmp_rev < eb->oldest_dumped_rev
               && eb->notify_func)
             {
-              svn_repos_notify_t *notify =
-                    svn_repos_notify_create(svn_repos_notify_warning, pool);
-
-              notify->warning = svn_repos_notify_warning_found_old_reference;
-              notify->warning_str = apr_psprintf(
-                     pool,
-                     _("Referencing data in revision %ld,"
-                       " which is older than the oldest"
-                       " dumped revision (r%ld).  Loading this dump"
-                       " into an empty repository"
-                       " will fail."),
-                     cmp_rev, eb->oldest_dumped_rev);
+              notify_warning(pool, eb->notify_func, eb->notify_baton,
+                             svn_repos_notify_warning_found_old_reference,
+                             _("Referencing data in revision %ld,"
+                               " which is older than the oldest"
+                               " dumped revision (r%ld).  Loading this dump"
+                               " into an empty repository"
+                               " will fail."),
+                             cmp_rev, eb->oldest_dumped_rev);
               if (eb->found_old_reference)
                 *eb->found_old_reference = TRUE;
-              eb->notify_func(eb->notify_baton, notify, pool);
             }
 
           SVN_ERR(svn_stream_printf(eb->stream, pool,
@@ -1009,16 +1062,16 @@ dump_node(struct edit_baton *eb,
 
           /* Need to decide if the copied node had any extra textual or
              property mods as well.  */
-          SVN_ERR(svn_fs_props_changed(&must_dump_props,
-                                       compare_root, compare_path,
-                                       eb->fs_root, path, pool));
+          SVN_ERR(svn_fs_props_different(&must_dump_props,
+                                         compare_root, compare_path,
+                                         eb->fs_root, path, pool));
           if (kind == svn_node_file)
             {
               svn_checksum_t *checksum;
               const char *hex_digest;
-              SVN_ERR(svn_fs_contents_changed(&must_dump_text,
-                                              compare_root, compare_path,
-                                              eb->fs_root, path, pool));
+              SVN_ERR(svn_fs_contents_different(&must_dump_text,
+                                                compare_root, compare_path,
+                                                eb->fs_root, path, pool));
 
               SVN_ERR(svn_fs_file_checksum(&checksum, svn_checksum_md5,
                                            compare_root, compare_path,
@@ -1074,32 +1127,13 @@ dump_node(struct edit_baton *eb,
                                                       SVN_PROP_MERGEINFO);
           if (mergeinfo_str)
             {
-              svn_mergeinfo_t mergeinfo, old_mergeinfo;
-
-              SVN_ERR(svn_mergeinfo_parse(&mergeinfo, mergeinfo_str->data,
-                                          pool));
-              SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(
-                &old_mergeinfo, mergeinfo,
-                eb->oldest_dumped_rev - 1, 0,
-                TRUE, pool, pool));
-              if (apr_hash_count(old_mergeinfo))
-                {
-                  svn_repos_notify_t *notify =
-                    svn_repos_notify_create(svn_repos_notify_warning, pool);
-
-                  notify->warning = svn_repos_notify_warning_found_old_mergeinfo;
-                  notify->warning_str = apr_psprintf(
-                    pool,
-                    _("Mergeinfo referencing revision(s) prior "
-                      "to the oldest dumped revision (r%ld). "
-                      "Loading this dump may result in invalid "
-                      "mergeinfo."),
-                    eb->oldest_dumped_rev);
-
-                  if (eb->found_old_mergeinfo)
-                    *eb->found_old_mergeinfo = TRUE;
-                  eb->notify_func(eb->notify_baton, notify, pool);
-                }
+              /* An error in verifying the mergeinfo must not prevent dumping
+                 the data. Ignore any such error. */
+              svn_error_clear(verify_mergeinfo_revisions(
+                                eb->found_old_mergeinfo,
+                                mergeinfo_str->data, eb->oldest_dumped_rev,
+                                eb->notify_func, eb->notify_baton,
+                                pool));
             }
         }
 
@@ -1888,28 +1922,24 @@ svn_repos_dump_fs3(svn_repos_t *repos,
 
       if (found_old_reference)
         {
-          notify = svn_repos_notify_create(svn_repos_notify_warning, subpool);
-
-          notify->warning = svn_repos_notify_warning_found_old_reference;
-          notify->warning_str = _("The range of revisions dumped "
-                                  "contained references to "
-                                  "copy sources outside that "
-                                  "range.");
-          notify_func(notify_baton, notify, subpool);
+          notify_warning(subpool, notify_func, notify_baton,
+                         svn_repos_notify_warning_found_old_reference,
+                         _("The range of revisions dumped "
+                           "contained references to "
+                           "copy sources outside that "
+                           "range."));
         }
 
       /* Ditto if we issued any warnings about old revisions referenced
          in dumped mergeinfo. */
       if (found_old_mergeinfo)
         {
-          notify = svn_repos_notify_create(svn_repos_notify_warning, subpool);
-
-          notify->warning = svn_repos_notify_warning_found_old_mergeinfo;
-          notify->warning_str = _("The range of revisions dumped "
-                                  "contained mergeinfo "
-                                  "which reference revisions outside "
-                                  "that range.");
-          notify_func(notify_baton, notify, subpool);
+          notify_warning(subpool, notify_func, notify_baton,
+                         svn_repos_notify_warning_found_old_mergeinfo,
+                         _("The range of revisions dumped "
+                           "contained mergeinfo "
+                           "which reference revisions outside "
+                           "that range."));
         }
     }
 
@@ -1989,7 +2019,7 @@ struct check_name_collision_baton
 };
 
 /* Scan the directory and report all entry names that differ only in
-   Unicode character representaiton. */
+   Unicode character representation. */
 static svn_error_t *
 check_name_collision(void *baton, const void *key, apr_ssize_t klen,
                      void *val, apr_pool_t *iterpool)
@@ -2010,7 +2040,6 @@ check_name_collision(void *baton, const 
     {
       struct dir_baton *const db = cb->dir_baton;
       struct edit_baton *const eb = db->edit_baton;
-      svn_repos_notify_t *notify;
       const char* normpath;
 
       svn_hash_sets(cb->normalized, apr_pstrdup(cb->buffer.pool, name),
@@ -2019,11 +2048,9 @@ check_name_collision(void *baton, const 
       SVN_ERR(svn_utf__normalize(
                   &normpath, svn_relpath_join(db->path, name, iterpool),
                   SVN_UTF__UNKNOWN_LENGTH, &cb->buffer));
-      notify = svn_repos_notify_create(svn_repos_notify_warning, iterpool);
-      notify->warning = svn_repos_notify_warning_name_collision;
-      notify->warning_str = apr_psprintf(
-          iterpool, _("Duplicate representation of path '%s'"), normpath);
-      eb->notify_func(eb->notify_baton, notify, iterpool);
+      notify_warning(iterpool, eb->notify_func, eb->notify_baton,
+                     svn_repos_notify_warning_name_collision,
+                     _("Duplicate representation of path '%s'"), normpath);
     }
   return SVN_NO_ERROR;
 }
@@ -2193,8 +2220,8 @@ svn_repos_verify_fs3(svn_repos_t *repos,
      forwarding structure for notifications from inside svn_fs_verify(). */
   if (notify_func)
     {
-      notify = svn_repos_notify_create(svn_repos_notify_verify_rev_end,
-                                       pool);
+      notify = svn_repos_notify_create(svn_repos_notify_verify_rev_end, pool);
+
       verify_notify = verify_fs2_notify_func;
       verify_notify_baton = apr_palloc(pool, sizeof(*verify_notify_baton));
       verify_notify_baton->notify_func = notify_func;
@@ -2220,6 +2247,8 @@ svn_repos_verify_fs3(svn_repos_t *repos,
       svn_error_clear(err);
 
       if (!keep_going)
+        /* ### Jump to "We're done" and so send the final notification,
+               for consistency? */
         return svn_error_createf(SVN_ERR_REPOS_CORRUPTED, NULL,
                                 _("Repository '%s' failed to verify"),
                                 svn_dirent_local_style(svn_repos_path(repos,
@@ -2267,7 +2296,6 @@ svn_repos_verify_fs3(svn_repos_t *repos,
       notify_func(notify_baton, notify, iterpool);
     }
 
-  /* Per-backend verification. */
   svn_pool_destroy(iterpool);
 
   if (found_corruption)

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/fs-wrap.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/fs-wrap.c Sun Mar  9 10:08:46 2014
@@ -75,8 +75,7 @@ svn_repos_fs_commit_txn(const char **con
   iterpool = svn_pool_create(pool);
   for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
     {
-      const void *key;
-      apr_hash_this(hi, &key, NULL, NULL);
+      const char *key = svn__apr_hash_index_key(hi);
 
       svn_pool_clear(iterpool);
 
@@ -96,9 +95,8 @@ svn_repos_fs_commit_txn(const char **con
       iterpool = svn_pool_create(pool);
       for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
         {
-          const void *key;
-          void *val;
-          apr_hash_this(hi, &key, NULL, &val);
+          const char *key = svn__apr_hash_index_key(hi);
+          svn_string_t *val = svn__apr_hash_index_val(hi);
 
           svn_pool_clear(iterpool);
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/hooks.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/hooks.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/hooks.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/hooks.c Sun Mar  9 10:08:46 2014
@@ -319,7 +319,7 @@ check_hook_cmd(const char *hook, svn_boo
 #ifdef WIN32
   /* For WIN32, we need to check with file name extension(s) added.
 
-     As Windows Scripting Host (.wsf) files can accomodate (at least)
+     As Windows Scripting Host (.wsf) files can accommodate (at least)
      JavaScript (.js) and VB Script (.vbs) code, extensions for the
      corresponding file types need not be enumerated explicitly. */
     ".exe", ".cmd", ".bat", ".wsf", /* ### Any other extensions? */
@@ -364,7 +364,7 @@ struct parse_hooks_env_option_baton {
    * options apply. */
   const char *section;
   apr_hash_t *hooks_env;
-} parse_hooks_env_option_baton;
+};
 
 /* An implementation of svn_config_enumerator2_t.
  * Set environment variable NAME to value VALUE in the environment for
@@ -394,7 +394,7 @@ parse_hooks_env_option(const char *name,
 struct parse_hooks_env_section_baton {
   svn_config_t *cfg;
   apr_hash_t *hooks_env;
-} parse_hooks_env_section_baton;
+};
 
 /* An implementation of svn_config_section_enumerator2_t. */
 static svn_boolean_t
@@ -520,11 +520,9 @@ lock_token_content(apr_file_t **handle, 
   for (hi = apr_hash_first(pool, lock_tokens); hi;
        hi = apr_hash_next(hi))
     {
-      void *val;
-      const char *path, *token;
+      const char *token = svn__apr_hash_index_key(hi);
+      const char *path = svn__apr_hash_index_val(hi);
 
-      apr_hash_this(hi, (void *)&token, NULL, &val);
-      path = val;
       svn_stringbuf_appendstr(lock_str,
         svn_stringbuf_createf(pool, "%s|%s\n",
                               svn_path_uri_autoescape(path, pool),

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/load-fs-vtable.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/load-fs-vtable.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/load-fs-vtable.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/load-fs-vtable.c Sun Mar  9 10:08:46 2014
@@ -202,17 +202,16 @@ prefix_mergeinfo_paths(svn_string_t **me
 {
   apr_hash_t *prefixed_mergeinfo, *mergeinfo;
   apr_hash_index_t *hi;
-  void *rangelist;
 
   SVN_ERR(svn_mergeinfo_parse(&mergeinfo, mergeinfo_orig->data, pool));
   prefixed_mergeinfo = apr_hash_make(pool);
   for (hi = apr_hash_first(pool, mergeinfo); hi; hi = apr_hash_next(hi))
     {
-      const void *key;
-      const char *path, *merge_source;
+      const char *merge_source = svn__apr_hash_index_key(hi);
+      svn_rangelist_t *rangelist = svn__apr_hash_index_val(hi);
+      const char *path;
 
-      apr_hash_this(hi, &key, NULL, &rangelist);
-      merge_source = svn_relpath_canonicalize(key, pool);
+      merge_source = svn_relpath_canonicalize(merge_source, pool);
 
       /* The svn:mergeinfo property syntax demands a repos abspath */
       path = svn_fspath__canonicalize(svn_relpath_join(parent_dir,
@@ -268,16 +267,10 @@ renumber_mergeinfo_revs(svn_string_t **f
 
   for (hi = apr_hash_first(subpool, mergeinfo); hi; hi = apr_hash_next(hi))
     {
-      const char *merge_source;
-      svn_rangelist_t *rangelist;
+      const char *merge_source = svn__apr_hash_index_key(hi);
+      svn_rangelist_t *rangelist = svn__apr_hash_index_val(hi);
       struct parse_baton *pb = rb->pb;
       int i;
-      const void *key;
-      void *val;
-
-      apr_hash_this(hi, &key, NULL, &val);
-      merge_source = key;
-      rangelist = val;
 
       /* Possibly renumber revisions in merge source's rangelist. */
       for (i = 0; i < rangelist->nelts; i++)
@@ -296,7 +289,7 @@ renumber_mergeinfo_revs(svn_string_t **f
                  inclusive there is one possible valid start revision that
                  won't be found in the PB->REV_MAP mapping of load stream
                  revsions to loaded revisions: The revision immediately
-                 preceeding the oldest revision from the load stream.
+                 preceding the oldest revision from the load stream.
                  This is a valid revision for mergeinfo, but not a valid
                  copy from revision (which PB->REV_MAP also maps for) so it
                  will never be in the mapping.
@@ -754,29 +747,27 @@ set_node_property(void *baton,
 
   if (strcmp(name, SVN_PROP_MERGEINFO) == 0)
     {
+      svn_string_t prop_val = *value;
       svn_string_t *renumbered_mergeinfo;
-      /* ### Need to cast away const. We cannot change the declaration of
-       * ### this function since it is part of svn_repos_parse_fns2_t. */
-      svn_string_t *prop_val = (svn_string_t *)value;
 
       /* Tolerate mergeinfo with "\r\n" line endings because some
          dumpstream sources might contain as much.  If so normalize
          the line endings to '\n' and make a notification to
          PARSE_BATON->FEEDBACK_STREAM that we have made this
          correction. */
-      if (strstr(prop_val->data, "\r"))
+      if (strstr(prop_val.data, "\r"))
         {
           const char *prop_eol_normalized;
 
-          SVN_ERR(svn_subst_translate_cstring2(prop_val->data,
+          SVN_ERR(svn_subst_translate_cstring2(prop_val.data,
                                                &prop_eol_normalized,
                                                "\n",  /* translate to LF */
                                                FALSE, /* no repair */
                                                NULL,  /* no keywords */
                                                FALSE, /* no expansion */
                                                nb->pool));
-          prop_val->data = prop_eol_normalized;
-          prop_val->len = strlen(prop_eol_normalized);
+          prop_val.data = prop_eol_normalized;
+          prop_val.len = strlen(prop_eol_normalized);
 
           if (pb->notify_func)
             {
@@ -786,7 +777,7 @@ set_node_property(void *baton,
         }
 
       /* Renumber mergeinfo as appropriate. */
-      SVN_ERR(renumber_mergeinfo_revs(&renumbered_mergeinfo, prop_val, rb,
+      SVN_ERR(renumber_mergeinfo_revs(&renumbered_mergeinfo, &prop_val, rb,
                                       nb->pool));
       value = renumbered_mergeinfo;
       if (pb->parent_dir)
@@ -838,9 +829,8 @@ remove_node_props(void *baton)
 
   for (hi = apr_hash_first(nb->pool, proplist); hi; hi = apr_hash_next(hi))
     {
-      const void *key;
+      const char *key = svn__apr_hash_index_key(hi);
 
-      apr_hash_this(hi, &key, NULL, NULL);
       SVN_ERR(change_node_prop(rb->txn_root, nb->path, key, NULL,
                                rb->pb->validate_props, nb->pool));
     }

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/log.c?rev=1575685&r1=1575684&r2=1575685&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/log.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/log.c Sun Mar  9 10:08:46 2014
@@ -39,9 +39,11 @@
 #include "svn_mergeinfo.h"
 #include "repos.h"
 #include "private/svn_fspath.h"
+#include "private/svn_fs_private.h"
 #include "private/svn_mergeinfo_private.h"
 #include "private/svn_subr_private.h"
 
+
 
 svn_error_t *
 svn_repos_check_revision_access(svn_repos_revision_access_level_t *access_level,
@@ -79,14 +81,11 @@ svn_repos_check_revision_access(svn_repo
   subpool = svn_pool_create(pool);
   for (hi = apr_hash_first(pool, changes); hi; hi = apr_hash_next(hi))
     {
-      const void *key;
-      void *val;
-      svn_fs_path_change2_t *change;
+      const char *key = svn__apr_hash_index_key(hi);
+      svn_fs_path_change2_t *change = svn__apr_hash_index_val(hi);
       svn_boolean_t readable;
 
       svn_pool_clear(subpool);
-      apr_hash_this(hi, &key, NULL, &val);
-      change = val;
 
       SVN_ERR(authz_read_func(&readable, rev_root, key,
                               authz_read_baton, subpool));
@@ -173,10 +172,7 @@ turn_moves_into_copies(apr_hash_t *chang
   apr_hash_index_t *hi;
   for (hi = apr_hash_first(pool, changes); hi; hi = apr_hash_next(hi))
     {
-      const char *key;
-      apr_ssize_t klen;
-      svn_log_changed_path2_t *change;
-      apr_hash_this(hi, (const void **)&key, &klen, (void**)&change);
+      svn_log_changed_path2_t *change = svn__apr_hash_index_val(hi);
 
       switch (change->action)
         {
@@ -216,8 +212,7 @@ turn_unique_copies_into_moves(apr_hash_t
 
   for (hi = apr_hash_first(pool, changes); hi; hi = apr_hash_next(hi))
     {
-      svn_log_changed_path2_t *change;
-      apr_hash_this(hi, NULL, NULL, (void**)&change);
+      svn_log_changed_path2_t *change = svn__apr_hash_index_val(hi);
 
       if (change->copyfrom_path && change->copyfrom_rev == revision-1)
         APR_ARRAY_PUSH(copy_sources, const char *)
@@ -256,11 +251,9 @@ turn_unique_copies_into_moves(apr_hash_t
 
   for (hi = apr_hash_first(pool, changes); hi; hi = apr_hash_next(hi))
     {
-      const char *key;
-      apr_ssize_t klen;
-      svn_log_changed_path2_t *change, *copy_from_change;
+      svn_log_changed_path2_t *change = svn__apr_hash_index_val(hi);
+      svn_log_changed_path2_t *copy_from_change;
 
-      apr_hash_this(hi, (const void **)&key, &klen, (void**)&change);
       if (   change->copyfrom_rev != revision-1
           || !change->copyfrom_path
           || !svn_hash_gets(unique_copy_sources, change->copyfrom_path))
@@ -351,17 +344,14 @@ detect_changed(apr_hash_t **changed,
       /* NOTE:  Much of this loop is going to look quite similar to
          svn_repos_check_revision_access(), but we have to do more things
          here, so we'll live with the duplication. */
-      svn_fs_path_change2_t *change;
-      const char *path;
-      apr_ssize_t path_len;
+      const char *path = svn__apr_hash_index_key(hi);
+      apr_ssize_t path_len = svn__apr_hash_index_klen(hi);
+      svn_fs_path_change2_t *change = svn__apr_hash_index_val(hi);
       char action;
       svn_log_changed_path2_t *item;
 
       svn_pool_clear(subpool);
 
-      /* KEY will be the path, VAL the change. */
-      apr_hash_this(hi, (const void **)&path, &path_len, (void **)&change);
-
       /* Skip path if unreadable. */
       if (authz_read_func)
         {
@@ -728,7 +718,7 @@ next_history_rev(const apr_array_header_
 
 /* Set *DELETED_MERGEINFO_CATALOG and *ADDED_MERGEINFO_CATALOG to
    catalogs describing how mergeinfo values on paths (which are the
-   keys of those catalogs) were changed in REV.  If *PREFETCHED_CAHNGES
+   keys of those catalogs) were changed in REV.  If *PREFETCHED_CHANGES
    already contains the changed paths for REV, use that.  Otherwise,
    request that data and return it in *PREFETCHED_CHANGES. */
 /* ### TODO: This would make a *great*, useful public function,
@@ -741,7 +731,6 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
                      svn_revnum_t rev,
                      apr_pool_t *result_pool,
                      apr_pool_t *scratch_pool)
-
 {
   svn_fs_root_t *root;
   apr_pool_t *iterpool;
@@ -773,21 +762,15 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
        hi;
        hi = apr_hash_next(hi))
     {
-      const void *key;
-      void *val;
-      svn_fs_path_change2_t *change;
-      const char *changed_path, *base_path = NULL;
+      const char *changed_path = svn__apr_hash_index_key(hi);
+      svn_fs_path_change2_t *change = svn__apr_hash_index_val(hi);
+      const char *base_path = NULL;
       svn_revnum_t base_rev = SVN_INVALID_REVNUM;
       svn_fs_root_t *base_root = NULL;
       svn_string_t *prev_mergeinfo_value = NULL, *mergeinfo_value;
 
       svn_pool_clear(iterpool);
 
-      /* KEY will be the path, VAL the change. */
-      apr_hash_this(hi, &key, NULL, &val);
-      changed_path = key;
-      change = val;
-
       /* If there was no mergeinfo change on this item, ignore it. */
       if (change->mergeinfo_mod == svn_tristate_false)
         continue;
@@ -805,23 +788,16 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
            ### modifies, NULL otherwise).  -- cmpilato  */
 
         /* If the path was added or replaced, see if it was created via
-           copy.  If so, that will tell us where its previous location
-           was.  If not, there's no previous location to examine.  */
+           copy.  If so, set BASE_REV/BASE_PATH to its previous location.
+           If not, there's no previous location to examine -- leave
+           BASE_REV/BASE_PATH = -1/NULL.  */
         case svn_fs_path_change_add:
         case svn_fs_path_change_replace:
         case svn_fs_path_change_move:
         case svn_fs_path_change_movereplace:
           {
-            const char *copyfrom_path;
-            svn_revnum_t copyfrom_rev;
-
-            SVN_ERR(svn_fs_copied_from(&copyfrom_rev, &copyfrom_path,
+            SVN_ERR(svn_fs_copied_from(&base_rev, &base_path,
                                        root, changed_path, iterpool));
-            if (copyfrom_path && SVN_IS_VALID_REVNUM(copyfrom_rev))
-              {
-                base_path = apr_pstrdup(scratch_pool, copyfrom_path);
-                base_rev = copyfrom_rev;
-              }
             break;
           }
 
@@ -882,16 +858,12 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
          inherited mergeinfo for that path/revision.  */
       if (prev_mergeinfo_value && (! mergeinfo_value))
         {
-          apr_array_header_t *query_paths =
-            apr_array_make(iterpool, 1, sizeof(const char *));
           svn_mergeinfo_t tmp_mergeinfo;
-          svn_mergeinfo_catalog_t tmp_catalog;
 
-          APR_ARRAY_PUSH(query_paths, const char *) = changed_path;
-          SVN_ERR(svn_fs_get_mergeinfo2(&tmp_catalog, root,
-                                        query_paths, svn_mergeinfo_inherited,
-                                        FALSE, TRUE, iterpool, iterpool));
-          tmp_mergeinfo = svn_hash_gets(tmp_catalog, changed_path);
+          SVN_ERR(svn_fs__get_mergeinfo_for_path(&tmp_mergeinfo,
+                                                 root, changed_path,
+                                                 svn_mergeinfo_inherited, TRUE,
+                                                 iterpool, iterpool));
           if (tmp_mergeinfo)
             SVN_ERR(svn_mergeinfo_to_string(&mergeinfo_value,
                                             tmp_mergeinfo,
@@ -900,16 +872,12 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
       else if (mergeinfo_value && (! prev_mergeinfo_value)
                && base_path && SVN_IS_VALID_REVNUM(base_rev))
         {
-          apr_array_header_t *query_paths =
-            apr_array_make(iterpool, 1, sizeof(const char *));
           svn_mergeinfo_t tmp_mergeinfo;
-          svn_mergeinfo_catalog_t tmp_catalog;
 
-          APR_ARRAY_PUSH(query_paths, const char *) = base_path;
-          SVN_ERR(svn_fs_get_mergeinfo2(&tmp_catalog, base_root,
-                                        query_paths, svn_mergeinfo_inherited,
-                                        FALSE, TRUE, iterpool, iterpool));
-          tmp_mergeinfo = svn_hash_gets(tmp_catalog, base_path);
+          SVN_ERR(svn_fs__get_mergeinfo_for_path(&tmp_mergeinfo,
+                                                 base_root, base_path,
+                                                 svn_mergeinfo_inherited, TRUE,
+                                                 iterpool, iterpool));
           if (tmp_mergeinfo)
             SVN_ERR(svn_mergeinfo_to_string(&prev_mergeinfo_value,
                                             tmp_mergeinfo,
@@ -953,9 +921,9 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
 /* Determine what (if any) mergeinfo for PATHS was modified in
    revision REV, returning the differences for added mergeinfo in
    *ADDED_MERGEINFO and deleted mergeinfo in *DELETED_MERGEINFO.
-   If *PREFETCHED_CAHNGES already contains the changed paths for
+   If *PREFETCHED_CHANGES already contains the changed paths for
    REV, use that.  Otherwise, request that data and return it in
-   *PREFETCHED_CHANGES.  Use POOL for all allocations. */
+   *PREFETCHED_CHANGES. */
 static svn_error_t *
 get_combined_mergeinfo_changes(svn_mergeinfo_t *added_mergeinfo,
                                svn_mergeinfo_t *deleted_mergeinfo,
@@ -1023,13 +991,10 @@ get_combined_mergeinfo_changes(svn_merge
     {
       const char *path = APR_ARRAY_IDX(paths, i, const char *);
       const char *prev_path;
-      apr_ssize_t klen;
       svn_revnum_t appeared_rev, prev_rev;
       svn_fs_root_t *prev_root;
-      svn_mergeinfo_catalog_t catalog, inherited_catalog;
       svn_mergeinfo_t prev_mergeinfo, mergeinfo, deleted, added,
         prev_inherited_mergeinfo, inherited_mergeinfo;
-      apr_array_header_t *query_paths;
 
       svn_pool_clear(iterpool);
 
@@ -1065,11 +1030,10 @@ get_combined_mergeinfo_changes(svn_merge
          this path.  Ignore not-found errors returned by the
          filesystem or invalid mergeinfo (Issue #3896).*/
       SVN_ERR(svn_fs_revision_root(&prev_root, fs, prev_rev, iterpool));
-      query_paths = apr_array_make(iterpool, 1, sizeof(const char *));
-      APR_ARRAY_PUSH(query_paths, const char *) = prev_path;
-      err = svn_fs_get_mergeinfo2(&catalog, prev_root, query_paths,
-                                  svn_mergeinfo_inherited, FALSE, TRUE,
-                                  iterpool, iterpool);
+      err = svn_fs__get_mergeinfo_for_path(&prev_mergeinfo,
+                                           prev_root, prev_path,
+                                           svn_mergeinfo_inherited, TRUE,
+                                           iterpool, iterpool);
       if (err && (err->apr_err == SVN_ERR_FS_NOT_FOUND ||
                   err->apr_err == SVN_ERR_FS_NOT_DIRECTORY ||
                   err->apr_err == SVN_ERR_MERGEINFO_PARSE_ERROR))
@@ -1089,31 +1053,25 @@ get_combined_mergeinfo_changes(svn_merge
 
          To check for this we must fetch the "raw" previous inherited
          mergeinfo and the "raw" mergeinfo @REV then compare these. */
-      SVN_ERR(svn_fs_get_mergeinfo2(&inherited_catalog, prev_root, query_paths,
-                                    svn_mergeinfo_nearest_ancestor, FALSE,
-                                    FALSE, /* adjust_inherited_mergeinfo */
-                                    iterpool, iterpool));
-
-      klen = strlen(prev_path);
-      prev_mergeinfo = apr_hash_get(catalog, prev_path, klen);
-      prev_inherited_mergeinfo = apr_hash_get(inherited_catalog, prev_path, klen);
+      SVN_ERR(svn_fs__get_mergeinfo_for_path(&prev_inherited_mergeinfo,
+                                             prev_root, prev_path,
+                                             svn_mergeinfo_nearest_ancestor,
+                                             FALSE, /* adjust_inherited_mergeinfo */
+                                             iterpool, iterpool));
 
       /* Fetch the current mergeinfo (as of REV, and including
          inherited stuff) for this path. */
-      APR_ARRAY_IDX(query_paths, 0, const char *) = path;
-      SVN_ERR(svn_fs_get_mergeinfo2(&catalog, root, query_paths,
-                                    svn_mergeinfo_inherited, FALSE, TRUE,
-                                    iterpool, iterpool));
+      SVN_ERR(svn_fs__get_mergeinfo_for_path(&mergeinfo,
+                                             root, path,
+                                             svn_mergeinfo_inherited, TRUE,
+                                             iterpool, iterpool));
 
       /* Issue #4022 again, fetch the raw inherited mergeinfo. */
-      SVN_ERR(svn_fs_get_mergeinfo2(&inherited_catalog, root, query_paths,
-                                    svn_mergeinfo_nearest_ancestor, FALSE,
-                                    FALSE, /* adjust_inherited_mergeinfo */
-                                    iterpool, iterpool));
-
-      klen = strlen(path);
-      mergeinfo = apr_hash_get(catalog, path, klen);
-      inherited_mergeinfo = apr_hash_get(inherited_catalog, path, klen);
+      SVN_ERR(svn_fs__get_mergeinfo_for_path(&inherited_mergeinfo,
+                                             root, path,
+                                             svn_mergeinfo_nearest_ancestor,
+                                             FALSE, /* adjust_inherited_mergeinfo */
+                                             iterpool, iterpool));
 
       if (!prev_mergeinfo && !mergeinfo)
         continue;
@@ -1137,7 +1095,7 @@ get_combined_mergeinfo_changes(svn_merge
           svn_boolean_t same_mergeinfo;
           SVN_ERR(svn_mergeinfo__equals(&same_mergeinfo,
                                         prev_inherited_mergeinfo,
-                                        FALSE,
+                                        NULL,
                                         TRUE, iterpool));
           if (same_mergeinfo)
             continue;
@@ -1157,16 +1115,10 @@ get_combined_mergeinfo_changes(svn_merge
   for (hi = apr_hash_first(scratch_pool, added_mergeinfo_catalog);
        hi; hi = apr_hash_next(hi))
     {
-      const void *key;
-      apr_ssize_t klen;
-      void *val;
-      const char *changed_path;
-      svn_mergeinfo_t added, deleted;
-
-      /* The path is the key, the mergeinfo delta is the value. */
-      apr_hash_this(hi, &key, &klen, &val);
-      changed_path = key;
-      added = val;
+      const char *changed_path = svn__apr_hash_index_key(hi);
+      apr_ssize_t klen = svn__apr_hash_index_klen(hi);
+      svn_mergeinfo_t added = svn__apr_hash_index_val(hi);
+      svn_mergeinfo_t deleted;
 
       for (i = 0; i < paths->nelts; i++)
         {
@@ -1174,7 +1126,7 @@ get_combined_mergeinfo_changes(svn_merge
           if (! svn_fspath__skip_ancestor(path, changed_path))
             continue;
           svn_pool_clear(iterpool);
-          deleted = apr_hash_get(deleted_mergeinfo_catalog, key, klen);
+          deleted = apr_hash_get(deleted_mergeinfo_catalog, changed_path, klen);
           SVN_ERR(svn_mergeinfo_merge2(*deleted_mergeinfo,
                                        svn_mergeinfo_dup(deleted, result_pool),
                                        result_pool, iterpool));
@@ -1399,18 +1351,14 @@ send_log(svn_revnum_t rev,
           const char *changed_path = svn__apr_hash_index_key(hi);
           apr_hash_index_t *hi2;
 
-          apr_hash_this(hi, (const void**)&changed_path, NULL, NULL);
-
           /* Look at each path on the log target's mergeinfo. */
           for (hi2 = apr_hash_first(iterpool,
                                     log_target_history_as_mergeinfo);
                hi2;
                hi2 = apr_hash_next(hi2))
             {
-              const char *mergeinfo_path;
-              svn_rangelist_t *rangelist;
-              apr_hash_this(hi2, (const void**)&mergeinfo_path, NULL,
-                                 (void **)&rangelist);
+              const char *mergeinfo_path = svn__apr_hash_index_key(hi2);
+              svn_rangelist_t *rangelist = svn__apr_hash_index_val(hi2);
 
               /* Check whether CHANGED_PATH at revision REV is a child of
                  a (path, revision) tuple in LOG_TARGET_HISTORY_AS_MERGEINFO. */
@@ -1687,8 +1635,9 @@ combine_mergeinfo_path_lists(apr_array_h
     {
       int i;
       struct rangelist_path *rp = apr_palloc(subpool, sizeof(*rp));
-      apr_hash_this(hi, (void *) &rp->path, NULL,
-                    (void *) &rp->rangelist);
+
+      rp->path = svn__apr_hash_index_key(hi);
+      rp->rangelist = svn__apr_hash_index_val(hi);
       APR_ARRAY_PUSH(rangelist_paths, struct rangelist_path *) = rp;
 
       /* We need to make local copies of the rangelist, since we will be
@@ -2260,19 +2209,18 @@ do_logs(svn_fs_t *fs,
 
               if (added_mergeinfo || deleted_mergeinfo)
                 {
-                  svn_revnum_t *cur_rev = apr_pcalloc(pool, sizeof(*cur_rev));
+                  svn_revnum_t *cur_rev =
+                    apr_pmemdup(pool, &current, sizeof(cur_rev));
                   struct added_deleted_mergeinfo *add_and_del_mergeinfo =
                     apr_palloc(pool, sizeof(*add_and_del_mergeinfo));
 
-                  if (added_mergeinfo)
-                    add_and_del_mergeinfo->added_mergeinfo =
-                      svn_mergeinfo_dup(added_mergeinfo, pool);
-
-                  if (deleted_mergeinfo)
-                    add_and_del_mergeinfo->deleted_mergeinfo =
-                      svn_mergeinfo_dup(deleted_mergeinfo, pool);
+                  /* If we have added or deleted mergeinfo, both are non-null */
+                  SVN_ERR_ASSERT(added_mergeinfo && deleted_mergeinfo);
+                  add_and_del_mergeinfo->added_mergeinfo =
+                    svn_mergeinfo_dup(added_mergeinfo, pool);
+                  add_and_del_mergeinfo->deleted_mergeinfo =
+                    svn_mergeinfo_dup(deleted_mergeinfo, pool);
 
-                  *cur_rev = current;
                   if (! rev_mergeinfo)
                     rev_mergeinfo = svn_hash__make(pool);
                   apr_hash_set(rev_mergeinfo, cur_rev, sizeof(*cur_rev),
@@ -2545,7 +2493,7 @@ svn_repos_get_logs5(svn_repos_t *repos,
         }
 
       send_count = end - start + 1;
-      if (limit && send_count > limit)
+      if (limit > 0 && send_count > limit)
         send_count = limit;
       for (i = 0; i < send_count; ++i)
         {



Mime
View raw message