You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/07/23 17:07:40 UTC
svn commit: r1506099 -
/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c
Author: stefan2
Date: Tue Jul 23 15:07:40 2013
New Revision: 1506099
URL: http://svn.apache.org/r1506099
Log:
On the fsfs-improvements branch: Simplify the open_path function
thereby reducing the dependency on the ID API.
* subversion/libsvn_fs_fs/tree.c
(get_copy_inheritance): drop the unused TXN_ID parameter
(open_path): replace TXN_ID parameter by a IS_TXN_PATH flag
(get_dag,
fs_change_node_prop,
fs_make_dir,
fs_delete_node,
copy_helper,
fs_make_file,
apply_textdelta,
apply_text,
fs_closest_copy,
history_prev,
get_mergeinfo_for_path_internal): update callers
Modified:
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c
Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c?rev=1506099&r1=1506098&r2=1506099&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c Tue Jul 23 15:07:40 2013
@@ -787,14 +787,12 @@ parent_path_relpath(parent_path_t *child
the inheritance method is copy_id_inherit_new, also return a
*COPY_SRC_PATH on which to base the new copy ID (else return NULL
for that path). CHILD must have a parent (it cannot be the root
- node). TXN_ID is the transaction in which these items might be
- mutable. Allocations are taken from POOL. */
+ node). Allocations are taken from POOL. */
static svn_error_t *
get_copy_inheritance(copy_id_inherit_t *inherit_p,
const char **copy_src_path,
svn_fs_t *fs,
parent_path_t *child,
- const char *txn_id,
apr_pool_t *pool)
{
const svn_fs_id_t *child_id, *parent_id, *copyroot_id;
@@ -805,7 +803,7 @@ get_copy_inheritance(copy_id_inherit_t *
svn_revnum_t copyroot_rev;
const char *copyroot_path;
- SVN_ERR_ASSERT(child && child->parent && txn_id);
+ SVN_ERR_ASSERT(child && child->parent);
/* Initialize some convenience variables. */
child_id = svn_fs_fs__dag_get_id(child->node);
@@ -915,10 +913,9 @@ typedef enum open_path_flags_t {
*element, for the root directory. PATH must be in canonical form.
If resulting *PARENT_PATH_P will eventually be made mutable and
- modified, or if copy ID inheritance information is otherwise
- needed, TXN_ID should be the ID of the mutability transaction. If
- TXN_ID is NULL, no copy ID inheritance information will be
- calculated for the *PARENT_PATH_P chain.
+ modified, or if copy ID inheritance information is otherwise needed,
+ IS_TXN_PATH must be set. If IS_TXN_PATH is FALSE, no copy ID
+ inheritance information will be calculated for the *PARENT_PATH_P chain.
If FLAGS & open_path_last_optional is zero, return the error
SVN_ERR_FS_NOT_FOUND if the node PATH refers to does not exist. If
@@ -942,7 +939,7 @@ open_path(parent_path_t **parent_path_p,
svn_fs_root_t *root,
const char *path,
int flags,
- const char *txn_id,
+ svn_boolean_t is_txn_path,
apr_pool_t *pool)
{
svn_fs_t *fs = root->fs;
@@ -1077,10 +1074,10 @@ open_path(parent_path_t **parent_path_p,
{
/* Now, make a parent_path item for CHILD. */
parent_path = make_parent_path(child, entry, parent_path, pool);
- if (txn_id)
+ if (is_txn_path)
{
SVN_ERR(get_copy_inheritance(&inherit, ©_path, fs,
- parent_path, txn_id, iterpool));
+ parent_path, iterpool));
parent_path->copy_inherit = inherit;
parent_path->copy_src_path = apr_pstrdup(pool, copy_path);
}
@@ -1249,7 +1246,7 @@ get_dag(dag_node_t **dag_node_p,
* error if the node for which we are searching doesn't exist. */
SVN_ERR(open_path(&parent_path, root, path,
open_path_uncached | open_path_node_only,
- NULL, pool));
+ FALSE, pool));
node = parent_path->node;
/* No need to cache our find -- open_path() will do that for us. */
@@ -1477,7 +1474,7 @@ fs_change_node_prop(svn_fs_root_t *root,
txn_id = root_txn_id(root);
path = svn_fs__canonicalize_abspath(path, pool);
- SVN_ERR(open_path(&parent_path, root, path, 0, txn_id, pool));
+ SVN_ERR(open_path(&parent_path, root, path, 0, TRUE, pool));
/* Check (non-recursively) to see if path is locked; if so, check
that we can use it. */
@@ -2267,7 +2264,7 @@ fs_make_dir(svn_fs_root_t *root,
path = svn_fs__canonicalize_abspath(path, pool);
SVN_ERR(open_path(&parent_path, root, path, open_path_last_optional,
- txn_id, pool));
+ TRUE, pool));
/* Check (recursively) to see if some lock is 'reserving' a path at
that location, or even some child-path; if so, check that we can
@@ -2319,7 +2316,7 @@ fs_delete_node(svn_fs_root_t *root,
txn_id = root_txn_id(root);
path = svn_fs__canonicalize_abspath(path, pool);
- SVN_ERR(open_path(&parent_path, root, path, 0, txn_id, pool));
+ SVN_ERR(open_path(&parent_path, root, path, 0, TRUE, pool));
kind = svn_fs_fs__dag_node_kind(parent_path->node);
/* We can't remove the root of the filesystem. */
@@ -2410,7 +2407,7 @@ copy_helper(svn_fs_root_t *from_root,
component does not exist, it's not that big a deal. We'll just
make one there. */
SVN_ERR(open_path(&to_parent_path, to_root, to_path,
- open_path_last_optional, txn_id, pool));
+ open_path_last_optional, TRUE, pool));
/* Check to see if path (or any child thereof) is locked; if so,
check that we can use the existing lock(s). */
@@ -2588,7 +2585,7 @@ fs_make_file(svn_fs_root_t *root,
path = svn_fs__canonicalize_abspath(path, pool);
SVN_ERR(open_path(&parent_path, root, path, open_path_last_optional,
- txn_id, pool));
+ TRUE, pool));
/* If there's already a file by that name, complain.
This also catches the case of trying to make a file named `/'. */
@@ -2822,7 +2819,7 @@ apply_textdelta(void *baton, apr_pool_t
/* Call open_path with no flags, as we want this to return an error
if the node for which we are searching doesn't exist. */
- SVN_ERR(open_path(&parent_path, tb->root, tb->path, 0, txn_id, pool));
+ SVN_ERR(open_path(&parent_path, tb->root, tb->path, 0, TRUE, pool));
/* Check (non-recursively) to see if path is locked; if so, check
that we can use it. */
@@ -2987,7 +2984,7 @@ apply_text(void *baton, apr_pool_t *pool
/* Call open_path with no flags, as we want this to return an error
if the node for which we are searching doesn't exist. */
- SVN_ERR(open_path(&parent_path, tb->root, tb->path, 0, txn_id, pool));
+ SVN_ERR(open_path(&parent_path, tb->root, tb->path, 0, TRUE, pool));
/* Check (non-recursively) to see if path is locked; if so, check
that we can use it. */
@@ -3247,7 +3244,7 @@ static svn_error_t *fs_closest_copy(svn_
*path_p = NULL;
path = svn_fs__canonicalize_abspath(path, pool);
- SVN_ERR(open_path(&parent_path, root, path, 0, NULL, pool));
+ SVN_ERR(open_path(&parent_path, root, path, 0, FALSE, pool));
/* Find the youngest copyroot in the path of this node-rev, which
will indicate the target of the innermost copy affecting the
@@ -3265,7 +3262,7 @@ static svn_error_t *fs_closest_copy(svn_
if (kind == svn_node_none)
return SVN_NO_ERROR;
SVN_ERR(open_path(©_dst_parent_path, copy_dst_root, path,
- open_path_node_only, NULL, pool));
+ open_path_node_only, FALSE, pool));
copy_dst_node = copy_dst_parent_path->node;
if (! svn_fs_fs__id_check_related(svn_fs_fs__dag_get_id(copy_dst_node),
svn_fs_fs__dag_get_id(parent_path->node)))
@@ -3520,7 +3517,7 @@ history_prev(svn_fs_history_t **prev_his
/* Open PATH/REVISION, and get its node and a bunch of other
goodies. */
- SVN_ERR(open_path(&parent_path, root, path, 0, NULL, scratch_pool));
+ SVN_ERR(open_path(&parent_path, root, path, 0, FALSE, scratch_pool));
node = parent_path->node;
commit_path = svn_fs_fs__dag_get_created_path(node);
SVN_ERR(svn_fs_fs__dag_get_revision(&commit_rev, node, scratch_pool));
@@ -3870,7 +3867,7 @@ get_mergeinfo_for_path_internal(svn_merg
path = svn_fs__canonicalize_abspath(path, scratch_pool);
- SVN_ERR(open_path(&parent_path, rev_root, path, 0, NULL, scratch_pool));
+ SVN_ERR(open_path(&parent_path, rev_root, path, 0, FALSE, scratch_pool));
if (inherit == svn_mergeinfo_nearest_ancestor && ! parent_path->parent)
return SVN_NO_ERROR;