You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/02/09 19:56:12 UTC
svn commit: r1658532 - in
/subversion/branches/fsx-1.10/subversion/libsvn_fs_x: dag_cache.h tree.c
Author: stefan2
Date: Mon Feb 9 18:56:12 2015
New Revision: 1658532
URL: http://svn.apache.org/r1658532
Log:
On the fsx-1.10 branch: Make former make_path_mutable part of the internal
DAG cache API.
* subversion/libsvn_fs_x/dag_cache.h
(svn_fs_x__make_path_mutable): Rename and move declaration here from tree.c.
* subversion/libsvn_fs_x/tree.c
(make_path_mutable): Rename to ...
(svn_fs_x__make_path_mutable): ... this and make it non-static.
Update recursion.
(x_change_node_prop,
x_make_dir,
x_delete_node,
copy_helper,
x_make_file,
apply_textdelta,
apply_text): 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=1658532&r1=1658531&r2=1658532&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 18:56:12 2015
@@ -138,11 +138,23 @@ svn_fs_x__get_dag_path(svn_fs_x__dag_pat
svn_boolean_t is_txn_path,
apr_pool_t *pool);
+/* Make the node referred to by PARENT_PATH mutable, if it isn't already,
+ allocating from RESULT_POOL. ROOT must be the root from which
+ PARENT_PATH descends. Clone any parent directories as needed.
+ Adjust the dag nodes in PARENT_PATH to refer to the clones. Use
+ ERROR_PATH in error messages. Use SCRATCH_POOL for temporaries. */
+svn_error_t *
+svn_fs_x__make_path_mutable(svn_fs_root_t *root,
+ svn_fs_x__dag_path_t *parent_path,
+ const char *error_path,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_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_error_t *
svn_fs_x__get_dag_node(dag_node_t **dag_node_p,
svn_fs_root_t *root,
const char *path,
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=1658532&r1=1658531&r2=1658532&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 18:56:12 2015
@@ -1008,12 +1008,12 @@ svn_fs_x__get_dag_path(svn_fs_x__dag_pat
PARENT_PATH descends. Clone any parent directories as needed.
Adjust the dag nodes in PARENT_PATH to refer to the clones. Use
ERROR_PATH in error messages. Use SCRATCH_POOL for temporaries. */
-static svn_error_t *
-make_path_mutable(svn_fs_root_t *root,
- svn_fs_x__dag_path_t *parent_path,
- const char *error_path,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+svn_error_t *
+svn_fs_x__make_path_mutable(svn_fs_root_t *root,
+ svn_fs_x__dag_path_t *parent_path,
+ const char *error_path,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
dag_node_t *clone;
svn_fs_x__txn_id_t txn_id = root_txn_id(root);
@@ -1038,8 +1038,9 @@ make_path_mutable(svn_fs_root_t *root,
/* We're trying to clone somebody's child. Make sure our parent
is mutable. */
- SVN_ERR(make_path_mutable(root, parent_path->parent,
- error_path, result_pool, scratch_pool));
+ SVN_ERR(svn_fs_x__make_path_mutable(root, parent_path->parent,
+ error_path, result_pool,
+ scratch_pool));
/* Allocate all temporaries in a sub-pool that we control locally.
That way, we keep only the data of one level of recursion around
@@ -1459,7 +1460,8 @@ x_change_node_prop(svn_fs_root_t *root,
SVN_ERR(svn_fs_x__allow_locked_operation(path, root->fs, FALSE, FALSE,
subpool));
- SVN_ERR(make_path_mutable(root, dag_path, path, subpool, subpool));
+ SVN_ERR(svn_fs_x__make_path_mutable(root, dag_path, path, subpool,
+ subpool));
SVN_ERR(svn_fs_x__dag_get_proplist(&proplist, dag_path->node, subpool,
subpool));
@@ -2358,8 +2360,8 @@ x_make_dir(svn_fs_root_t *root,
return SVN_FS__ALREADY_EXISTS(root, path);
/* Create the subdirectory. */
- SVN_ERR(make_path_mutable(root, dag_path->parent, path, subpool,
- subpool));
+ SVN_ERR(svn_fs_x__make_path_mutable(root, dag_path->parent, path, subpool,
+ subpool));
SVN_ERR(svn_fs_x__dag_make_dir(&sub_dir,
dag_path->parent->node,
parent_path_path(dag_path->parent,
@@ -2415,8 +2417,8 @@ x_delete_node(svn_fs_root_t *root,
subpool));
/* Make the parent directory mutable, and do the deletion. */
- SVN_ERR(make_path_mutable(root, dag_path->parent, path, subpool,
- subpool));
+ SVN_ERR(svn_fs_x__make_path_mutable(root, dag_path->parent, path, subpool,
+ subpool));
SVN_ERR(svn_fs_x__dag_get_mergeinfo_count(&mergeinfo_count,
dag_path->node));
SVN_ERR(svn_fs_x__dag_delete(dag_path->parent->node,
@@ -2545,8 +2547,9 @@ copy_helper(svn_fs_root_t *from_root,
SVN_ERR(svn_fs_x__dag_get_mergeinfo_count(&mergeinfo_end, from_node));
/* Make sure the target node's parents are mutable. */
- SVN_ERR(make_path_mutable(to_root, to_dag_path->parent,
- to_path, scratch_pool, scratch_pool));
+ SVN_ERR(svn_fs_x__make_path_mutable(to_root, to_dag_path->parent,
+ to_path, scratch_pool,
+ scratch_pool));
/* Canonicalize the copyfrom path. */
from_canonpath = svn_fs__canonicalize_abspath(from_path, scratch_pool);
@@ -2702,8 +2705,8 @@ x_make_file(svn_fs_root_t *root,
subpool));
/* Create the file. */
- SVN_ERR(make_path_mutable(root, dag_path->parent, path, subpool,
- subpool));
+ SVN_ERR(svn_fs_x__make_path_mutable(root, dag_path->parent, path, subpool,
+ subpool));
SVN_ERR(svn_fs_x__dag_make_file(&child,
dag_path->parent->node,
parent_path_path(dag_path->parent,
@@ -2884,8 +2887,8 @@ apply_textdelta(void *baton,
FALSE, FALSE, scratch_pool));
/* Now, make sure this path is mutable. */
- SVN_ERR(make_path_mutable(tb->root, dag_path, tb->path, scratch_pool,
- scratch_pool));
+ SVN_ERR(svn_fs_x__make_path_mutable(tb->root, dag_path, tb->path,
+ scratch_pool, scratch_pool));
tb->node = svn_fs_x__dag_dup(dag_path->node, tb->pool);
if (tb->base_checksum)
@@ -3051,8 +3054,8 @@ apply_text(void *baton,
FALSE, FALSE, scratch_pool));
/* Now, make sure this path is mutable. */
- SVN_ERR(make_path_mutable(tb->root, dag_path, tb->path, scratch_pool,
- scratch_pool));
+ SVN_ERR(svn_fs_x__make_path_mutable(tb->root, dag_path, tb->path,
+ scratch_pool, scratch_pool));
tb->node = svn_fs_x__dag_dup(dag_path->node, tb->pool);
/* Make a writable stream for replacing the file's text. */