subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1658477 - in /subversion/branches/fsx-1.10/subversion/libsvn_fs_x: dag_cache.h tree.c
Date Mon, 09 Feb 2015 17:23:06 GMT
Author: stefan2
Date: Mon Feb  9 17:23:05 2015
New Revision: 1658477

URL: http://svn.apache.org/r1658477
Log:
On the fsx-1.10 branch:  Make get_dag() an internal API function.
Don't move any implementation, yet.

* subversion/libsvn_fs_x/dag_cache.h
  (svn_fs_x__get_dag_node): Move declaration here from tree.c and
                            rename it.

* subversion/libsvn_fs_x/tree.c
  (get_dag): Remove forward declaration.
  (get_copy_inheritance,
   make_path_mutable): Update callers.
  (get_dag): Rename to ...
  (svn_fs_x__get_dag_node): ... this and don't be static anymore.
  (x_node_id,
   x_node_relation,
   svn_fs_x__node_created_rev,
   x_node_created_path,
   node_kind,
   x_node_prop,
   x_node_proplist,
   x_props_changed,
   get_root,
   x_dir_entries,
   copy_helper,
   x_copied_from,
   x_file_length,
   x_file_checksum,
   x_file_contents,
   x_try_process_file_contents,
   x_contents_changed,
   x_get_file_delta_stream,
   x_node_origin_rev,
   history_prev,
   crawl_directory_dag_for_mergeinfo,
   add_descendant_mergeinfo): Update callers.

Modified:
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.h
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.c

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.h?rev=1658477&r1=1658476&r2=1658477&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.h (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.h Mon Feb  9 17:23:05 2015
@@ -23,7 +23,7 @@
 #ifndef SVN_LIBSVN_FS_X_DAG_CACHE_H
 #define SVN_LIBSVN_FS_X_DAG_CACHE_H
 
-#include "svn_fs.h"
+#include "dag.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -33,6 +33,16 @@ extern "C" {
 svn_fs_x__dag_cache_t*
 svn_fs_x__create_dag_cache(apr_pool_t *result_pool);
 
+/* Open the node identified by PATH in ROOT.  Set DAG_NODE_P to the
+   node we find, allocated in POOL.  Return the error
+   SVN_ERR_FS_NOT_FOUND if this node doesn't exist.
+ */
+static svn_error_t *
+svn_fs_x__get_dag_node(dag_node_t **dag_node_p,
+                       svn_fs_root_t *root,
+                       const char *path,
+                       apr_pool_t *pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.c?rev=1658477&r1=1658476&r2=1658477&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.c Mon Feb  9 17:23:05 2015
@@ -97,13 +97,6 @@ typedef struct fs_txn_root_data_t
   svn_cache__t *txn_node_cache;
 } fs_txn_root_data_t;
 
-/* Declared here to resolve the circular dependencies. */
-static svn_error_t *
-get_dag(dag_node_t **dag_node_p,
-        svn_fs_root_t *root,
-        const char *path,
-        apr_pool_t *pool);
-
 static svn_fs_root_t *
 make_revision_root(svn_fs_t *fs,
                    svn_revnum_t rev,
@@ -749,7 +742,8 @@ get_copy_inheritance(copy_id_inherit_t *
   SVN_ERR(svn_fs_x__dag_get_copyroot(&copyroot_rev, &copyroot_path,
                                      child->node));
   SVN_ERR(svn_fs_x__revision_root(&copyroot_root, fs, copyroot_rev, pool));
-  SVN_ERR(get_dag(&copyroot_node, copyroot_root, copyroot_path, pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&copyroot_node, copyroot_root,
+                                 copyroot_path, pool));
 
   SVN_ERR(svn_fs_x__dag_related_node(&related, copyroot_node, child->node));
   if (!related)
@@ -1168,8 +1162,8 @@ make_path_mutable(svn_fs_root_t *root,
                                           parent_path->node));
       SVN_ERR(svn_fs_x__revision_root(&copyroot_root, root->fs,
                                       copyroot_rev, subpool));
-      SVN_ERR(get_dag(&copyroot_node, copyroot_root, copyroot_path,
-                      result_pool));
+      SVN_ERR(svn_fs_x__get_dag_node(&copyroot_node, copyroot_root,
+                                     copyroot_path, result_pool));
 
       SVN_ERR(svn_fs_x__dag_related_node(&related, copyroot_node,
                                          parent_path->node));
@@ -1206,15 +1200,11 @@ make_path_mutable(svn_fs_root_t *root,
 }
 
 
-/* Open the node identified by PATH in ROOT.  Set DAG_NODE_P to the
-   node we find, allocated in POOL.  Return the error
-   SVN_ERR_FS_NOT_FOUND if this node doesn't exist.
- */
-static svn_error_t *
-get_dag(dag_node_t **dag_node_p,
-        svn_fs_root_t *root,
-        const char *path,
-        apr_pool_t *pool)
+svn_error_t *
+svn_fs_x__get_dag_node(dag_node_t **dag_node_p,
+                       svn_fs_root_t *root,
+                       const char *path,
+                       apr_pool_t *pool)
 {
   parent_path_t *parent_path;
   dag_node_t *node = NULL;
@@ -1315,7 +1305,7 @@ x_node_id(const svn_fs_id_t **id_p,
       apr_pool_t *scratch_pool = svn_pool_create(pool);
       dag_node_t *node;
 
-      SVN_ERR(get_dag(&node, root, path, scratch_pool));
+      SVN_ERR(svn_fs_x__get_dag_node(&node, root, path, scratch_pool));
       noderev_id = *svn_fs_x__dag_get_id(node);
       svn_pool_destroy(scratch_pool);
     }
@@ -1370,11 +1360,11 @@ x_node_relation(svn_fs_node_relation_t *
 
   /* We checked for all separations between ID spaces (repos, txn).
    * Now, we can simply test for the ID values themselves. */
-  SVN_ERR(get_dag(&node, root_a, path_a, scratch_pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node, root_a, path_a, scratch_pool));
   noderev_id_a = *svn_fs_x__dag_get_id(node);
   SVN_ERR(svn_fs_x__dag_get_node_id(&node_id_a, node));
 
-  SVN_ERR(get_dag(&node, root_b, path_b, scratch_pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node, root_b, path_b, scratch_pool));
   noderev_id_b = *svn_fs_x__dag_get_id(node);
   SVN_ERR(svn_fs_x__dag_get_node_id(&node_id_b, node));
 
@@ -1396,7 +1386,7 @@ svn_fs_x__node_created_rev(svn_revnum_t
 {
   dag_node_t *node;
 
-  SVN_ERR(get_dag(&node, root, path, scratch_pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node, root, path, scratch_pool));
   *revision = svn_fs_x__dag_get_revision(node);
 
   return SVN_NO_ERROR;
@@ -1413,7 +1403,7 @@ x_node_created_path(const char **created
 {
   dag_node_t *node;
 
-  SVN_ERR(get_dag(&node, root, path, pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node, root, path, pool));
   *created_path = svn_fs_x__dag_get_created_path(node);
 
   return SVN_NO_ERROR;
@@ -1431,7 +1421,7 @@ node_kind(svn_node_kind_t *kind_p,
   dag_node_t *node;
 
   /* Get the node id. */
-  SVN_ERR(get_dag(&node, root, path, scratch_pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node, root, path, scratch_pool));
 
   /* Use the node id to get the real kind. */
   *kind_p = svn_fs_x__dag_node_kind(node);
@@ -1476,7 +1466,7 @@ x_node_prop(svn_string_t **value_p,
   apr_hash_t *proplist;
   apr_pool_t *scratch_pool = svn_pool_create(pool);
 
-  SVN_ERR(get_dag(&node, root, path,  pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node, root, path,  pool));
   SVN_ERR(svn_fs_x__dag_get_proplist(&proplist, node, pool, scratch_pool));
   *value_p = NULL;
   if (proplist)
@@ -1500,7 +1490,7 @@ x_node_proplist(apr_hash_t **table_p,
   dag_node_t *node;
   apr_pool_t *scratch_pool = svn_pool_create(pool);
 
-  SVN_ERR(get_dag(&node, root, path, pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node, root, path, pool));
   SVN_ERR(svn_fs_x__dag_get_proplist(table_p, node, pool, scratch_pool));
 
   svn_pool_destroy(scratch_pool);
@@ -1632,8 +1622,8 @@ x_props_changed(svn_boolean_t *changed_p
       (SVN_ERR_FS_GENERAL, NULL,
        _("Cannot compare property value between two different filesystems"));
 
-  SVN_ERR(get_dag(&node1, root1, path1, subpool));
-  SVN_ERR(get_dag(&node2, root2, path2, subpool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node1, root1, path1, subpool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node2, root2, path2, subpool));
   SVN_ERR(svn_fs_x__dag_things_different(changed_p, NULL, node1, node2,
                                          strict, subpool));
   svn_pool_destroy(subpool);
@@ -1649,7 +1639,7 @@ x_props_changed(svn_boolean_t *changed_p
 static svn_error_t *
 get_root(dag_node_t **node, svn_fs_root_t *root, apr_pool_t *pool)
 {
-  return get_dag(node, root, "/", pool);
+  return svn_fs_x__get_dag_node(node, root, "/", pool);
 }
 
 
@@ -2386,7 +2376,7 @@ x_dir_entries(apr_hash_t **table_p,
   apr_pool_t *scratch_pool = svn_pool_create(pool);
 
   /* Get the entries for this path in the caller's pool. */
-  SVN_ERR(get_dag(&node, root, path, scratch_pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node, root, path, scratch_pool));
   SVN_ERR(svn_fs_x__dag_dir_entries(&table, node, scratch_pool,
                                     scratch_pool));
 
@@ -2593,7 +2583,8 @@ copy_helper(svn_fs_root_t *from_root,
        _("Copy immutable tree not supported"));
 
   /* Get the NODE for FROM_PATH in FROM_ROOT.*/
-  SVN_ERR(get_dag(&from_node, from_root, from_path, scratch_pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&from_node, from_root, from_path,
+                                 scratch_pool));
 
   /* Build up the parent path from TO_PATH in TO_ROOT.  If the last
      component does not exist, it's not that big a deal.  We'll just
@@ -2667,7 +2658,8 @@ copy_helper(svn_fs_root_t *from_root,
                                             scratch_pool));
 
       /* Make a record of this modification in the changes table. */
-      SVN_ERR(get_dag(&new_node, to_root, to_path, scratch_pool));
+      SVN_ERR(svn_fs_x__get_dag_node(&new_node, to_root, to_path,
+                                     scratch_pool));
       SVN_ERR(add_change(to_root->fs, txn_id, to_path,
                          svn_fs_x__dag_get_id(new_node), kind, FALSE,
                          FALSE, FALSE, svn_fs_x__dag_node_kind(from_node),
@@ -2757,7 +2749,7 @@ x_copied_from(svn_revnum_t *rev_p,
 
   /* There is no cached entry, look it up the old-fashioned
       way. */
-  SVN_ERR(get_dag(&node, root, path, pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node, root, path, pool));
   SVN_ERR(svn_fs_x__dag_get_copyfrom_rev(rev_p, node));
   SVN_ERR(svn_fs_x__dag_get_copyfrom_path(path_p, node));
 
@@ -2831,7 +2823,7 @@ x_file_length(svn_filesize_t *length_p,
   dag_node_t *file;
 
   /* First create a dag_node_t from the root/path pair. */
-  SVN_ERR(get_dag(&file, root, path, scratch_pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&file, root, path, scratch_pool));
 
   /* Now fetch its length */
   return svn_fs_x__dag_file_length(length_p, file);
@@ -2850,7 +2842,7 @@ x_file_checksum(svn_checksum_t **checksu
 {
   dag_node_t *file;
 
-  SVN_ERR(get_dag(&file, root, path, pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&file, root, path, pool));
   return svn_fs_x__dag_file_checksum(checksum, file, kind, pool);
 }
 
@@ -2869,7 +2861,7 @@ x_file_contents(svn_stream_t **contents,
   svn_stream_t *file_stream;
 
   /* First create a dag_node_t from the root/path pair. */
-  SVN_ERR(get_dag(&node, root, path, pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node, root, path, pool));
 
   /* Then create a readable stream from the dag_node_t. */
   SVN_ERR(svn_fs_x__dag_get_contents(&file_stream, node, pool));
@@ -2892,7 +2884,7 @@ x_try_process_file_contents(svn_boolean_
                             apr_pool_t *pool)
 {
   dag_node_t *node;
-  SVN_ERR(get_dag(&node, root, path, pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node, root, path, pool));
 
   return svn_fs_x__dag_try_process_file_contents(success, node,
                                                  processor, baton, pool);
@@ -3229,8 +3221,8 @@ x_contents_changed(svn_boolean_t *change
         (SVN_ERR_FS_GENERAL, NULL, _("'%s' is not a file"), path2);
   }
 
-  SVN_ERR(get_dag(&node1, root1, path1, subpool));
-  SVN_ERR(get_dag(&node2, root2, path2, subpool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node1, root1, path1, subpool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node2, root2, path2, subpool));
   SVN_ERR(svn_fs_x__dag_things_different(NULL, changed_p, node1, node2,
                                          strict, subpool));
 
@@ -3254,10 +3246,12 @@ x_get_file_delta_stream(svn_txdelta_stre
   apr_pool_t *scratch_pool = svn_pool_create(pool);
 
   if (source_root && source_path)
-    SVN_ERR(get_dag(&source_node, source_root, source_path, scratch_pool));
+    SVN_ERR(svn_fs_x__get_dag_node(&source_node, source_root, source_path,
+                                   scratch_pool));
   else
     source_node = NULL;
-  SVN_ERR(get_dag(&target_node, target_root, target_path, scratch_pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&target_node, target_root, target_path,
+                                 scratch_pool));
 
   /* Create a delta stream that turns the source into the target.  */
   SVN_ERR(svn_fs_x__dag_get_file_delta_stream(stream_p, source_node,
@@ -3555,7 +3549,7 @@ x_node_origin_rev(svn_revnum_t *revision
 
   path = svn_fs__canonicalize_abspath(path, scratch_pool);
 
-  SVN_ERR(get_dag(&node, root, path, scratch_pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node, root, path, scratch_pool));
   SVN_ERR(svn_fs_x__dag_get_node_id(&node_id, node));
 
   *revision = svn_fs_x__get_revnum(node_id.change_set);
@@ -3665,7 +3659,8 @@ history_prev(svn_fs_history_t **prev_his
 
       SVN_ERR(svn_fs_x__revision_root(&copyroot_root, fs, copyroot_rev,
                                        scratch_pool));
-      SVN_ERR(get_dag(&node, copyroot_root, copyroot_path, scratch_pool));
+      SVN_ERR(svn_fs_x__get_dag_node(&node, copyroot_root, copyroot_path,
+                                     scratch_pool));
       copy_dst = svn_fs_x__dag_get_created_path(node);
 
       /* If our current path was the very destination of the copy,
@@ -3861,7 +3856,7 @@ crawl_directory_dag_for_mergeinfo(svn_fs
       svn_pool_clear(iterpool);
 
       kid_path = svn_fspath__join(this_path, dirent->name, iterpool);
-      SVN_ERR(get_dag(&kid_dag, root, kid_path, iterpool));
+      SVN_ERR(svn_fs_x__get_dag_node(&kid_dag, root, kid_path, iterpool));
 
       SVN_ERR(svn_fs_x__dag_has_mergeinfo(&has_mergeinfo, kid_dag));
       SVN_ERR(svn_fs_x__dag_has_descendants_with_mergeinfo(&go_down, kid_dag));
@@ -4109,7 +4104,7 @@ add_descendant_mergeinfo(svn_mergeinfo_c
   dag_node_t *this_dag;
   svn_boolean_t go_down;
 
-  SVN_ERR(get_dag(&this_dag, root, path, scratch_pool));
+  SVN_ERR(svn_fs_x__get_dag_node(&this_dag, root, path, scratch_pool));
   SVN_ERR(svn_fs_x__dag_has_descendants_with_mergeinfo(&go_down,
                                                        this_dag));
   if (go_down)



Mime
View raw message