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 2014/12/15 16:35:47 UTC
svn commit: r1645677 - in
/subversion/branches/fsx-id/subversion/libsvn_fs_x: transaction.c
transaction.h tree.c
Author: stefan2
Date: Mon Dec 15 15:35:46 2014
New Revision: 1645677
URL: http://svn.apache.org/r1645677
Log:
On the fsx-id branch: Switch more code to using the new DAG functions.
This time, we make "add change" accept a noderev ID instead of a svn_fs_t.
Until we updated our implementation of svn_fs_t for FSX, we need to add
some temporary glue code to satisfy the log API.
* subversion/libsvn_fs_x/transaction.h
(svn_fs_x__add_change): Switch ID type to noderev ID.
* subversion/libsvn_fs_x/transaction.c
(svn_fs_x__add_change): Construct the needed svn_fs_t locally. There is
no valid one for deleted, txn-local nodes.
* subversion/libsvn_fs_x/tree.c
(make_path_mutable): Fix type mismatch.
(add_change): Switch ID type to noderev ID.
(x_change_node_prop,
x_make_dir,
x_delete_node,
copy_helper,
x_make_file,
apply_textdelta,
apply_text): Update caller using the new DAG API.
Modified:
subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c
subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.h
subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.c
Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c?rev=1645677&r1=1645676&r2=1645677&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c Mon Dec 15 15:35:46 2014
@@ -1795,7 +1795,7 @@ svn_error_t *
svn_fs_x__add_change(svn_fs_t *fs,
svn_fs_x__txn_id_t txn_id,
const char *path,
- const svn_fs_id_t *id,
+ const svn_fs_x__noderev_id_t *id,
svn_fs_path_change_kind_t change_kind,
svn_boolean_t text_mod,
svn_boolean_t prop_mod,
@@ -1809,13 +1809,29 @@ svn_fs_x__add_change(svn_fs_t *fs,
svn_fs_path_change2_t *change;
apr_hash_t *changes = apr_hash_make(pool);
+ const svn_fs_id_t *fs_id;
+ if ( svn_fs_x__is_txn(id->change_set)
+ && change_kind == svn_fs_path_change_delete)
+ {
+ /* There is no valid ID. Provide a dummy. */
+ svn_fs_x__id_part_t dummy;
+ svn_fs_x__id_part_reset(&dummy);
+ fs_id = svn_fs_x__id_create(&dummy, &dummy, id, pool);
+ }
+ else
+ {
+ node_revision_t *noderev;
+ SVN_ERR(svn_fs_x__get_node_revision(&noderev, fs, id, pool, pool));
+ fs_id = noderev->id;
+ }
+
/* Not using APR_BUFFERED to append change in one atomic write operation. */
SVN_ERR(svn_io_file_open(&file,
svn_fs_x__path_txn_changes(fs, txn_id, pool),
APR_APPEND | APR_WRITE | APR_CREATE,
APR_OS_DEFAULT, pool));
- change = svn_fs__path_change_create_internal(id, change_kind, pool);
+ change = svn_fs__path_change_create_internal(fs_id, change_kind, pool);
change->text_mod = text_mod;
change->prop_mod = prop_mod;
change->mergeinfo_mod = mergeinfo_mod
Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.h?rev=1645677&r1=1645676&r2=1645677&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.h (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.h Mon Dec 15 15:35:46 2014
@@ -179,7 +179,7 @@ svn_fs_x__set_entry(svn_fs_t *fs,
apr_pool_t *pool);
/* Add a change to the changes record for filesystem FS in transaction
- TXN_ID. Mark path PATH, having node-id ID, as changed according to
+ TXN_ID. Mark path PATH, having noderev-id ID, as changed according to
the type in CHANGE_KIND. If the text representation was changed set
TEXT_MOD to TRUE, and likewise for PROP_MOD as well as MERGEINFO_MOD.
If this change was the result of a copy, set COPYFROM_REV and
@@ -190,7 +190,7 @@ svn_error_t *
svn_fs_x__add_change(svn_fs_t *fs,
svn_fs_x__txn_id_t txn_id,
const char *path,
- const svn_fs_id_t *id,
+ const svn_fs_x__noderev_id_t *id,
svn_fs_path_change_kind_t change_kind,
svn_boolean_t text_mod,
svn_boolean_t prop_mod,
Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.c?rev=1645677&r1=1645676&r2=1645677&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.c Mon Dec 15 15:35:46 2014
@@ -1237,8 +1237,7 @@ make_path_mutable(svn_fs_root_t *root,
/* Are we trying to clone the root, or somebody's child node? */
if (parent_path->parent)
{
- const svn_fs_id_t *parent_id;
- const svn_fs_x__noderev_id_t *child_id, *copyroot_id;
+ const svn_fs_id_t *parent_id, *child_id, *copyroot_id;
svn_fs_x__id_part_t copy_id = { SVN_INVALID_REVNUM, 0 };
svn_fs_x__id_part_t *copy_id_ptr = ©_id;
copy_id_inherit_t inherit = parent_path->copy_inherit;
@@ -1382,7 +1381,7 @@ static svn_error_t *
add_change(svn_fs_t *fs,
svn_fs_x__txn_id_t txn_id,
const char *path,
- const svn_fs_id_t *noderev_id,
+ const svn_fs_x__noderev_id_t *noderev_id,
svn_fs_path_change_kind_t change_kind,
svn_boolean_t text_mod,
svn_boolean_t prop_mod,
@@ -1697,7 +1696,7 @@ x_change_node_prop(svn_fs_root_t *root,
/* Make a record of this modification in the changes table. */
return add_change(root->fs, txn_id, path,
- svn_fs_x__dag_get_id(parent_path->node),
+ svn_fs_x__dag_get_noderev_id(parent_path->node),
svn_fs_path_change_modify, FALSE, TRUE, mergeinfo_mod,
svn_fs_x__dag_node_kind(parent_path->node),
SVN_INVALID_REVNUM, NULL, pool);
@@ -2516,7 +2515,7 @@ x_make_dir(svn_fs_root_t *root,
sub_dir, pool));
/* Make a record of this modification in the changes table. */
- return add_change(root->fs, txn_id, path, svn_fs_x__dag_get_id(sub_dir),
+ return add_change(root->fs, txn_id, path, svn_fs_x__dag_get_noderev_id(sub_dir),
svn_fs_path_change_add, FALSE, FALSE, FALSE,
svn_node_dir, SVN_INVALID_REVNUM, NULL, pool);
}
@@ -2573,7 +2572,7 @@ x_delete_node(svn_fs_root_t *root,
/* Make a record of this modification in the changes table. */
return add_change(root->fs, txn_id, path,
- svn_fs_x__dag_get_id(parent_path->node),
+ svn_fs_x__dag_get_noderev_id(parent_path->node),
svn_fs_path_change_delete, FALSE, FALSE, FALSE, kind,
SVN_INVALID_REVNUM, NULL, pool);
}
@@ -2704,7 +2703,7 @@ copy_helper(svn_fs_root_t *from_root,
/* Make a record of this modification in the changes table. */
SVN_ERR(get_dag(&new_node, to_root, to_path, TRUE, pool));
SVN_ERR(add_change(to_root->fs, txn_id, to_path,
- svn_fs_x__dag_get_id(new_node), kind, FALSE,
+ svn_fs_x__dag_get_noderev_id(new_node), kind, FALSE,
FALSE, FALSE, svn_fs_x__dag_node_kind(from_node),
from_root->rev, from_canonpath, pool));
}
@@ -2833,7 +2832,7 @@ x_make_file(svn_fs_root_t *root,
pool));
/* Make a record of this modification in the changes table. */
- return add_change(root->fs, txn_id, path, svn_fs_x__dag_get_id(child),
+ return add_change(root->fs, txn_id, path, svn_fs_x__dag_get_noderev_id(child),
svn_fs_path_change_add, TRUE, FALSE, FALSE,
svn_node_file, SVN_INVALID_REVNUM, NULL, pool);
}
@@ -3033,7 +3032,7 @@ apply_textdelta(void *baton, apr_pool_t
/* Make a record of this modification in the changes table. */
return add_change(tb->root->fs, txn_id, tb->path,
- svn_fs_x__dag_get_id(tb->node),
+ svn_fs_x__dag_get_noderev_id(tb->node),
svn_fs_path_change_modify, TRUE, FALSE, FALSE,
svn_node_file, SVN_INVALID_REVNUM, NULL, pool);
}
@@ -3168,7 +3167,7 @@ apply_text(void *baton, apr_pool_t *pool
/* Make a record of this modification in the changes table. */
return add_change(tb->root->fs, txn_id, tb->path,
- svn_fs_x__dag_get_id(tb->node),
+ svn_fs_x__dag_get_noderev_id(tb->node),
svn_fs_path_change_modify, TRUE, FALSE, FALSE,
svn_node_file, SVN_INVALID_REVNUM, NULL, pool);
}