You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2015/02/09 17:46:21 UTC
svn commit: r1658462 [4/31] - in /subversion/branches/move-tracking-2: ./
build/ build/generator/ build/generator/templates/ notes/ subversion/
subversion/bindings/cxxhl/include/svncxxhl/
subversion/bindings/javahl/native/ subversion/bindings/javahl/na...
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/dag.c?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/dag.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/dag.c Mon Feb 9 16:46:16 2015
@@ -245,7 +245,8 @@ svn_error_t *
svn_fs_x__dag_get_node(dag_node_t **node,
svn_fs_t *fs,
const svn_fs_x__id_t *id,
- apr_pool_t *result_pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
dag_node_t *new_node;
svn_fs_x__noderev_t *noderev;
@@ -257,17 +258,19 @@ svn_fs_x__dag_get_node(dag_node_t **node
new_node->hint = APR_SIZE_MAX;
/* Grab the contents so we can inspect the node's kind and created path. */
+ SVN_ERR(svn_fs_x__get_node_revision(&noderev, fs, id,
+ result_pool, scratch_pool));
new_node->node_pool = result_pool;
- SVN_ERR(get_node_revision(&noderev, new_node));
+ new_node->node_revision = noderev;
/* Initialize the KIND and CREATED_PATH attributes */
new_node->kind = noderev->kind;
- new_node->created_path = apr_pstrdup(result_pool, noderev->created_path);
+ new_node->created_path = noderev->created_path;
/* Support our quirky svn_fs_node_created_rev API.
Untouched txn roots report the base rev as theirs. */
new_node->revision
- = ( noderev->is_fresh_txn_root
+ = ( svn_fs_x__is_fresh_txn_root(noderev)
? svn_fs_x__get_revnum(noderev->predecessor_id.change_set)
: svn_fs_x__get_revnum(id->change_set));
@@ -373,6 +376,12 @@ dir_entry_id_from_node(svn_fs_x__id_t *i
return svn_error_create(SVN_ERR_FS_NOT_DIRECTORY, NULL,
_("Can't get entries of non-directory"));
+ /* Make sure that NAME is a single path component. */
+ if (! svn_path_is_single_path_component(name))
+ return svn_error_createf
+ (SVN_ERR_FS_NOT_SINGLE_PATH_COMPONENT, NULL,
+ "Attempted to open node with an illegal name '%s'", name);
+
/* Get a dirent hash for this directory. */
SVN_ERR(svn_fs_x__rep_contents_dir_entry(&dirent, parent->fs, noderev,
name, &parent->hint,
@@ -469,7 +478,8 @@ make_entry(dag_node_t **child_p,
/* Create a new dag_node_t for our new node */
SVN_ERR(svn_fs_x__dag_get_node(child_p, svn_fs_x__dag_get_fs(parent),
- &new_noderev.noderev_id, result_pool));
+ &new_noderev.noderev_id, result_pool,
+ scratch_pool));
/* We can safely call set_entry because we already know that
PARENT is mutable, and we just created CHILD, so we know it has
@@ -618,7 +628,7 @@ svn_fs_x__dag_increment_mergeinfo_count(
}
/* Flush it out. */
- return svn_fs_x__put_node_revision(node->fs, noderev, FALSE, scratch_pool);
+ return svn_fs_x__put_node_revision(node->fs, noderev, scratch_pool);
}
svn_error_t *
@@ -644,7 +654,7 @@ svn_fs_x__dag_set_has_mergeinfo(dag_node
noderev->has_mergeinfo = has_mergeinfo;
/* Flush it out. */
- return svn_fs_x__put_node_revision(node->fs, noderev, FALSE, scratch_pool);
+ return svn_fs_x__put_node_revision(node->fs, noderev, scratch_pool);
}
@@ -654,27 +664,14 @@ svn_error_t *
svn_fs_x__dag_revision_root(dag_node_t **node_p,
svn_fs_t *fs,
svn_revnum_t rev,
- apr_pool_t *result_pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
- dag_node_t *new_node;
-
- /* Construct the node. */
- new_node = apr_pcalloc(result_pool, sizeof(*new_node));
- new_node->fs = fs;
- new_node->revision = rev;
- svn_fs_x__init_rev_root(&new_node->id, rev);
-
- /* Grab the contents so we can inspect the node's kind and created path. */
- new_node->node_pool = result_pool;
-
- /* Initialize the KIND and CREATED_PATH attributes */
- new_node->kind = svn_node_dir;
- new_node->created_path = "/";
- new_node->hint = APR_SIZE_MAX;
+ svn_fs_x__id_t root_id;
- /* Return a fresh new node */
- *node_p = new_node;
- return SVN_NO_ERROR;
+ svn_fs_x__init_rev_root(&root_id, rev);
+ return svn_fs_x__dag_get_node(node_p, fs, &root_id, result_pool,
+ scratch_pool);
}
@@ -682,29 +679,14 @@ svn_error_t *
svn_fs_x__dag_txn_root(dag_node_t **node_p,
svn_fs_t *fs,
svn_fs_x__txn_id_t txn_id,
- apr_pool_t *result_pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_fs_x__id_t root_id;
svn_fs_x__init_txn_root(&root_id, txn_id);
- return svn_fs_x__dag_get_node(node_p, fs, &root_id, result_pool);
-}
-
-
-svn_error_t *
-svn_fs_x__dag_txn_base_root(dag_node_t **node_p,
- svn_fs_t *fs,
- svn_fs_x__txn_id_t txn_id,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- svn_fs_x__id_t base_root_id;
- svn_revnum_t base_rev;
-
- SVN_ERR(svn_fs_x__get_base_rev(&base_rev, fs, txn_id, scratch_pool));
-
- svn_fs_x__init_rev_root(&base_root_id, base_rev);
- return svn_fs_x__dag_get_node(node_p, fs, &base_root_id, result_pool);
+ return svn_fs_x__dag_get_node(node_p, fs, &root_id, result_pool,
+ scratch_pool);
}
@@ -787,22 +769,8 @@ svn_fs_x__dag_clone_child(dag_node_t **c
}
/* Initialize the youngster. */
- return svn_fs_x__dag_get_node(child_p, fs, new_node_id, result_pool);
-}
-
-
-
-svn_error_t *
-svn_fs_x__dag_clone_root(dag_node_t **root_p,
- svn_fs_t *fs,
- svn_fs_x__txn_id_t txn_id,
- apr_pool_t *result_pool)
-{
- svn_fs_x__id_t root_id;
- svn_fs_x__init_txn_root(&root_id, txn_id);
-
- /* One way or another, root_id now identifies a cloned root node. */
- return svn_fs_x__dag_get_node(root_p, fs, &root_id, result_pool);
+ return svn_fs_x__dag_get_node(child_p, fs, new_node_id, result_pool,
+ scratch_pool);
}
@@ -821,7 +789,7 @@ delete_if_mutable(svn_fs_t *fs,
dag_node_t *node;
/* Get the node. */
- SVN_ERR(svn_fs_x__dag_get_node(&node, fs, id, scratch_pool));
+ SVN_ERR(svn_fs_x__dag_get_node(&node, fs, id, scratch_pool, scratch_pool));
/* If immutable, do nothing and return immediately. */
if (! svn_fs_x__dag_check_mutable(node))
@@ -1231,15 +1199,9 @@ svn_fs_x__dag_open(dag_node_t **child_p,
return SVN_NO_ERROR;
}
- /* Make sure that NAME is a single path component. */
- if (! svn_path_is_single_path_component(name))
- return svn_error_createf
- (SVN_ERR_FS_NOT_SINGLE_PATH_COMPONENT, NULL,
- "Attempted to open node with an illegal name '%s'", name);
-
/* Now get the node that was requested. */
return svn_fs_x__dag_get_node(child_p, svn_fs_x__dag_get_fs(parent),
- &node_id, result_pool);
+ &node_id, result_pool, scratch_pool);
}
@@ -1401,6 +1363,6 @@ svn_fs_x__dag_update_ancestry(dag_node_t
target_noderev->predecessor_count = source_noderev->predecessor_count;
target_noderev->predecessor_count++;
- return svn_fs_x__put_node_revision(target->fs, target_noderev, FALSE,
+ return svn_fs_x__put_node_revision(target->fs, target_noderev,
scratch_pool);
}
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/dag.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/dag.h?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/dag.h (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/dag.h Mon Feb 9 16:46:16 2015
@@ -65,12 +65,13 @@ extern "C" {
typedef struct dag_node_t dag_node_t;
/* Fill *NODE with a dag_node_t representing node revision ID in FS,
- allocating in RESULT_POOL. */
+ allocating in RESULT_POOL. Use SCRATCH_POOL for temporaries. */
svn_error_t *
svn_fs_x__dag_get_node(dag_node_t **node,
svn_fs_t *fs,
const svn_fs_x__id_t *id,
- apr_pool_t *result_pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Return a new dag_node_t object referring to the same node as NODE,
@@ -252,49 +253,24 @@ svn_fs_x__dag_set_has_mergeinfo(dag_node
/* Open the root of revision REV of filesystem FS, allocating from
- RESULT_POOL. Set *NODE_P to the new node. */
+ RESULT_POOL. Set *NODE_P to the new node. Use SCRATCH_POOL for
+ temporary allocations.*/
svn_error_t *
svn_fs_x__dag_revision_root(dag_node_t **node_p,
svn_fs_t *fs,
svn_revnum_t rev,
- apr_pool_t *result_pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Set *NODE_P to the root of transaction TXN_ID in FS, allocating
- from RESULT_POOL.
-
- Note that the root node of TXN_ID is not necessarily mutable. If
- no changes have been made in the transaction, then it may share its
- root directory with its base revision. To get a mutable root node
- for a transaction, call svn_fs_x__dag_clone_root. */
+ from RESULT_POOL. Use SCRATCH_POOL for temporary allocations. */
svn_error_t *
svn_fs_x__dag_txn_root(dag_node_t **node_p,
svn_fs_t *fs,
svn_fs_x__txn_id_t txn_id,
- apr_pool_t *result_pool);
-
-
-/* Set *NODE_P to the base root of transaction TXN_ID in FS,
- allocating from RESULT_POOL. Allocate the node in TRAIL->pool.
- Use SCRATCH_POOL for temporaries. */
-svn_error_t *
-svn_fs_x__dag_txn_base_root(dag_node_t **node_p,
- svn_fs_t *fs,
- svn_fs_x__txn_id_t txn_id,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-
-/* Clone the root directory of TXN_ID in FS, and update the
- `transactions' table entry to point to it, unless this has been
- done already. In either case, set *ROOT_P to a reference to the
- root directory clone. Allocate *ROOT_P in RESULT_POOL. */
-svn_error_t *
-svn_fs_x__dag_clone_root(dag_node_t **root_p,
- svn_fs_t *fs,
- svn_fs_x__txn_id_t txn_id,
- apr_pool_t *result_pool);
-
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Directories. */
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs.c?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs.c Mon Feb 9 16:46:16 2015
@@ -216,6 +216,23 @@ x_info(const void **fsx_info,
return SVN_NO_ERROR;
}
+/* Wrapper around svn_fs_x__revision_prop() adapting between function
+ signatures. */
+static svn_error_t *
+x_revision_prop(svn_string_t **value_p,
+ svn_fs_t *fs,
+ svn_revnum_t rev,
+ const char *propname,
+ apr_pool_t *pool)
+{
+ apr_pool_t *scratch_pool = svn_pool_create(pool);
+ SVN_ERR(svn_fs_x__revision_prop(value_p, fs, rev, propname, pool,
+ scratch_pool));
+ svn_pool_destroy(scratch_pool);
+
+ return SVN_NO_ERROR;
+}
+
/* Wrapper around svn_fs_x__get_revision_proplist() adapting between function
signatures. */
static svn_error_t *
@@ -224,9 +241,14 @@ x_revision_proplist(apr_hash_t **proplis
svn_revnum_t rev,
apr_pool_t *pool)
{
+ apr_pool_t *scratch_pool = svn_pool_create(pool);
+
/* No need to bypass the caches for r/o access to revprops. */
- return svn_error_trace(svn_fs_x__get_revision_proplist(proplist_p, fs,
- rev, FALSE, pool));
+ SVN_ERR(svn_fs_x__get_revision_proplist(proplist_p, fs, rev, FALSE,
+ pool, scratch_pool));
+ svn_pool_destroy(scratch_pool);
+
+ return SVN_NO_ERROR;
}
/* Wrapper around svn_fs_x__set_uuid() adapting between function
@@ -261,7 +283,7 @@ x_begin_txn(svn_fs_txn_t **txn_p,
/* The vtable associated with a specific open filesystem. */
static fs_vtable_t fs_vtable = {
svn_fs_x__youngest_rev,
- svn_fs_x__revision_prop,
+ x_revision_prop,
x_revision_proplist,
svn_fs_x__change_rev_prop,
x_set_uuid,
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs.h?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs.h (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs.h Mon Feb 9 16:46:16 2015
@@ -517,9 +517,6 @@ typedef struct svn_fs_x__noderev_t
/* path at which this node first came into existence. */
const char *created_path;
- /* is this the unmodified root of a transaction? */
- svn_boolean_t is_fresh_txn_root;
-
/* Does this node itself have svn:mergeinfo? */
svn_boolean_t has_mergeinfo;
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs_x.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs_x.c?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs_x.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs_x.c Mon Feb 9 16:46:16 2015
@@ -690,17 +690,6 @@ svn_fs_x__ensure_revision_exists(svn_rev
_("No such revision %ld"), rev);
}
-svn_error_t *
-svn_fs_x__revision_proplist(apr_hash_t **proplist_p,
- svn_fs_t *fs,
- svn_revnum_t rev,
- apr_pool_t *pool)
-{
- SVN_ERR(svn_fs_x__get_revision_proplist(proplist_p, fs, rev, FALSE, pool));
-
- return SVN_NO_ERROR;
-}
-
svn_error_t *
svn_fs_x__file_length(svn_filesize_t *length,
@@ -1108,17 +1097,19 @@ svn_fs_x__ensure_dir_exists(const char *
svn_error_t *
svn_fs_x__revision_prop(svn_string_t **value_p,
- svn_fs_t *fs,
- svn_revnum_t rev,
- const char *propname,
- apr_pool_t *pool)
+ svn_fs_t *fs,
+ svn_revnum_t rev,
+ const char *propname,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
apr_hash_t *table;
SVN_ERR(svn_fs__check_fs(fs, TRUE));
- SVN_ERR(svn_fs_x__revision_proplist(&table, fs, rev, pool));
+ SVN_ERR(svn_fs_x__get_revision_proplist(&table, fs, rev, FALSE,
+ scratch_pool, scratch_pool));
- *value_p = svn_hash_gets(table, propname);
+ *value_p = svn_string_dup(svn_hash_gets(table, propname), result_pool);
return SVN_NO_ERROR;
}
@@ -1143,7 +1134,11 @@ change_rev_prop_body(void *baton,
change_rev_prop_baton_t *cb = baton;
apr_hash_t *table;
- SVN_ERR(svn_fs_x__revision_proplist(&table, cb->fs, cb->rev, scratch_pool));
+ /* Read current revprop values from disk (never from cache).
+ Even if somehow the cache got out of sync, we want to make sure that
+ we read, update and write up-to-date data. */
+ SVN_ERR(svn_fs_x__get_revision_proplist(&table, cb->fs, cb->rev, TRUE,
+ scratch_pool, scratch_pool));
if (cb->old_value_p)
{
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs_x.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs_x.h?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs_x.h (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs_x.h Mon Feb 9 16:46:16 2015
@@ -69,15 +69,6 @@ svn_fs_x__ensure_revision_exists(svn_rev
svn_fs_t *fs,
apr_pool_t *scratch_pool);
-/* Set *PROPLIST to be an apr_hash_t containing the property list of
- revision REV as seen in filesystem FS. Use POOL for temporary
- allocations. */
-svn_error_t *
-svn_fs_x__revision_proplist(apr_hash_t **proplist,
- svn_fs_t *fs,
- svn_revnum_t rev,
- apr_pool_t *pool);
-
/* Set *LENGTH to the be fulltext length of the node revision
specified by NODEREV. */
svn_error_t *
@@ -167,15 +158,16 @@ svn_fs_x__write_format(svn_fs_t *fs,
svn_boolean_t overwrite,
apr_pool_t *scratch_pool);
-/* Find the value of the property named PROPNAME in transaction TXN.
- Return the contents in *VALUE_P. The contents will be allocated
- from POOL. */
+/* Find the value of the property named PROPNAME in transaction REV.
+ Return the contents in *VALUE_P, allocated from RESULT_POOL.
+ Use SCRATCH_POOL for temporary allocations. */
svn_error_t *
svn_fs_x__revision_prop(svn_string_t **value_p,
svn_fs_t *fs,
svn_revnum_t rev,
const char *propname,
- apr_pool_t *pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Change, add, or delete a property on a revision REV in filesystem
FS. NAME gives the name of the property, and value, if non-NULL,
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/hotcopy.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/hotcopy.c?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/hotcopy.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/hotcopy.c Mon Feb 9 16:46:16 2015
@@ -99,15 +99,15 @@ static svn_error_t *
entry_name_to_utf8(const char **name_p,
const char *name,
const char *parent,
- apr_pool_t *pool)
+ apr_pool_t *result_pool)
{
- svn_error_t *err = svn_path_cstring_to_utf8(name_p, name, pool);
+ svn_error_t *err = svn_path_cstring_to_utf8(name_p, name, result_pool);
if (err && err->apr_err == APR_EINVAL)
{
return svn_error_createf(err->apr_err, err,
_("Error converting entry "
"in directory '%s' to UTF-8"),
- svn_dirent_local_style(parent, pool));
+ svn_dirent_local_style(parent, result_pool));
}
return err;
}
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/low_level.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/low_level.c?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/low_level.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/low_level.c Mon Feb 9 16:46:16 2015
@@ -48,7 +48,6 @@
#define HEADER_PRED "pred"
#define HEADER_COPYFROM "copyfrom"
#define HEADER_COPYROOT "copyroot"
-#define HEADER_FRESHTXNRT "is-fresh-txn-root"
#define HEADER_MINFO_HERE "minfo-here"
#define HEADER_MINFO_CNT "minfo-cnt"
@@ -560,10 +559,6 @@ svn_fs_x__read_noderev(svn_fs_x__noderev
result_pool);
}
- /* Get whether this is a fresh txn root. */
- value = svn_hash_gets(headers, HEADER_FRESHTXNRT);
- noderev->is_fresh_txn_root = (value != NULL);
-
/* Get the mergeinfo count. */
value = svn_hash_gets(headers, HEADER_MINFO_CNT);
if (value)
@@ -691,9 +686,6 @@ svn_fs_x__write_noderev(svn_stream_t *ou
auto_escape_path(noderev->copyroot_path,
scratch_pool)));
- if (noderev->is_fresh_txn_root)
- SVN_ERR(svn_stream_puts(outfile, HEADER_FRESHTXNRT ": y\n"));
-
if (noderev->mergeinfo_count > 0)
SVN_ERR(svn_stream_printf(outfile, scratch_pool, HEADER_MINFO_CNT ": %"
APR_INT64_T_FMT "\n",
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/noderevs.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/noderevs.c?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/noderevs.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/noderevs.c Mon Feb 9 16:46:16 2015
@@ -49,28 +49,6 @@
/* the noderev has copy-root path and revision */
#define NODEREV_HAS_CPATH 0x00040
-/* Our internal representation of an representation.
- */
-typedef struct binary_representation_t
-{
- /* Checksums digests for the contents produced by this representation.
- If has_sha1 is FALSE, sha1_digest is not being used. */
- svn_boolean_t has_sha1;
- unsigned char sha1_digest[APR_SHA1_DIGESTSIZE];
- unsigned char md5_digest[APR_MD5_DIGESTSIZE];
-
- /* Location of this representation. */
- svn_fs_x__id_t id;
-
- /* The size of the representation in bytes as seen in the revision
- file. */
- svn_filesize_t size;
-
- /* The size of the fulltext of the representation. If this is 0,
- * the fulltext size is equal to representation size in the rev file, */
- svn_filesize_t expanded_size;
-} binary_representation_t;
-
/* Our internal representation of a svn_fs_x__noderev_t.
*
* We will store path strings in a string container and reference them
@@ -181,7 +159,7 @@ svn_fs_x__noderevs_create(int initial_co
= apr_array_make(result_pool, 2 * initial_count, sizeof(svn_fs_x__id_t));
noderevs->reps
= apr_array_make(result_pool, 2 * initial_count,
- sizeof(binary_representation_t));
+ sizeof(svn_fs_x__representation_t));
noderevs->noderevs
= apr_array_make(result_pool, initial_count, sizeof(binary_noderev_t));
@@ -223,25 +201,17 @@ store_representation(apr_array_header_t
apr_hash_t *dict,
const svn_fs_x__representation_t *rep)
{
- binary_representation_t binary_rep = { 0 };
int idx;
void *idx_void;
if (rep == NULL)
return 0;
- binary_rep.has_sha1 = rep->has_sha1;
- memcpy(binary_rep.sha1_digest, rep->sha1_digest, sizeof(rep->sha1_digest));
- memcpy(binary_rep.md5_digest, rep->md5_digest, sizeof(rep->md5_digest));
- binary_rep.id = rep->id;
- binary_rep.size = rep->size;
- binary_rep.expanded_size = rep->expanded_size;
-
- idx_void = apr_hash_get(dict, &binary_rep, sizeof(binary_rep));
+ idx_void = apr_hash_get(dict, rep, sizeof(*rep));
idx = (int)(apr_uintptr_t)idx_void;
if (idx == 0)
{
- APR_ARRAY_PUSH(reps, binary_representation_t) = binary_rep;
+ APR_ARRAY_PUSH(reps, svn_fs_x__representation_t) = *rep;
idx = reps->nelts;
apr_hash_set(dict, reps->elts + (idx-1) * reps->elt_size,
reps->elt_size, (void*)(apr_uintptr_t)idx);
@@ -365,8 +335,6 @@ get_representation(svn_fs_x__representat
int idx,
apr_pool_t *pool)
{
- binary_representation_t *binary_rep;
-
/* handle NULL representations */
if (idx == 0)
{
@@ -382,17 +350,9 @@ get_representation(svn_fs_x__representat
idx, reps->nelts);
/* no translation required. Just duplicate the info */
- binary_rep = &APR_ARRAY_IDX(reps, idx - 1, binary_representation_t);
-
- *rep = apr_pcalloc(pool, sizeof(**rep));
- (*rep)->has_sha1 = binary_rep->has_sha1;
- memcpy((*rep)->sha1_digest, binary_rep->sha1_digest,
- sizeof((*rep)->sha1_digest));
- memcpy((*rep)->md5_digest, binary_rep->md5_digest,
- sizeof((*rep)->md5_digest));
- (*rep)->id = binary_rep->id;
- (*rep)->size = binary_rep->size;
- (*rep)->expanded_size = binary_rep->expanded_size;
+ *rep = apr_pmemdup(pool,
+ &APR_ARRAY_IDX(reps, idx - 1, svn_fs_x__representation_t),
+ sizeof(**rep));
return SVN_NO_ERROR;
}
@@ -517,8 +477,8 @@ write_reps(svn_packed__int_stream_t *rep
int i;
for (i = 0; i < reps->nelts; ++i)
{
- binary_representation_t *rep
- = &APR_ARRAY_IDX(reps, i, binary_representation_t);
+ svn_fs_x__representation_t *rep
+ = &APR_ARRAY_IDX(reps, i, svn_fs_x__representation_t);
svn_packed__add_uint(rep_stream, rep->has_sha1);
@@ -635,11 +595,11 @@ read_reps(apr_array_header_t **reps_p,
apr_size_t count
= svn_packed__int_count(svn_packed__first_int_substream(rep_stream));
apr_array_header_t *reps
- = apr_array_make(pool, (int)count, sizeof(binary_representation_t));
+ = apr_array_make(pool, (int)count, sizeof(svn_fs_x__representation_t));
for (i = 0; i < count; ++i)
{
- binary_representation_t rep;
+ svn_fs_x__representation_t rep;
rep.has_sha1 = (svn_boolean_t)svn_packed__get_uint(rep_stream);
@@ -674,7 +634,7 @@ read_reps(apr_array_header_t **reps_p,
memcpy(rep.sha1_digest, bytes, sizeof(rep.sha1_digest));
}
- APR_ARRAY_PUSH(reps, binary_representation_t) = rep;
+ APR_ARRAY_PUSH(reps, svn_fs_x__representation_t) = rep;
}
*reps_p = reps;
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/revprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/revprops.c?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/revprops.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/revprops.c Mon Feb 9 16:46:16 2015
@@ -698,17 +698,18 @@ parse_revprop(apr_hash_t **properties,
* If the data could not be read due to an otherwise recoverable error,
* leave *PROPERTIES unchanged. No error will be returned in that case.
*
- * Allocations will be done in POOL.
+ * Allocate *PROPERTIES in RESULT_POOL and temporaries in SCRATCH_POOL.
*/
static svn_error_t *
read_non_packed_revprop(apr_hash_t **properties,
svn_fs_t *fs,
svn_revnum_t rev,
apr_int64_t generation,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_stringbuf_t *content = NULL;
- apr_pool_t *iterpool = svn_pool_create(pool);
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
svn_boolean_t missing = FALSE;
int i;
@@ -727,7 +728,7 @@ read_non_packed_revprop(apr_hash_t **pro
if (content)
SVN_ERR(parse_revprop(properties, fs, rev, generation,
svn_stringbuf__morph_into_string(content),
- pool, iterpool));
+ result_pool, iterpool));
svn_pool_clear(iterpool);
@@ -888,6 +889,7 @@ parse_packed_revprops(svn_fs_t *fs,
apr_off_t offset;
const char *header_end;
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+ svn_boolean_t cache_all = has_revprop_cache(fs, scratch_pool);
/* decompress (even if the data is only "stored", there is still a
* length header to remove) */
@@ -968,15 +970,24 @@ parse_packed_revprops(svn_fs_t *fs,
if (revision == revprops->revision)
{
+ /* Parse (and possibly cache) the one revprop list we care about. */
SVN_ERR(parse_revprop(&revprops->properties, fs, revision,
revprops->generation, &serialized,
result_pool, iterpool));
revprops->serialized_size = serialized.len;
/* If we only wanted the revprops for REVISION then we are done. */
- if (!read_all)
+ if (!read_all && !cache_all)
break;
}
+ else if (cache_all)
+ {
+ /* Parse and cache all other revprop lists. */
+ apr_hash_t *properties;
+ SVN_ERR(parse_revprop(&properties, fs, revision,
+ revprops->generation, &serialized,
+ iterpool, iterpool));
+ }
if (read_all)
{
@@ -996,7 +1007,8 @@ parse_packed_revprops(svn_fs_t *fs,
* *REVPROPS. Use GENERATION to populate the revprop cache, if enabled.
* If you want to modify revprop contents / update REVPROPS, READ_ALL
* must be set. Otherwise, only the properties of REV are being provided.
- * Allocate data in POOL.
+ *
+ * Allocate *PROPERTIES in RESULT_POOL and temporaries in SCRATCH_POOL.
*/
static svn_error_t *
read_pack_revprop(packed_revprops_t **revprops,
@@ -1004,9 +1016,10 @@ read_pack_revprop(packed_revprops_t **re
svn_revnum_t rev,
apr_int64_t generation,
svn_boolean_t read_all,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
- apr_pool_t *iterpool = svn_pool_create(pool);
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
svn_boolean_t missing = FALSE;
svn_error_t *err;
packed_revprops_t *result;
@@ -1021,7 +1034,7 @@ read_pack_revprop(packed_revprops_t **re
_("No such packed revision %ld"), rev);
/* initialize the result data structure */
- result = apr_pcalloc(pool, sizeof(*result));
+ result = apr_pcalloc(result_pool, sizeof(*result));
result->revision = rev;
result->generation = generation;
@@ -1037,7 +1050,7 @@ read_pack_revprop(packed_revprops_t **re
/* there might have been concurrent writes.
* Re-read the manifest and the pack file.
*/
- SVN_ERR(get_revprop_packname(fs, result, pool, iterpool));
+ SVN_ERR(get_revprop_packname(fs, result, result_pool, iterpool));
file_path = svn_dirent_join(result->folder,
result->filename,
iterpool);
@@ -1045,15 +1058,15 @@ read_pack_revprop(packed_revprops_t **re
&missing,
file_path,
i + 1 < SVN_FS_X__RECOVERABLE_RETRY_COUNT,
- pool));
+ result_pool));
/* If we could not find the file, there was a write.
* So, we should refresh our revprop generation info as well such
* that others may find data we will put into the cache. They would
* consider it outdated, otherwise.
*/
- if (missing && has_revprop_cache(fs, pool))
- SVN_ERR(read_revprop_generation(&result->generation, fs, pool));
+ if (missing && has_revprop_cache(fs, iterpool))
+ SVN_ERR(read_revprop_generation(&result->generation, fs, iterpool));
}
/* the file content should be available now */
@@ -1062,7 +1075,7 @@ read_pack_revprop(packed_revprops_t **re
_("Failed to read revprop pack file for r%ld"), rev);
/* parse it. RESULT will be complete afterwards. */
- err = parse_packed_revprops(fs, result, read_all, pool, iterpool);
+ err = parse_packed_revprops(fs, result, read_all, result_pool, iterpool);
svn_pool_destroy(iterpool);
if (err)
return svn_error_createf(SVN_ERR_FS_CORRUPT, err,
@@ -1082,7 +1095,8 @@ svn_fs_x__get_revision_proplist(apr_hash
svn_fs_t *fs,
svn_revnum_t rev,
svn_boolean_t bypass_cache,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_fs_x__data_t *ffd = fs->fsap_data;
apr_int64_t generation = 0;
@@ -1091,20 +1105,20 @@ svn_fs_x__get_revision_proplist(apr_hash
*proplist_p = NULL;
/* should they be available at all? */
- SVN_ERR(svn_fs_x__ensure_revision_exists(rev, fs, pool));
+ SVN_ERR(svn_fs_x__ensure_revision_exists(rev, fs, scratch_pool));
/* Try cache lookup first. */
- if (!bypass_cache && has_revprop_cache(fs, pool))
+ if (!bypass_cache && has_revprop_cache(fs, scratch_pool))
{
svn_boolean_t is_cached;
svn_fs_x__pair_cache_key_t key = { 0 };
- SVN_ERR(read_revprop_generation(&generation, fs, pool));
+ SVN_ERR(read_revprop_generation(&generation, fs, scratch_pool));
key.revision = rev;
key.second = generation;
SVN_ERR(svn_cache__get((void **) proplist_p, &is_cached,
- ffd->revprop_cache, &key, pool));
+ ffd->revprop_cache, &key, result_pool));
if (is_cached)
return SVN_NO_ERROR;
}
@@ -1115,7 +1129,8 @@ svn_fs_x__get_revision_proplist(apr_hash
if (!svn_fs_x__is_packed_revprop(fs, rev))
{
svn_error_t *err = read_non_packed_revprop(proplist_p, fs, rev,
- generation, pool);
+ generation, result_pool,
+ scratch_pool);
if (err)
{
if (!APR_STATUS_IS_ENOENT(err->apr_err))
@@ -1132,7 +1147,8 @@ svn_fs_x__get_revision_proplist(apr_hash
if (!*proplist_p)
{
packed_revprops_t *revprops;
- SVN_ERR(read_pack_revprop(&revprops, fs, rev, generation, FALSE, pool));
+ SVN_ERR(read_pack_revprop(&revprops, fs, rev, generation, FALSE,
+ result_pool, scratch_pool));
*proplist_p = revprops->properties;
}
@@ -1150,7 +1166,8 @@ svn_fs_x__get_revision_proplist(apr_hash
* file in *TMP_PATH and the file path that it must be moved to in
* *FINAL_PATH.
*
- * Use POOL for allocations.
+ * Allocate *FINAL_PATH and *TMP_PATH in RESULT_POOL. Use SCRATCH_POOL
+ * for temporary allocations.
*/
static svn_error_t *
write_non_packed_revprop(const char **final_path,
@@ -1158,17 +1175,21 @@ write_non_packed_revprop(const char **fi
svn_fs_t *fs,
svn_revnum_t rev,
apr_hash_t *proplist,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_stream_t *stream;
- *final_path = svn_fs_x__path_revprops(fs, rev, pool);
+ *final_path = svn_fs_x__path_revprops(fs, rev, result_pool);
/* ### do we have a directory sitting around already? we really shouldn't
### have to get the dirname here. */
SVN_ERR(svn_stream_open_unique(&stream, tmp_path,
- svn_dirent_dirname(*final_path, pool),
- svn_io_file_del_none, pool, pool));
- SVN_ERR(svn_hash_write2(proplist, stream, SVN_HASH_TERMINATOR, pool));
+ svn_dirent_dirname(*final_path,
+ scratch_pool),
+ svn_io_file_del_none,
+ result_pool, scratch_pool));
+ SVN_ERR(svn_hash_write2(proplist, stream, SVN_HASH_TERMINATOR,
+ scratch_pool));
SVN_ERR(svn_stream_close(stream));
return SVN_NO_ERROR;
@@ -1344,7 +1365,10 @@ repack_revprops(svn_fs_t *fs,
* [REVPROPS->START_REVISION + START, REVPROPS->START_REVISION + END - 1]
* of REVPROPS->MANIFEST. Add the name of old file to FILES_TO_DELETE,
* auto-create that array if necessary. Return an open file stream to
- * the new file in *STREAM allocated in POOL.
+ * the new file in *STREAM allocated in RESULT_POOL. Allocate the paths
+ * in *FILES_TO_DELETE from the same pool that contains the array itself.
+ *
+ * Use SCRATCH_POOL for temporary allocations.
*/
static svn_error_t *
repack_stream_open(svn_stream_t **stream,
@@ -1353,7 +1377,8 @@ repack_stream_open(svn_stream_t **stream
int start,
int end,
apr_array_header_t **files_to_delete,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
apr_int64_t tag;
const char *tag_string;
@@ -1369,10 +1394,11 @@ repack_stream_open(svn_stream_t **stream
const char*);
if (*files_to_delete == NULL)
- *files_to_delete = apr_array_make(pool, 3, sizeof(const char*));
+ *files_to_delete = apr_array_make(result_pool, 3, sizeof(const char*));
APR_ARRAY_PUSH(*files_to_delete, const char*)
- = svn_dirent_join(revprops->folder, old_filename, pool);
+ = svn_dirent_join(revprops->folder, old_filename,
+ (*files_to_delete)->pool);
/* increase the tag part, i.e. the counter after the dot */
tag_string = strchr(old_filename, '.');
@@ -1382,7 +1408,8 @@ repack_stream_open(svn_stream_t **stream
old_filename);
SVN_ERR(svn_cstring_atoi64(&tag, tag_string + 1));
- new_filename = svn_string_createf(pool, "%ld.%" APR_INT64_T_FMT,
+ new_filename = svn_string_createf((*files_to_delete)->pool,
+ "%ld.%" APR_INT64_T_FMT,
revprops->start_revision + start,
++tag);
@@ -1394,9 +1421,10 @@ repack_stream_open(svn_stream_t **stream
/* create a file stream for the new file */
SVN_ERR(svn_io_file_open(&file, svn_dirent_join(revprops->folder,
new_filename->data,
- pool),
- APR_WRITE | APR_CREATE, APR_OS_DEFAULT, pool));
- *stream = svn_stream_from_aprfile2(file, FALSE, pool);
+ scratch_pool),
+ APR_WRITE | APR_CREATE, APR_OS_DEFAULT,
+ result_pool));
+ *stream = svn_stream_from_aprfile2(file, FALSE, result_pool);
return SVN_NO_ERROR;
}
@@ -1405,7 +1433,8 @@ repack_stream_open(svn_stream_t **stream
* PROPLIST. Return a new file in *TMP_PATH that the caller shall move
* to *FINAL_PATH to make the change visible. Files to be deleted will
* be listed in *FILES_TO_DELETE which may remain unchanged / unallocated.
- * Use POOL for allocations.
+ *
+ * Allocate output values in RESULT_POOL and temporaries from SCRATCH_POOL.
*/
static svn_error_t *
write_packed_revprop(const char **final_path,
@@ -1414,7 +1443,8 @@ write_packed_revprop(const char **final_
svn_fs_t *fs,
svn_revnum_t rev,
apr_hash_t *proplist,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_fs_x__data_t *ffd = fs->fsap_data;
packed_revprops_t *revprops;
@@ -1426,16 +1456,18 @@ write_packed_revprop(const char **final_
/* read the current revprop generation. This value will not change
* while we hold the global write lock to this FS. */
- if (has_revprop_cache(fs, pool))
- SVN_ERR(read_revprop_generation(&generation, fs, pool));
+ if (has_revprop_cache(fs, scratch_pool))
+ SVN_ERR(read_revprop_generation(&generation, fs, scratch_pool));
/* read contents of the current pack file */
- SVN_ERR(read_pack_revprop(&revprops, fs, rev, generation, TRUE, pool));
+ SVN_ERR(read_pack_revprop(&revprops, fs, rev, generation, TRUE,
+ scratch_pool, scratch_pool));
/* serialize the new revprops */
- serialized = svn_stringbuf_create_empty(pool);
- stream = svn_stream_from_stringbuf(serialized, pool);
- SVN_ERR(svn_hash_write2(proplist, stream, SVN_HASH_TERMINATOR, pool));
+ serialized = svn_stringbuf_create_empty(scratch_pool);
+ stream = svn_stream_from_stringbuf(serialized, scratch_pool);
+ SVN_ERR(svn_hash_write2(proplist, stream, SVN_HASH_TERMINATOR,
+ scratch_pool));
SVN_ERR(svn_stream_close(stream));
/* calculate the size of the new data */
@@ -1454,12 +1486,13 @@ write_packed_revprop(const char **final_
* in the non-packed case */
*final_path = svn_dirent_join(revprops->folder, revprops->filename,
- pool);
+ result_pool);
SVN_ERR(svn_stream_open_unique(&stream, tmp_path, revprops->folder,
- svn_io_file_del_none, pool, pool));
+ svn_io_file_del_none, result_pool,
+ scratch_pool));
SVN_ERR(repack_revprops(fs, revprops, 0, revprops->sizes->nelts,
changed_index, serialized, new_total_size,
- stream, pool));
+ stream, scratch_pool));
}
else
{
@@ -1502,25 +1535,32 @@ write_packed_revprop(const char **final_
right_count = revprops->sizes->nelts - left_count - 1;
}
+ /* Allocate this here such that we can call the repack functions with
+ * the scratch pool alone. */
+ if (*files_to_delete == NULL)
+ *files_to_delete = apr_array_make(result_pool, 3,
+ sizeof(const char*));
+
/* write the new, split files */
if (left_count)
{
SVN_ERR(repack_stream_open(&stream, fs, revprops, 0,
- left_count, files_to_delete, pool));
+ left_count, files_to_delete,
+ scratch_pool, scratch_pool));
SVN_ERR(repack_revprops(fs, revprops, 0, left_count,
changed_index, serialized, new_total_size,
- stream, pool));
+ stream, scratch_pool));
}
if (left_count + right_count < revprops->sizes->nelts)
{
SVN_ERR(repack_stream_open(&stream, fs, revprops, changed_index,
changed_index + 1, files_to_delete,
- pool));
+ scratch_pool, scratch_pool));
SVN_ERR(repack_revprops(fs, revprops, changed_index,
changed_index + 1,
changed_index, serialized, new_total_size,
- stream, pool));
+ stream, scratch_pool));
}
if (right_count)
@@ -1528,24 +1568,27 @@ write_packed_revprop(const char **final_
SVN_ERR(repack_stream_open(&stream, fs, revprops,
revprops->sizes->nelts - right_count,
revprops->sizes->nelts,
- files_to_delete, pool));
+ files_to_delete, scratch_pool,
+ scratch_pool));
SVN_ERR(repack_revprops(fs, revprops,
revprops->sizes->nelts - right_count,
revprops->sizes->nelts, changed_index,
serialized, new_total_size, stream,
- pool));
+ scratch_pool));
}
/* write the new manifest */
- *final_path = svn_dirent_join(revprops->folder, PATH_MANIFEST, pool);
+ *final_path = svn_dirent_join(revprops->folder, PATH_MANIFEST,
+ result_pool);
SVN_ERR(svn_stream_open_unique(&stream, tmp_path, revprops->folder,
- svn_io_file_del_none, pool, pool));
+ svn_io_file_del_none, result_pool,
+ scratch_pool));
for (i = 0; i < revprops->manifest->nelts; ++i)
{
const char *filename = APR_ARRAY_IDX(revprops->manifest, i,
const char*);
- SVN_ERR(svn_stream_printf(stream, pool, "%s\n", filename));
+ SVN_ERR(svn_stream_printf(stream, scratch_pool, "%s\n", filename));
}
SVN_ERR(svn_stream_close(stream));
@@ -1593,10 +1636,12 @@ svn_fs_x__set_revision_proplist(svn_fs_t
/* Serialize the new revprop data */
if (is_packed)
SVN_ERR(write_packed_revprop(&final_path, &tmp_path, &files_to_delete,
- fs, rev, proplist, scratch_pool));
+ fs, rev, proplist, scratch_pool,
+ scratch_pool));
else
SVN_ERR(write_non_packed_revprop(&final_path, &tmp_path,
- fs, rev, proplist, scratch_pool));
+ fs, rev, proplist, scratch_pool,
+ scratch_pool));
/* We use the rev file of this revision as the perms reference,
* because when setting revprops for the first time, the revprop
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/revprops.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/revprops.h?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/revprops.h (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/revprops.h Mon Feb 9 16:46:16 2015
@@ -75,17 +75,19 @@ svn_fs_x__upgrade_cleanup_pack_revprops(
void *cancel_baton,
apr_pool_t *scratch_pool);
-/* Read the revprops for revision REV in FS and return them in *PROPERTIES_P.
+/* Read the revprops for revision REV in FS and return them in *PROPLIST_P.
* If BYPASS_CACHE is set, don't consult the disks but always read from disk.
*
- * Allocations will be done in POOL.
+ * Allocate the *PROPLIST_P in RESULT_POOL and use SCRATCH_POOL for temporary
+ * allocations.
*/
svn_error_t *
svn_fs_x__get_revision_proplist(apr_hash_t **proplist_p,
svn_fs_t *fs,
svn_revnum_t rev,
svn_boolean_t bypass_cache,
- apr_pool_t *pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Set the revision property list of revision REV in filesystem FS to
PROPLIST. Use SCRATCH_POOL for temporary allocations. */
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/transaction.c?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/transaction.c Mon Feb 9 16:46:16 2015
@@ -758,17 +758,39 @@ purge_shared_txn(svn_fs_t *fs,
}
+svn_boolean_t
+svn_fs_x__is_fresh_txn_root(svn_fs_x__noderev_t *noderev)
+{
+ /* Is it a root node? */
+ if (noderev->noderev_id.number != SVN_FS_X__ITEM_INDEX_ROOT_NODE)
+ return FALSE;
+
+ /* ... in a transaction? */
+ if (!svn_fs_x__is_txn(noderev->noderev_id.change_set))
+ return FALSE;
+
+ /* ... with no prop change in that txn?
+ (Once we set a property, the prop rep will never become NULL again.) */
+ if (noderev->prop_rep && svn_fs_x__is_txn(noderev->prop_rep->id.change_set))
+ return FALSE;
+
+ /* ... and no sub-tree change?
+ (Once we set a text, the data rep will never become NULL again.) */
+ if (noderev->data_rep && svn_fs_x__is_txn(noderev->data_rep->id.change_set))
+ return FALSE;
+
+ /* Root node of a txn with no changes. */
+ return TRUE;
+}
+
svn_error_t *
svn_fs_x__put_node_revision(svn_fs_t *fs,
svn_fs_x__noderev_t *noderev,
- svn_boolean_t fresh_txn_root,
apr_pool_t *scratch_pool)
{
apr_file_t *noderev_file;
const svn_fs_x__id_t *id = &noderev->noderev_id;
- noderev->is_fresh_txn_root = fresh_txn_root;
-
if (! svn_fs_x__is_txn(id->change_set))
return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
_("Attempted to write to non-transaction '%s'"),
@@ -1167,7 +1189,7 @@ create_new_txn_noderev_from_rev(svn_fs_t
/* For the transaction root, the copyroot never changes. */
svn_fs_x__init_txn_root(&noderev->noderev_id, txn_id);
- return svn_fs_x__put_node_revision(fs, noderev, TRUE, scratch_pool);
+ return svn_fs_x__put_node_revision(fs, noderev, scratch_pool);
}
/* A structure used by get_and_increment_txn_key_body(). */
@@ -1650,7 +1672,7 @@ svn_fs_x__create_node(svn_fs_t *fs,
SVN_ERR(allocate_item_index(&noderev->noderev_id.number, fs, txn_id,
scratch_pool));
- SVN_ERR(svn_fs_x__put_node_revision(fs, noderev, FALSE, scratch_pool));
+ SVN_ERR(svn_fs_x__put_node_revision(fs, noderev, scratch_pool));
return SVN_NO_ERROR;
}
@@ -1746,8 +1768,7 @@ svn_fs_x__set_entry(svn_fs_t *fs,
rep->id.number = SVN_FS_X__ITEM_INDEX_UNUSED;
/* Save noderev to disk. */
- SVN_ERR(svn_fs_x__put_node_revision(fs, parent_noderev, FALSE,
- subpool));
+ SVN_ERR(svn_fs_x__put_node_revision(fs, parent_noderev, subpool));
}
else
{
@@ -2390,8 +2411,7 @@ rep_write_contents_close(void *baton)
apr_pool_cleanup_kill(b->local_pool, b, rep_write_cleanup);
/* Write out the new node-rev information. */
- SVN_ERR(svn_fs_x__put_node_revision(b->fs, b->noderev, FALSE,
- b->local_pool));
+ SVN_ERR(svn_fs_x__put_node_revision(b->fs, b->noderev, b->local_pool));
if (!old_rep)
{
svn_fs_x__p2l_entry_t entry;
@@ -2478,7 +2498,7 @@ svn_fs_x__create_successor(svn_fs_t *fs,
= svn_fs_x__get_revnum(new_noderev->noderev_id.change_set);
}
- SVN_ERR(svn_fs_x__put_node_revision(fs, new_noderev, FALSE, scratch_pool));
+ SVN_ERR(svn_fs_x__put_node_revision(fs, new_noderev, scratch_pool));
return SVN_NO_ERROR;
}
@@ -2513,7 +2533,7 @@ svn_fs_x__set_proplist(svn_fs_t *fs,
noderev->prop_rep->id.change_set = id->change_set;
SVN_ERR(allocate_item_index(&noderev->prop_rep->id.number, fs,
txn_id, scratch_pool));
- SVN_ERR(svn_fs_x__put_node_revision(fs, noderev, FALSE, scratch_pool));
+ SVN_ERR(svn_fs_x__put_node_revision(fs, noderev, scratch_pool));
}
return SVN_NO_ERROR;
@@ -2983,9 +3003,6 @@ write_final_rev(svn_fs_x__id_t *new_id_p
if (noderev->prop_rep)
noderev->prop_rep->has_sha1 = FALSE;
- /* Workaround issue #4031: is-fresh-txn-root in revision files. */
- noderev->is_fresh_txn_root = FALSE;
-
/* Write out our new node-revision. */
if (at_root)
SVN_ERR(validate_root_noderev(fs, noderev, rev, scratch_pool));
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/transaction.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/transaction.h?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/transaction.h (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/transaction.h Mon Feb 9 16:46:16 2015
@@ -73,13 +73,16 @@ svn_fs_x__with_all_locks(svn_fs_t *fs,
void *baton,
apr_pool_t *scratch_pool);
+/* Return TRUE, iff NODEREV is the root node of a transaction that has not
+ seen any modifications, yet. */
+svn_boolean_t
+svn_fs_x__is_fresh_txn_root(svn_fs_x__noderev_t *noderev);
+
/* Store NODEREV as the node-revision in the transaction defined by NODEREV's
- ID within FS, after setting its is_fresh_txn_root to FRESH_TXN_ROOT. Do
- any necessary temporary allocation in SCRATCH_POOL. */
+ ID within FS. Do any necessary temporary allocation in SCRATCH_POOL. */
svn_error_t *
svn_fs_x__put_node_revision(svn_fs_t *fs,
svn_fs_x__noderev_t *noderev,
- svn_boolean_t fresh_txn_root,
apr_pool_t *scratch_pool);
/* Find the paths which were changed in transaction TXN_ID of
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/tree.c?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/tree.c Mon Feb 9 16:46:16 2015
@@ -564,42 +564,45 @@ root_txn_id(svn_fs_root_t *root)
}
/* Set *NODE_P to a freshly opened dag node referring to the root
- directory of ROOT, allocating from RESULT_POOL. */
+ directory of ROOT, allocating from RESULT_POOL. Use SCRATCH_POOL
+ for temporary allocations. */
static svn_error_t *
root_node(dag_node_t **node_p,
svn_fs_root_t *root,
- apr_pool_t *result_pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
if (root->is_txn_root)
{
/* It's a transaction root. Open a fresh copy. */
return svn_fs_x__dag_txn_root(node_p, root->fs, root_txn_id(root),
- result_pool);
+ result_pool, scratch_pool);
}
else
{
/* It's a revision root, so we already have its root directory
opened. */
return svn_fs_x__dag_revision_root(node_p, root->fs, root->rev,
- result_pool);
+ result_pool, scratch_pool);
}
}
/* Set *NODE_P to a mutable root directory for ROOT, cloning if
necessary, allocating in RESULT_POOL. ROOT must be a transaction root.
- Use ERROR_PATH in error messages. */
+ Use ERROR_PATH in error messages. Use SCRATCH_POOL for temporaries.*/
static svn_error_t *
mutable_root_node(dag_node_t **node_p,
svn_fs_root_t *root,
const char *error_path,
- apr_pool_t *result_pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
if (root->is_txn_root)
{
/* It's a transaction root. Open a fresh copy. */
- return svn_fs_x__dag_clone_root(node_p, root->fs, root_txn_id(root),
- result_pool);
+ return svn_fs_x__dag_txn_root(node_p, root->fs, root_txn_id(root),
+ result_pool, scratch_pool);
}
else
/* If it's not a transaction root, we can't change its contents. */
@@ -969,7 +972,7 @@ open_path(parent_path_t **parent_path_p,
{
/* Make a parent_path item for the root node, using its own current
copy id. */
- SVN_ERR(root_node(&here, root, pool));
+ SVN_ERR(root_node(&here, root, pool, iterpool));
rest = path + 1; /* skip the leading '/', it saves in iteration */
}
@@ -990,6 +993,10 @@ open_path(parent_path_t **parent_path_p,
svn_pool_clear(iterpool);
+ /* The NODE in PARENT_PATH always lives in POOL, i.e. it will
+ * survive the cleanup of ITERPOOL and the DAG cache.*/
+ here = parent_path->node;
+
/* Parse out the next entry from the path. */
entry = svn_fs__next_entry_name(&next, rest, pool);
@@ -1083,10 +1090,6 @@ open_path(parent_path_t **parent_path_p,
apr_psprintf(iterpool, _("Failure opening '%s'"), path));
rest = next;
-
- /* The NODE in PARENT_PATH equals CHILD but lives in POOL, i.e.
- * it will survive the cleanup of ITERPOOL.*/
- here = parent_path->node;
}
svn_pool_destroy(iterpool);
@@ -1186,7 +1189,8 @@ make_path_mutable(svn_fs_root_t *root,
else
{
/* We're trying to clone the root directory. */
- SVN_ERR(mutable_root_node(&clone, root, error_path, result_pool));
+ SVN_ERR(mutable_root_node(&clone, root, error_path, result_pool,
+ scratch_pool));
}
/* Update the PARENT_PATH link to refer to the clone. */
@@ -1698,9 +1702,9 @@ compare_dir_structure(svn_boolean_t *cha
/* Modified but not copied / replaced or anything? */
SVN_ERR(svn_fs_x__dag_get_node(&lhs_node, fs, &lhs_entry->id,
- iterpool));
+ iterpool, iterpool));
SVN_ERR(svn_fs_x__dag_get_node(&rhs_node, fs, &rhs_entry->id,
- iterpool));
+ iterpool, iterpool));
SVN_ERR(svn_fs_x__dag_same_line_of_history(&same_history,
lhs_node, rhs_node));
if (same_history)
@@ -1949,7 +1953,7 @@ merge(svn_stringbuf_t *conflict_p,
dag_node_t *t_ent_node;
SVN_ERR(svn_fs_x__dag_get_node(&t_ent_node, fs, &t_entry->id,
- iterpool));
+ iterpool, iterpool));
SVN_ERR(svn_fs_x__dag_get_mergeinfo_count(&mergeinfo_start,
t_ent_node));
mergeinfo_increment -= mergeinfo_start;
@@ -1958,7 +1962,7 @@ merge(svn_stringbuf_t *conflict_p,
{
dag_node_t *s_ent_node;
SVN_ERR(svn_fs_x__dag_get_node(&s_ent_node, fs, &s_entry->id,
- iterpool));
+ iterpool, iterpool));
SVN_ERR(svn_fs_x__dag_get_mergeinfo_count(&mergeinfo_end,
s_ent_node));
@@ -2007,11 +2011,11 @@ merge(svn_stringbuf_t *conflict_p,
/* Fetch DAG nodes to efficiently access ID parts. */
SVN_ERR(svn_fs_x__dag_get_node(&s_ent_node, fs, &s_entry->id,
- iterpool));
+ iterpool, iterpool));
SVN_ERR(svn_fs_x__dag_get_node(&t_ent_node, fs, &t_entry->id,
- iterpool));
+ iterpool, iterpool));
SVN_ERR(svn_fs_x__dag_get_node(&a_ent_node, fs, &a_entry->id,
- iterpool));
+ iterpool, iterpool));
/* If either SOURCE-ENTRY or TARGET-ENTRY is not a direct
modification of ANCESTOR-ENTRY, declare a conflict. */
@@ -2063,7 +2067,7 @@ merge(svn_stringbuf_t *conflict_p,
iterpool));
SVN_ERR(svn_fs_x__dag_get_node(&s_ent_node, fs, &s_entry->id,
- iterpool));
+ iterpool, iterpool));
SVN_ERR(svn_fs_x__dag_get_mergeinfo_count(&mergeinfo_s, s_ent_node));
mergeinfo_increment += mergeinfo_s;
@@ -2107,11 +2111,14 @@ merge_changes(dag_node_t *ancestor_node,
svn_fs_x__txn_id_t txn_id = svn_fs_x__txn_get_id(txn);
svn_boolean_t related;
- SVN_ERR(svn_fs_x__dag_txn_root(&txn_root_node, fs, txn_id, scratch_pool));
+ SVN_ERR(svn_fs_x__dag_txn_root(&txn_root_node, fs, txn_id, scratch_pool,
+ scratch_pool));
if (ancestor_node == NULL)
{
- SVN_ERR(svn_fs_x__dag_txn_base_root(&ancestor_node, fs, txn_id,
+ svn_revnum_t base_rev;
+ SVN_ERR(svn_fs_x__get_base_rev(&base_rev, fs, txn_id, scratch_pool));
+ SVN_ERR(svn_fs_x__dag_revision_root(&ancestor_node, fs, base_rev,
scratch_pool, scratch_pool));
}
@@ -3625,7 +3632,8 @@ history_prev(svn_fs_history_t **prev_his
/* Replace NODE and friends with the information from its
predecessor. */
- SVN_ERR(svn_fs_x__dag_get_node(&node, fs, &pred_id, scratch_pool));
+ SVN_ERR(svn_fs_x__dag_get_node(&node, fs, &pred_id, scratch_pool,
+ scratch_pool));
commit_path = svn_fs_x__dag_get_created_path(node);
commit_rev = svn_fs_x__dag_get_revision(node);
}
@@ -4351,7 +4359,8 @@ verify_node(dag_node_t *node,
{
dag_node_t *pred;
int pred_pred_count;
- SVN_ERR(svn_fs_x__dag_get_node(&pred, fs, &pred_id, iterpool));
+ SVN_ERR(svn_fs_x__dag_get_node(&pred, fs, &pred_id, iterpool,
+ iterpool));
SVN_ERR(svn_fs_x__dag_get_predecessor_count(&pred_pred_count, pred));
if (pred_pred_count+1 != pred_count)
return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
@@ -4402,7 +4411,7 @@ verify_node(dag_node_t *node,
if (svn_fs_x__get_revnum(dirent->id.change_set) == rev)
{
SVN_ERR(svn_fs_x__dag_get_node(&child, fs, &dirent->id,
- iterpool));
+ iterpool, iterpool));
SVN_ERR(verify_node(child, rev, parent_nodes, iterpool));
SVN_ERR(svn_fs_x__dag_get_mergeinfo_count(&child_mergeinfo,
child));
@@ -4452,7 +4461,7 @@ svn_fs_x__verify_root(svn_fs_root_t *roo
When this code is called in the library, we want to ensure we
use the on-disk data --- rather than some data that was read
in the possibly-distance past and cached since. */
- SVN_ERR(root_node(&root_dir, root, scratch_pool));
+ SVN_ERR(root_node(&root_dir, root, scratch_pool, scratch_pool));
/* Recursively verify ROOT_DIR. */
parent_nodes = apr_array_make(scratch_pool, 16, sizeof(dag_node_t *));
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/verify.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/verify.c?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/verify.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/verify.c Mon Feb 9 16:46:16 2015
@@ -713,7 +713,8 @@ verify_revprops(svn_fs_t *fs,
/* Access the svn:date revprop.
* This implies parsing all revprops for that revision. */
SVN_ERR(svn_fs_x__revision_prop(&date, fs, revision,
- SVN_PROP_REVISION_DATE, iterpool));
+ SVN_PROP_REVISION_DATE,
+ iterpool, iterpool));
/* The time stamp is the only revprop that, if given, needs to
* have a valid content. */
Modified: subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c Mon Feb 9 16:46:16 2015
@@ -52,6 +52,7 @@
#include "ra_loader.h"
#include "deprecated.h"
+#include "private/svn_auth_private.h"
#include "private/svn_ra_private.h"
#include "private/svn_delta_private.h"
#include "private/svn_string_private.h"
@@ -266,23 +267,12 @@ svn_error_t *svn_ra_open4(svn_ra_session
svn_ra_session_t *session;
const struct ra_lib_defn *defn;
const svn_ra__vtable_t *vtable = NULL;
- svn_config_t *servers = NULL;
- const char *server_group = NULL;
apr_uri_t repos_URI;
apr_status_t apr_err;
svn_error_t *err;
#ifdef CHOOSABLE_DAV_MODULE
const char *http_library = DEFAULT_HTTP_LIBRARY;
#endif
- /* Auth caching parameters. */
- svn_boolean_t store_passwords = SVN_CONFIG_DEFAULT_OPTION_STORE_PASSWORDS;
- svn_boolean_t store_auth_creds = SVN_CONFIG_DEFAULT_OPTION_STORE_AUTH_CREDS;
- const char *store_plaintext_passwords
- = SVN_CONFIG_DEFAULT_OPTION_STORE_PLAINTEXT_PASSWORDS;
- svn_boolean_t store_pp = SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP;
- const char *store_pp_plaintext
- = SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT;
- const char *corrected_url;
/* Initialize the return variable. */
*session_p = NULL;
@@ -298,100 +288,27 @@ svn_error_t *svn_ra_open4(svn_ra_session
repos_URL);
if (callbacks->auth_baton)
- {
- /* The 'store-passwords' and 'store-auth-creds' parameters used to
- * live in SVN_CONFIG_CATEGORY_CONFIG. For backward compatibility,
- * if values for these parameters have already been set by our
- * callers, we use those values as defaults.
- *
- * Note that we can only catch the case where users explicitly set
- * "store-passwords = no" or 'store-auth-creds = no".
- *
- * However, since the default value for both these options is
- * currently (and has always been) "yes", users won't know
- * the difference if they set "store-passwords = yes" or
- * "store-auth-creds = yes" -- they'll get the expected behaviour.
- */
-
- if (svn_auth_get_parameter(callbacks->auth_baton,
- SVN_AUTH_PARAM_DONT_STORE_PASSWORDS) != NULL)
- store_passwords = FALSE;
-
- if (svn_auth_get_parameter(callbacks->auth_baton,
- SVN_AUTH_PARAM_NO_AUTH_CACHE) != NULL)
- store_auth_creds = FALSE;
- }
+ SVN_ERR(svn_auth__apply_config_for_server(callbacks->auth_baton, config,
+ repos_URI.hostname, sesspool));
+#ifdef CHOOSABLE_DAV_MODULE
if (config)
{
+ svn_config_t *servers = NULL;
+ const char *server_group = NULL;
+
/* Grab the 'servers' config. */
servers = svn_hash_gets(config, SVN_CONFIG_CATEGORY_SERVERS);
if (servers)
{
/* First, look in the global section. */
- SVN_ERR(svn_config_get_bool
- (servers, &store_passwords, SVN_CONFIG_SECTION_GLOBAL,
- SVN_CONFIG_OPTION_STORE_PASSWORDS,
- store_passwords));
-
- SVN_ERR(svn_config_get_yes_no_ask
- (servers, &store_plaintext_passwords, SVN_CONFIG_SECTION_GLOBAL,
- SVN_CONFIG_OPTION_STORE_PLAINTEXT_PASSWORDS,
- SVN_CONFIG_DEFAULT_OPTION_STORE_PLAINTEXT_PASSWORDS));
-
- SVN_ERR(svn_config_get_bool
- (servers, &store_pp, SVN_CONFIG_SECTION_GLOBAL,
- SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP,
- store_pp));
-
- SVN_ERR(svn_config_get_yes_no_ask
- (servers, &store_pp_plaintext,
- SVN_CONFIG_SECTION_GLOBAL,
- SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
- SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT));
-
- SVN_ERR(svn_config_get_bool
- (servers, &store_auth_creds, SVN_CONFIG_SECTION_GLOBAL,
- SVN_CONFIG_OPTION_STORE_AUTH_CREDS,
- store_auth_creds));
-
/* Find out where we're about to connect to, and
* try to pick a server group based on the destination. */
server_group = svn_config_find_group(servers, repos_URI.hostname,
SVN_CONFIG_SECTION_GROUPS,
sesspool);
- if (server_group)
- {
- /* Override global auth caching parameters with the ones
- * for the server group, if any. */
- SVN_ERR(svn_config_get_bool(servers, &store_auth_creds,
- server_group,
- SVN_CONFIG_OPTION_STORE_AUTH_CREDS,
- store_auth_creds));
-
- SVN_ERR(svn_config_get_bool(servers, &store_passwords,
- server_group,
- SVN_CONFIG_OPTION_STORE_PASSWORDS,
- store_passwords));
-
- SVN_ERR(svn_config_get_yes_no_ask
- (servers, &store_plaintext_passwords, server_group,
- SVN_CONFIG_OPTION_STORE_PLAINTEXT_PASSWORDS,
- store_plaintext_passwords));
-
- SVN_ERR(svn_config_get_bool
- (servers, &store_pp,
- server_group, SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP,
- store_pp));
-
- SVN_ERR(svn_config_get_yes_no_ask
- (servers, &store_pp_plaintext, server_group,
- SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
- store_pp_plaintext));
- }
-#ifdef CHOOSABLE_DAV_MODULE
/* Now, which DAV-based RA method do we want to use today? */
http_library
= svn_config_get_server_setting(servers,
@@ -404,38 +321,9 @@ svn_error_t *svn_ra_open4(svn_ra_session
_("Invalid config: unknown HTTP library "
"'%s'"),
http_library);
-#endif
}
}
-
- if (callbacks->auth_baton)
- {
- /* Save auth caching parameters in the auth parameter hash. */
- if (! store_passwords)
- svn_auth_set_parameter(callbacks->auth_baton,
- SVN_AUTH_PARAM_DONT_STORE_PASSWORDS, "");
-
- svn_auth_set_parameter(callbacks->auth_baton,
- SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS,
- store_plaintext_passwords);
-
- if (! store_pp)
- svn_auth_set_parameter(callbacks->auth_baton,
- SVN_AUTH_PARAM_DONT_STORE_SSL_CLIENT_CERT_PP,
- "");
-
- svn_auth_set_parameter(callbacks->auth_baton,
- SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
- store_pp_plaintext);
-
- if (! store_auth_creds)
- svn_auth_set_parameter(callbacks->auth_baton,
- SVN_AUTH_PARAM_NO_AUTH_CACHE, "");
-
- if (server_group)
- svn_auth_set_parameter(callbacks->auth_baton,
- SVN_AUTH_PARAM_SERVER_GROUP, server_group);
- }
+#endif
/* Find the library. */
for (defn = ra_libraries; defn->ra_name != NULL; ++defn)
@@ -485,34 +373,29 @@ svn_error_t *svn_ra_open4(svn_ra_session
session->pool = sesspool;
/* Ask the library to open the session. */
- err = vtable->open_session(session, &corrected_url, repos_URL,
+ err = vtable->open_session(session, corrected_url_p,
+ repos_URL,
callbacks, callback_baton, config, sesspool);
if (err)
- return svn_error_createf(
+ {
+ if (err->apr_err == SVN_ERR_RA_SESSION_URL_MISMATCH)
+ return svn_error_trace(err);
+
+ return svn_error_createf(
SVN_ERR_RA_CANNOT_CREATE_SESSION, err,
_("Unable to connect to a repository at URL '%s'"),
repos_URL);
+ }
/* If the session open stuff detected a server-provided URL
correction (a 301 or 302 redirect response during the initial
OPTIONS request), then kill the session so the caller can decide
what to do. */
- if (corrected_url_p && corrected_url)
+ if (corrected_url_p && *corrected_url_p)
{
- if (! svn_path_is_url(corrected_url))
- {
- /* RFC1945 and RFC2616 state that the Location header's
- value (from whence this CORRECTED_URL ultimately comes),
- if present, must be an absolute URI. But some Apache
- versions (those older than 2.2.11, it seems) transmit
- only the path portion of the URI. See issue #3775 for
- details. */
- apr_uri_t corrected_URI = repos_URI;
- corrected_URI.path = (char *)corrected_url;
- corrected_url = apr_uri_unparse(pool, &corrected_URI, 0);
- }
- *corrected_url_p = svn_uri_canonicalize(corrected_url, pool);
+ /* *session_p = NULL; */
+ *corrected_url_p = apr_pstrdup(pool, *corrected_url_p);
svn_pool_destroy(sesspool);
return SVN_NO_ERROR;
}
@@ -540,11 +423,11 @@ svn_error_t *svn_ra_open4(svn_ra_session
}
svn_error_t *
-svn_ra_dup_session(svn_ra_session_t **new_session,
- svn_ra_session_t *old_session,
- const char *session_url,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+svn_ra__dup_session(svn_ra_session_t **new_session,
+ svn_ra_session_t *old_session,
+ const char *session_url,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_ra_session_t *session;
@@ -1025,7 +908,7 @@ svn_error_t *svn_ra_get_commit_editor_ev
SVN_ERR(svn_ra_get_repos_root2(session, &repos_root_url, pool));
SVN_ERR(svn_ra_get_session_url(session, &session_url, pool));
base_relpath = svn_uri_skip_ancestor(repos_root_url, session_url, pool);
- SVN_ERR(svn_ra_dup_session(&fbb->session, session, repos_root_url, pool, pool));
+ SVN_ERR(svn_ra__dup_session(&fbb->session, session, repos_root_url, pool, pool));
fbb->session_path = base_relpath;
fbb->repos_root_url = repos_root_url;
@@ -1073,7 +956,7 @@ svn_error_t *svn_ra_get_commit_editor3(s
SVN_ERR(svn_ra_get_repos_root2(session, &repos_root_url, pool));
SVN_ERR(svn_ra_get_session_url(session, &session_url, pool));
base_relpath = svn_uri_skip_ancestor(repos_root_url, session_url, pool);
- SVN_ERR(svn_ra_dup_session(&fbb->session, session, repos_root_url, pool, pool));
+ SVN_ERR(svn_ra__dup_session(&fbb->session, session, repos_root_url, pool, pool));
fbb->session_path = base_relpath;
fbb->repos_root_url = repos_root_url;
SVN_ERR(svn_editor3__insert_shims(editor, edit_baton, *editor, *edit_baton,
@@ -1377,8 +1260,8 @@ svn_error_t *svn_ra_stat(svn_ra_session_
svn_uri_split(&parent_url, &base_name, session_url,
scratch_pool);
- SVN_ERR(svn_ra_dup_session(&parent_session, session, parent_url,
- scratch_pool, scratch_pool));
+ SVN_ERR(svn_ra__dup_session(&parent_session, session, parent_url,
+ scratch_pool, scratch_pool));
/* Get all parent's entries, no props. */
SVN_ERR(svn_ra_get_dir2(parent_session, &parent_ents, NULL,
Modified: subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/blame.c?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/blame.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/blame.c Mon Feb 9 16:46:16 2015
@@ -280,7 +280,8 @@ static svn_error_t *
create_file_revs_body(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
serf_bucket_t *buckets;
blame_context_t *blame_ctx = baton;
@@ -351,7 +352,7 @@ svn_ra_serf__get_file_revs(svn_ra_sessio
peg_rev = start;
SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
- session, NULL /* conn */,
+ session,
NULL /* url */, peg_rev,
pool, pool));
@@ -361,15 +362,13 @@ svn_ra_serf__get_file_revs(svn_ra_sessio
blame_cdata,
blame_ctx,
pool);
- handler = svn_ra_serf__create_expat_handler(xmlctx, NULL, pool);
+ handler = svn_ra_serf__create_expat_handler(session, xmlctx, NULL, pool);
handler->method = "REPORT";
handler->path = req_url;
handler->body_type = "text/xml";
handler->body_delegate = create_file_revs_body;
handler->body_delegate_baton = blame_ctx;
- handler->conn = session->conns[0];
- handler->session = session;
SVN_ERR(svn_ra_serf__context_run_one(handler, pool));
Modified: subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/blncache.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/blncache.c?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/blncache.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/blncache.c Mon Feb 9 16:46:16 2015
@@ -112,7 +112,7 @@ svn_ra_serf__blncache_set(svn_ra_serf__b
const char *baseline_url,
svn_revnum_t revision,
const char *bc_url,
- apr_pool_t *pool)
+ apr_pool_t *scratch_pool)
{
if (bc_url && SVN_IS_VALID_REVNUM(revision))
{
@@ -147,11 +147,11 @@ svn_error_t *
svn_ra_serf__blncache_get_bc_url(const char **bc_url_p,
svn_ra_serf__blncache_t *blncache,
svn_revnum_t revnum,
- apr_pool_t *pool)
+ apr_pool_t *result_pool)
{
const char *value = apr_hash_get(blncache->revnum_to_bc,
&revnum, sizeof(revnum));
- *bc_url_p = value ? apr_pstrdup(pool, value) : NULL;
+ *bc_url_p = value ? apr_pstrdup(result_pool, value) : NULL;
return SVN_NO_ERROR;
}
Modified: subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/blncache.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/blncache.h?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/blncache.h (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/blncache.h Mon Feb 9 16:46:16 2015
@@ -59,7 +59,7 @@ svn_ra_serf__blncache_set(svn_ra_serf__b
const char *baseline_url,
svn_revnum_t revnum,
const char *bc_url,
- apr_pool_t *pool);
+ apr_pool_t *scratch_pool);
/* Sets *BC_URL_P with a pointer to baseline collection URL for the given
* REVNUM. *BC_URL_P will be NULL if cache doesn't have information about
@@ -69,7 +69,7 @@ svn_error_t *
svn_ra_serf__blncache_get_bc_url(const char **bc_url_p,
svn_ra_serf__blncache_t *blncache,
svn_revnum_t revnum,
- apr_pool_t *pool);
+ apr_pool_t *result_pool);
/* Sets *BC_URL_P with pointer to baseline collection URL and *REVISION_P
* with revision number of baseline BASELINE_URL. *BC_URL_P will be NULL,