You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2012/08/28 02:24:04 UTC
svn commit: r1377919 - in /subversion/branches/inheritable-props/subversion:
include/ libsvn_client/ libsvn_ra/ libsvn_ra_local/ libsvn_ra_serf/
libsvn_ra_svn/
Author: pburba
Date: Tue Aug 28 00:24:03 2012
New Revision: 1377919
URL: http://svn.apache.org/viewvc?rev=1377919&view=rev
Log:
On the inheritable-props branch: Use result and scratch pools in the APIs
added or revved on this branch.
* subversion/include/svn_ra.h
(svn_ra_get_file2
svn_ra_get_dir3,
svn_ra_get_inherited_props): Use two-pool paradigm.
* subversion/libsvn_client/iprops.c
(svn_client__get_inheritable_props): Update call to
svn_ra_get_inherited_props.
* subversion/libsvn_client/prop_commands.c
(remote_propget,
remote_proplist): Update calls to svn_ra_get_dir3 and svn_ra_get_file2.
* subversion/libsvn_client/switch.c
(switch_internal): Update call to svn_ra_get_inherited_props.
* subversion/libsvn_ra/deprecated.c
(svn_ra_get_file): Update call to get_file.
(svn_ra_get_dir2): Update call to get_dir.
* subversion/libsvn_ra/ra_loader.c
(get_inherited_props): Use two pools and remove now unnecessary subpool.
(svn_ra_get_file2,
svn_ra_get_dir3,
svn_ra_get_inherited_props): Implement two-pool paradigm.
* subversion/libsvn_ra/ra_loader.h
(svn_ra__vtable_t): Use two pools for get_file, get_dir, and
get_inherited_props member functions.
* subversion/libsvn_ra/wrapper_template.h
(compat_get_file,
compat_get_dir): Add second pool to track API changes.
* subversion/libsvn_ra_local/ra_plugin.c
(get_node_props,
svn_ra_local__get_file,
svn_ra_local__get_inherited_props): Implement two-pool paradigm.
(svn_ra_local__get_dir): As above, plus rename local 'subpool' variable to
'iterpool' to better reflect how it is used.
* subversion/libsvn_ra_serf/inherited_props.c
(svn_ra_serf__get_inherited_props): Implement two-pool paradigm.
* subversion/libsvn_ra_serf/ra_serf.h
(svn_ra_serf__get_file,
svn_ra_serf__get_inherited_props): Shocking, but once again we are using
two pools instead of one, since that's the whole point of this commit.
* subversion/libsvn_ra_serf/serf.c
(svn_ra_serf__get_dir): Implement two pools.
* subversion/libsvn_ra_serf/update.c
(svn_ra_serf__get_file): Implement two pools.
* subversion/libsvn_ra_svn/client.c
(ra_svn_get_file,
ra_svn_get_dir,
ra_svn_get_inherited_props): Wait for it...yup, two pools.
Modified:
subversion/branches/inheritable-props/subversion/include/svn_ra.h
subversion/branches/inheritable-props/subversion/libsvn_client/iprops.c
subversion/branches/inheritable-props/subversion/libsvn_client/prop_commands.c
subversion/branches/inheritable-props/subversion/libsvn_client/switch.c
subversion/branches/inheritable-props/subversion/libsvn_ra/deprecated.c
subversion/branches/inheritable-props/subversion/libsvn_ra/ra_loader.c
subversion/branches/inheritable-props/subversion/libsvn_ra/ra_loader.h
subversion/branches/inheritable-props/subversion/libsvn_ra/wrapper_template.h
subversion/branches/inheritable-props/subversion/libsvn_ra_local/ra_plugin.c
subversion/branches/inheritable-props/subversion/libsvn_ra_serf/inherited_props.c
subversion/branches/inheritable-props/subversion/libsvn_ra_serf/ra_serf.h
subversion/branches/inheritable-props/subversion/libsvn_ra_serf/serf.c
subversion/branches/inheritable-props/subversion/libsvn_ra_serf/update.c
subversion/branches/inheritable-props/subversion/libsvn_ra_svn/client.c
Modified: subversion/branches/inheritable-props/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/include/svn_ra.h?rev=1377919&r1=1377918&r2=1377919&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/include/svn_ra.h (original)
+++ subversion/branches/inheritable-props/subversion/include/svn_ra.h Tue Aug 28 00:24:03 2012
@@ -995,15 +995,16 @@ svn_ra_get_file2(svn_ra_session_t *sessi
svn_revnum_t *fetched_rev,
apr_hash_t **props,
apr_array_header_t **inherited_props,
- apr_pool_t *pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/**
* Similar to @c svn_ra_get_file2, but does not support the retrieval of
* inherited properties.
*
- * @since New in 1.8.
+ * @since New in 1.2.
*
- * @deprecated Provided for compatibility with the 1.2 API.
+ * @deprecated Provided for compatibility with the 1.7 API.
*/
SVN_DEPRECATED
svn_error_t *
@@ -1062,7 +1063,8 @@ svn_ra_get_dir3(svn_ra_session_t *sessio
const char *path,
svn_revnum_t revision,
apr_uint32_t dirent_fields,
- apr_pool_t *pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/**
* Similar to @c svn_ra_get_dir3, but does not support the retrieval of
@@ -1991,6 +1993,9 @@ svn_ra_get_deleted_rev(svn_ra_session_t
* inheritable properties are found, then set @a *inherited_props to
* an empty array.
*
+ * Allocated @a *inherited_props in @a result_pool, use @a scratch_pool
+ * for temporary allocations.
+ *
* @since New in 1.8.
*/
svn_error_t *
@@ -1998,7 +2003,8 @@ svn_ra_get_inherited_props(svn_ra_sessio
apr_array_header_t **inherited_props,
const char *path,
svn_revnum_t revision,
- apr_pool_t *pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/**
* @defgroup Capabilities Dynamically query the server's capabilities.
Modified: subversion/branches/inheritable-props/subversion/libsvn_client/iprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/iprops.c?rev=1377919&r1=1377918&r2=1377919&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/iprops.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/iprops.c Tue Aug 28 00:24:03 2012
@@ -161,7 +161,8 @@ svn_client__get_inheritable_props(apr_ha
}
SVN_ERR(svn_ra_get_inherited_props(ra_session, &inherited_props,
- "", revision, result_pool));
+ "", revision, result_pool,
+ scratch_pool));
if (old_session_url)
SVN_ERR(svn_ra_reparent(ra_session, old_session_url,
Modified: subversion/branches/inheritable-props/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/prop_commands.c?rev=1377919&r1=1377918&r2=1377919&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/prop_commands.c Tue Aug 28 00:24:03 2012
@@ -642,14 +642,14 @@ remote_propget(apr_hash_t *props,
props ? &prop_hash : NULL,
inherited_props,
target_relative, revnum, SVN_DIRENT_KIND,
- scratch_pool));
+ scratch_pool, scratch_pool));
}
else if (kind == svn_node_file)
{
SVN_ERR(svn_ra_get_file2(ra_session, target_relative, revnum,
NULL, NULL,
props ? &prop_hash : NULL,
- inherited_props, scratch_pool));
+ inherited_props, scratch_pool, scratch_pool));
}
else if (kind == svn_node_none)
{
@@ -1120,6 +1120,9 @@ remote_proplist(const char *target_prefi
svn_path_url_add_component2(target_prefix, target_relative, scratch_pool);
apr_array_header_t *inherited_props;
+ /* Note that we pass only the SCRATCH_POOL to svn_ra_get[dir*|file*] because
+ we'll be filtering out non-regular properties from PROP_HASH before we
+ return. */
if (kind == svn_node_dir)
{
SVN_ERR(svn_ra_get_dir3(
@@ -1129,7 +1132,7 @@ remote_proplist(const char *target_prefi
get_explicit_props ? &prop_hash : NULL,
get_target_inherited_props ? &inherited_props : NULL,
target_relative, revnum,
- SVN_DIRENT_KIND, scratch_pool));
+ SVN_DIRENT_KIND, scratch_pool, scratch_pool));
}
else if (kind == svn_node_file)
{
@@ -1138,7 +1141,7 @@ remote_proplist(const char *target_prefi
NULL, NULL,
get_explicit_props ? &prop_hash : NULL,
get_target_inherited_props ? &inherited_props : NULL,
- scratch_pool));
+ scratch_pool, scratch_pool));
}
else
{
@@ -1160,7 +1163,8 @@ remote_proplist(const char *target_prefi
{
/* Filter out non-regular properties, since the RA layer returns all
kinds. Copy regular properties keys/vals from the prop_hash
- allocated in SCRATCH_POOL to the "final" hash allocated in POOL. */
+ allocated in SCRATCH_POOL to the "final" hash allocated in
+ RESULT_POOL. */
final_hash = apr_hash_make(result_pool);
for (hi = apr_hash_first(scratch_pool, prop_hash);
hi;
Modified: subversion/branches/inheritable-props/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/switch.c?rev=1377919&r1=1377918&r2=1377919&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/switch.c Tue Aug 28 00:24:03 2012
@@ -269,7 +269,8 @@ switch_internal(svn_revnum_t *result_rev
if (needs_iprop_cache)
{
SVN_ERR(svn_ra_get_inherited_props(ra_session, &inherited_props,
- "", switch_loc->rev, pool));
+ "", switch_loc->rev, pool,
+ pool));
apr_hash_set(wcroot_iprops, local_abspath, APR_HASH_KEY_STRING,
inherited_props);
}
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra/deprecated.c?rev=1377919&r1=1377918&r2=1377919&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra/deprecated.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra/deprecated.c Tue Aug 28 00:24:03 2012
@@ -428,7 +428,7 @@ svn_error_t *svn_ra_get_file(svn_ra_sess
{
SVN_ERR_ASSERT(*path != '/');
return session->vtable->get_file(session, path, revision, stream,
- fetched_rev, props, NULL, pool);
+ fetched_rev, props, NULL, pool, pool);
}
svn_error_t *svn_ra_get_dir(svn_ra_session_t *session,
@@ -441,7 +441,7 @@ svn_error_t *svn_ra_get_dir(svn_ra_sessi
{
SVN_ERR_ASSERT(*path != '/');
return session->vtable->get_dir(session, dirents, fetched_rev, props, NULL,
- path, revision, SVN_DIRENT_ALL, pool);
+ path, revision, SVN_DIRENT_ALL, pool, pool);
}
svn_error_t *svn_ra_get_dir2(svn_ra_session_t *session,
@@ -455,5 +455,5 @@ svn_error_t *svn_ra_get_dir2(svn_ra_sess
{
SVN_ERR_ASSERT(*path != '/');
return session->vtable->get_dir(session, dirents, fetched_rev, props, NULL,
- path, revision, dirent_fields, pool);
+ path, revision, dirent_fields, pool, pool);
}
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra/ra_loader.c?rev=1377919&r1=1377918&r2=1377919&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra/ra_loader.c Tue Aug 28 00:24:03 2012
@@ -748,28 +748,28 @@ get_inherited_props(svn_ra_session_t *se
const char *path,
svn_revnum_t revision,
apr_array_header_t **inherited_props,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
const char *repos_root_url;
const char *session_url;
const char *parent_url;
- apr_pool_t *subpool = svn_pool_create(pool);
- apr_pool_t *iterpool = svn_pool_create(pool);
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
*inherited_props =
- apr_array_make(pool, 1, sizeof(svn_prop_inherited_item_t *));
+ apr_array_make(result_pool, 1, sizeof(svn_prop_inherited_item_t *));
/* Walk to the root of the repository getting inherited
props for PATH. */
- SVN_ERR(svn_ra_get_repos_root2(session, &repos_root_url, subpool));
- SVN_ERR(svn_ra_get_session_url(session, &session_url, subpool));
+ SVN_ERR(svn_ra_get_repos_root2(session, &repos_root_url, scratch_pool));
+ SVN_ERR(svn_ra_get_session_url(session, &session_url, scratch_pool));
parent_url = session_url;
while (strcmp(repos_root_url, parent_url))
{
apr_hash_index_t *hi;
apr_hash_t *parent_props;
- apr_hash_t *final_hash = apr_hash_make(pool);
+ apr_hash_t *final_hash = apr_hash_make(result_pool);
svn_error_t *err;
svn_pool_clear(iterpool);
@@ -778,7 +778,7 @@ get_inherited_props(svn_ra_session_t *se
err = session->vtable->get_dir(session, NULL, NULL,
&parent_props, NULL, "",
revision, SVN_DIRENT_ALL,
- iterpool);
+ iterpool, iterpool);
/* If the user doesn't have read access to a parent path then
skip, but allow them to inherit from further up. */
@@ -795,7 +795,7 @@ get_inherited_props(svn_ra_session_t *se
}
}
- for (hi = apr_hash_first(subpool, parent_props);
+ for (hi = apr_hash_first(scratch_pool, parent_props);
hi;
hi = apr_hash_next(hi))
{
@@ -805,8 +805,8 @@ get_inherited_props(svn_ra_session_t *se
if (svn_property_kind(NULL, name) == svn_prop_regular_kind)
{
- name = apr_pstrdup(pool, name);
- value = svn_string_dup(value, pool);
+ name = apr_pstrdup(result_pool, name);
+ value = svn_string_dup(value, result_pool);
apr_hash_set(final_hash, name, klen, value);
}
}
@@ -814,18 +814,17 @@ get_inherited_props(svn_ra_session_t *se
if (apr_hash_count(final_hash))
{
svn_prop_inherited_item_t *new_iprop =
- apr_palloc(pool, sizeof(*new_iprop));
- new_iprop->path_or_url = apr_pstrdup(pool, parent_url);
+ apr_palloc(result_pool, sizeof(*new_iprop));
+ new_iprop->path_or_url = apr_pstrdup(result_pool, parent_url);
new_iprop->prop_hash = final_hash;
svn_sort__array_insert(&new_iprop, *inherited_props, 0);
}
}
/* Reparent session back to original URL. */
- SVN_ERR(svn_ra_reparent(session, session_url, subpool));
+ SVN_ERR(svn_ra_reparent(session, session_url, scratch_pool));
svn_pool_destroy(iterpool);
- svn_pool_destroy(subpool);
return SVN_NO_ERROR;
}
@@ -836,7 +835,8 @@ svn_error_t *svn_ra_get_file2(svn_ra_ses
svn_revnum_t *fetched_rev,
apr_hash_t **props,
apr_array_header_t **inherited_props,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
SVN_ERR_ASSERT(*path != '/');
@@ -847,26 +847,30 @@ svn_error_t *svn_ra_get_file2(svn_ra_ses
/* We want inherited props too, can the server deliver? */
SVN_ERR(svn_ra_has_capability(session, &gets_iprops,
SVN_RA_CAPABILITY_INHERITED_PROPS,
- pool));
+ scratch_pool));
if (gets_iprops)
{
SVN_ERR(session->vtable->get_file(session, path, revision, stream,
fetched_rev, props,
- inherited_props, pool));
+ inherited_props, result_pool,
+ scratch_pool));
}
else
{
/* Get the explicit props on PATH. */
SVN_ERR(session->vtable->get_file(session, path, revision, stream,
- fetched_rev, props, NULL, pool));
+ fetched_rev, props, NULL,
+ result_pool, scratch_pool));
SVN_ERR(get_inherited_props(session, path, revision,
- inherited_props, pool));
+ inherited_props, result_pool,
+ scratch_pool));
}
}
else
{
SVN_ERR(session->vtable->get_file(session, path, revision, stream,
- fetched_rev, props, NULL, pool));
+ fetched_rev, props, NULL, result_pool,
+ scratch_pool));
}
return SVN_NO_ERROR;
@@ -881,7 +885,8 @@ svn_ra_get_dir3(svn_ra_session_t *sessio
const char *path,
svn_revnum_t revision,
apr_uint32_t dirent_fields,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
SVN_ERR_ASSERT(*path != '/');
@@ -892,28 +897,31 @@ svn_ra_get_dir3(svn_ra_session_t *sessio
/* We want inherited props too, can the server deliver? */
SVN_ERR(svn_ra_has_capability(session, &gets_iprops,
SVN_RA_CAPABILITY_INHERITED_PROPS,
- pool));
+ scratch_pool));
if (gets_iprops)
{
SVN_ERR(session->vtable->get_dir(session, dirents, fetched_rev, props,
inherited_props, path, revision,
- dirent_fields, pool));
+ dirent_fields, result_pool,
+ scratch_pool));
}
else
{
/* Get the explicit props on PATH. */
SVN_ERR(session->vtable->get_dir(session, dirents, fetched_rev,
props, NULL, path, revision,
- dirent_fields, pool));
+ dirent_fields, result_pool,
+ scratch_pool));
SVN_ERR(get_inherited_props(session, path, revision,
- inherited_props, pool));
+ inherited_props, result_pool,
+ scratch_pool));
}
}
else
{
return session->vtable->get_dir(session, dirents, fetched_rev, props,
NULL, path, revision, dirent_fields,
- pool);
+ result_pool, scratch_pool);
}
return SVN_NO_ERROR;
@@ -1418,7 +1426,8 @@ svn_ra_get_inherited_props(svn_ra_sessio
apr_array_header_t **iprops,
const char *path,
svn_revnum_t revision,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_boolean_t iprop_capable;
@@ -1426,17 +1435,16 @@ svn_ra_get_inherited_props(svn_ra_sessio
SVN_ERR_ASSERT(*path != '/');
SVN_ERR(svn_ra_has_capability(session, &iprop_capable,
- SVN_RA_CAPABILITY_INHERITED_PROPS, pool));
+ SVN_RA_CAPABILITY_INHERITED_PROPS,
+ scratch_pool));
if (iprop_capable)
- return svn_error_trace(session->vtable->get_inherited_props(session,
- iprops,
- path,
- revision,
- pool));
+ return svn_error_trace(session->vtable->get_inherited_props(
+ session, iprops, path, revision, result_pool, scratch_pool));
/* Fallback for legacy servers. */
return svn_error_trace(get_inherited_props(session, path, revision,
- iprops, pool));
+ iprops, result_pool,
+ scratch_pool));
}
svn_error_t *
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra/ra_loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra/ra_loader.h?rev=1377919&r1=1377918&r2=1377919&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra/ra_loader.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra/ra_loader.h Tue Aug 28 00:24:03 2012
@@ -118,7 +118,8 @@ typedef struct svn_ra__vtable_t {
svn_revnum_t *fetched_rev,
apr_hash_t **props,
apr_array_header_t **inherited_props,
- apr_pool_t *pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* See svn_ra_get_dir3(). */
svn_error_t *(*get_dir)(svn_ra_session_t *session,
apr_hash_t **dirents,
@@ -128,7 +129,8 @@ typedef struct svn_ra__vtable_t {
const char *path,
svn_revnum_t revision,
apr_uint32_t dirent_fields,
- apr_pool_t *pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* See svn_ra_get_mergeinfo(). */
svn_error_t *(*get_mergeinfo)(svn_ra_session_t *session,
svn_mergeinfo_catalog_t *mergeinfo,
@@ -306,7 +308,8 @@ typedef struct svn_ra__vtable_t {
apr_array_header_t **iprops,
const char *path,
svn_revnum_t revision,
- apr_pool_t *pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* See svn_ra__get_commit_ev2() */
svn_error_t *(*get_commit_ev2)(
svn_editor_t **editor,
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra/wrapper_template.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra/wrapper_template.h?rev=1377919&r1=1377918&r2=1377919&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra/wrapper_template.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra/wrapper_template.h Tue Aug 28 00:24:03 2012
@@ -179,7 +179,7 @@ static svn_error_t *compat_get_file(void
apr_pool_t *pool)
{
return VTBL.get_file(session_baton, path, revision, stream, fetched_rev,
- props, NULL, pool);
+ props, NULL, pool, pool);
}
static svn_error_t *compat_get_dir(void *session_baton,
@@ -191,7 +191,7 @@ static svn_error_t *compat_get_dir(void
apr_pool_t *pool)
{
return VTBL.get_dir(session_baton, dirents, fetched_rev, props,
- NULL, path, revision, SVN_DIRENT_ALL, pool);
+ NULL, path, revision, SVN_DIRENT_ALL, pool, pool);
}
/** Reporter compat code. **/
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_local/ra_plugin.c?rev=1377919&r1=1377918&r2=1377919&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_local/ra_plugin.c Tue Aug 28 00:24:03 2012
@@ -1042,14 +1042,15 @@ get_node_props(apr_hash_t **props,
svn_ra_local__session_baton_t *sess,
svn_fs_root_t *root,
const char *path,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_revnum_t cmt_rev;
const char *cmt_date, *cmt_author;
/* Create a hash with props attached to the fs node. */
- SVN_ERR(svn_fs_node_proplist2(props, inherited_props, root, path, pool,
- pool));
+ SVN_ERR(svn_fs_node_proplist2(props, inherited_props, root, path,
+ result_pool, scratch_pool));
/* Turn FS-path keys into URLs. */
if (inherited_props)
@@ -1061,7 +1062,7 @@ get_node_props(apr_hash_t **props,
svn_prop_inherited_item_t *i_props =
APR_ARRAY_IDX(*inherited_props, i, svn_prop_inherited_item_t *);
i_props->path_or_url = svn_path_url_add_component2(
- sess->repos_url, i_props->path_or_url, pool);
+ sess->repos_url, i_props->path_or_url, result_pool);
}
}
@@ -1071,26 +1072,29 @@ get_node_props(apr_hash_t **props,
{
/* The so-called 'entryprops' with info about CR & friends. */
SVN_ERR(svn_repos_get_committed_info(&cmt_rev, &cmt_date,
- &cmt_author, root, path, pool));
+ &cmt_author, root, path,
+ scratch_pool));
apr_hash_set(*props,
SVN_PROP_ENTRY_COMMITTED_REV,
APR_HASH_KEY_STRING,
- svn_string_createf(pool, "%ld", cmt_rev));
+ svn_string_createf(result_pool, "%ld", cmt_rev));
apr_hash_set(*props,
SVN_PROP_ENTRY_COMMITTED_DATE,
APR_HASH_KEY_STRING,
- cmt_date ? svn_string_create(cmt_date, pool) : NULL);
+ cmt_date ? svn_string_create(cmt_date,
+ result_pool) : NULL);
apr_hash_set(*props,
SVN_PROP_ENTRY_LAST_AUTHOR,
APR_HASH_KEY_STRING,
- cmt_author ? svn_string_create(cmt_author, pool) : NULL);
+ cmt_author ? svn_string_create(cmt_author,
+ result_pool) : NULL);
apr_hash_set(*props,
SVN_PROP_ENTRY_UUID,
APR_HASH_KEY_STRING,
- svn_string_create(sess->uuid, pool));
+ svn_string_create(sess->uuid, result_pool));
- /* We have no 'wcprops' in ra_local, but might someday. */
+ /* We have no 'wcprops' in ra_local, but might someday. */
}
return SVN_NO_ERROR;
@@ -1106,27 +1110,30 @@ svn_ra_local__get_file(svn_ra_session_t
svn_revnum_t *fetched_rev,
apr_hash_t **props,
apr_array_header_t **inherited_props,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_fs_root_t *root;
svn_stream_t *contents;
svn_revnum_t youngest_rev;
svn_ra_local__session_baton_t *sess = session->priv;
- const char *abs_path = svn_fspath__join(sess->fs_path->data, path, pool);
+ const char *abs_path = svn_fspath__join(sess->fs_path->data, path,
+ scratch_pool);
svn_node_kind_t node_kind;
/* Open the revision's root. */
if (! SVN_IS_VALID_REVNUM(revision))
{
- SVN_ERR(svn_fs_youngest_rev(&youngest_rev, sess->fs, pool));
- SVN_ERR(svn_fs_revision_root(&root, sess->fs, youngest_rev, pool));
+ SVN_ERR(svn_fs_youngest_rev(&youngest_rev, sess->fs, scratch_pool));
+ SVN_ERR(svn_fs_revision_root(&root, sess->fs, youngest_rev,
+ scratch_pool));
if (fetched_rev != NULL)
*fetched_rev = youngest_rev;
}
else
- SVN_ERR(svn_fs_revision_root(&root, sess->fs, revision, pool));
+ SVN_ERR(svn_fs_revision_root(&root, sess->fs, revision, scratch_pool));
- SVN_ERR(svn_fs_check_path(&node_kind, root, abs_path, pool));
+ SVN_ERR(svn_fs_check_path(&node_kind, root, abs_path, scratch_pool));
if (node_kind == svn_node_none)
{
return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL,
@@ -1141,7 +1148,7 @@ svn_ra_local__get_file(svn_ra_session_t
if (stream)
{
/* Get a stream representing the file's contents. */
- SVN_ERR(svn_fs_file_contents(&contents, root, abs_path, pool));
+ SVN_ERR(svn_fs_file_contents(&contents, root, abs_path, scratch_pool));
/* Now push data from the fs stream back at the caller's stream.
Note that this particular RA layer does not computing a
@@ -1155,17 +1162,18 @@ svn_ra_local__get_file(svn_ra_session_t
Note: we are not supposed to close the passed-in stream, so
disown the thing.
*/
- SVN_ERR(svn_stream_copy3(contents, svn_stream_disown(stream, pool),
+ SVN_ERR(svn_stream_copy3(contents, svn_stream_disown(stream,
+ scratch_pool),
sess->callbacks
? sess->callbacks->cancel_func : NULL,
sess->callback_baton,
- pool));
+ scratch_pool));
}
/* Handle props if requested. */
if (props || inherited_props)
SVN_ERR(get_node_props(props, inherited_props, sess, root, abs_path,
- pool));
+ result_pool, scratch_pool));
return SVN_NO_ERROR;
}
@@ -1182,52 +1190,57 @@ svn_ra_local__get_dir(svn_ra_session_t *
const char *path,
svn_revnum_t revision,
apr_uint32_t dirent_fields,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_fs_root_t *root;
svn_revnum_t youngest_rev;
apr_hash_t *entries;
apr_hash_index_t *hi;
svn_ra_local__session_baton_t *sess = session->priv;
- apr_pool_t *subpool;
- const char *abs_path = svn_fspath__join(sess->fs_path->data, path, pool);
+ apr_pool_t *iterpool;
+ const char *abs_path = svn_fspath__join(sess->fs_path->data, path,
+ scratch_pool);
/* Open the revision's root. */
if (! SVN_IS_VALID_REVNUM(revision))
{
- SVN_ERR(svn_fs_youngest_rev(&youngest_rev, sess->fs, pool));
- SVN_ERR(svn_fs_revision_root(&root, sess->fs, youngest_rev, pool));
+ SVN_ERR(svn_fs_youngest_rev(&youngest_rev, sess->fs, scratch_pool));
+ SVN_ERR(svn_fs_revision_root(&root, sess->fs, youngest_rev,
+ scratch_pool));
if (fetched_rev != NULL)
*fetched_rev = youngest_rev;
}
else
- SVN_ERR(svn_fs_revision_root(&root, sess->fs, revision, pool));
+ SVN_ERR(svn_fs_revision_root(&root, sess->fs, revision, scratch_pool));
if (dirents)
{
/* Get the dir's entries. */
- SVN_ERR(svn_fs_dir_entries(&entries, root, abs_path, pool));
+ SVN_ERR(svn_fs_dir_entries(&entries, root, abs_path, result_pool));
/* Loop over the fs dirents, and build a hash of general
svn_dirent_t's. */
- *dirents = apr_hash_make(pool);
- subpool = svn_pool_create(pool);
- for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
+ *dirents = apr_hash_make(result_pool);
+ iterpool = svn_pool_create(scratch_pool);
+ for (hi = apr_hash_first(scratch_pool, entries);
+ hi;
+ hi = apr_hash_next(hi))
{
const void *key;
void *val;
apr_hash_t *prophash;
const char *datestring, *entryname, *fullpath;
svn_fs_dirent_t *fs_entry;
- svn_dirent_t *entry = apr_pcalloc(pool, sizeof(*entry));
+ svn_dirent_t *entry = apr_pcalloc(result_pool, sizeof(*entry));
- svn_pool_clear(subpool);
+ svn_pool_clear(iterpool);
apr_hash_this(hi, &key, NULL, &val);
entryname = (const char *) key;
fs_entry = (svn_fs_dirent_t *) val;
- fullpath = svn_dirent_join(abs_path, entryname, subpool);
+ fullpath = svn_dirent_join(abs_path, entryname, iterpool);
if (dirent_fields & SVN_DIRENT_KIND)
{
@@ -1242,14 +1255,14 @@ svn_ra_local__get_dir(svn_ra_session_t *
entry->size = 0;
else
SVN_ERR(svn_fs_file_length(&(entry->size), root,
- fullpath, subpool));
+ fullpath, iterpool));
}
if (dirent_fields & SVN_DIRENT_HAS_PROPS)
{
/* has_props? */
SVN_ERR(svn_fs_node_proplist(&prophash, root, fullpath,
- subpool));
+ iterpool));
entry->has_props = (apr_hash_count(prophash) != 0);
}
@@ -1261,24 +1274,25 @@ svn_ra_local__get_dir(svn_ra_session_t *
SVN_ERR(svn_repos_get_committed_info(&(entry->created_rev),
&datestring,
&(entry->last_author),
- root, fullpath, subpool));
+ root, fullpath, iterpool));
if (datestring)
SVN_ERR(svn_time_from_cstring(&(entry->time), datestring,
- pool));
+ result_pool));
if (entry->last_author)
- entry->last_author = apr_pstrdup(pool, entry->last_author);
+ entry->last_author = apr_pstrdup(result_pool,
+ entry->last_author);
}
/* Store. */
apr_hash_set(*dirents, entryname, APR_HASH_KEY_STRING, entry);
}
- svn_pool_destroy(subpool);
+ svn_pool_destroy(iterpool);
}
/* Handle props if requested. */
if (props || inherited_props)
SVN_ERR(get_node_props(props, inherited_props, sess, root, abs_path,
- pool));
+ result_pool, scratch_pool));
return SVN_NO_ERROR;
}
@@ -1561,26 +1575,29 @@ svn_ra_local__get_inherited_props(svn_ra
apr_array_header_t **iprops,
const char *path,
svn_revnum_t revision,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_fs_root_t *root;
svn_revnum_t youngest_rev;
svn_ra_local__session_baton_t *sess = session->priv;
- const char *abs_path = svn_fspath__join(sess->fs_path->data, path, pool);
+ const char *abs_path = svn_fspath__join(sess->fs_path->data, path,
+ scratch_pool);
svn_node_kind_t node_kind;
/* Open the revision's root. */
if (! SVN_IS_VALID_REVNUM(revision))
{
- SVN_ERR(svn_fs_youngest_rev(&youngest_rev, sess->fs, pool));
- SVN_ERR(svn_fs_revision_root(&root, sess->fs, youngest_rev, pool));
+ SVN_ERR(svn_fs_youngest_rev(&youngest_rev, sess->fs, scratch_pool));
+ SVN_ERR(svn_fs_revision_root(&root, sess->fs, youngest_rev,
+ scratch_pool));
}
else
{
- SVN_ERR(svn_fs_revision_root(&root, sess->fs, revision, pool));
+ SVN_ERR(svn_fs_revision_root(&root, sess->fs, revision, scratch_pool));
}
- SVN_ERR(svn_fs_check_path(&node_kind, root, abs_path, pool));
+ SVN_ERR(svn_fs_check_path(&node_kind, root, abs_path, scratch_pool));
if (node_kind == svn_node_none)
{
return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL,
@@ -1588,7 +1605,7 @@ svn_ra_local__get_inherited_props(svn_ra
}
return svn_error_trace(get_node_props(NULL, iprops, sess, root, abs_path,
- pool));
+ result_pool, scratch_pool));
}
static svn_error_t *
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/inherited_props.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/inherited_props.c?rev=1377919&r1=1377918&r2=1377919&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/inherited_props.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/inherited_props.c Tue Aug 28 00:24:03 2012
@@ -274,7 +274,8 @@ svn_ra_serf__get_inherited_props(svn_ra_
apr_array_header_t **iprops,
const char *path,
svn_revnum_t revision,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_error_t *err, *err2;
@@ -290,22 +291,22 @@ svn_ra_serf__get_inherited_props(svn_ra_
NULL /* conn */,
NULL /* url */,
revision,
- pool, pool));
+ result_pool, scratch_pool));
- iprops_ctx = apr_pcalloc(pool, sizeof(*iprops_ctx));
+ iprops_ctx = apr_pcalloc(scratch_pool, sizeof(*iprops_ctx));
iprops_ctx->done = FALSE;
iprops_ctx->repos_root_url = session->repos_root_str;
- iprops_ctx->pool = pool;
- iprops_ctx->curr_path = svn_stringbuf_create_empty(pool);
- iprops_ctx->curr_propname = svn_stringbuf_create_empty(pool);
- iprops_ctx->curr_propval = svn_stringbuf_create_empty(pool);
+ iprops_ctx->pool = result_pool;
+ iprops_ctx->curr_path = svn_stringbuf_create_empty(scratch_pool);
+ iprops_ctx->curr_propname = svn_stringbuf_create_empty(scratch_pool);
+ iprops_ctx->curr_propval = svn_stringbuf_create_empty(scratch_pool);
iprops_ctx->curr_iprop = NULL;
- iprops_ctx->iprops = apr_array_make(pool, 1,
+ iprops_ctx->iprops = apr_array_make(result_pool, 1,
sizeof(svn_prop_inherited_item_t *));
iprops_ctx->path = path;
iprops_ctx->revision = revision;
- handler = apr_pcalloc(pool, sizeof(*handler));
+ handler = apr_pcalloc(scratch_pool, sizeof(*handler));
handler->method = "REPORT";
handler->path = req_url;
@@ -314,11 +315,11 @@ svn_ra_serf__get_inherited_props(svn_ra_
handler->body_delegate = create_iprops_body;
handler->body_delegate_baton = iprops_ctx;
handler->body_type = "text/xml";
- handler->handler_pool = pool;
+ handler->handler_pool = scratch_pool;
- parser_ctx = apr_pcalloc(pool, sizeof(*parser_ctx));
+ parser_ctx = apr_pcalloc(scratch_pool, sizeof(*parser_ctx));
- parser_ctx->pool = pool;
+ parser_ctx->pool = scratch_pool;
parser_ctx->user_data = iprops_ctx;
parser_ctx->start = start_element;
parser_ctx->end = end_element;
@@ -330,7 +331,8 @@ svn_ra_serf__get_inherited_props(svn_ra_
svn_ra_serf__request_create(handler);
- err = svn_ra_serf__context_run_wait(&iprops_ctx->done, session, pool);
+ err = svn_ra_serf__context_run_wait(&iprops_ctx->done, session,
+ scratch_pool);
err2 = svn_ra_serf__error_on_status(handler->sline.code, handler->path,
handler->location);
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/ra_serf.h?rev=1377919&r1=1377918&r2=1377919&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/ra_serf.h Tue Aug 28 00:24:03 2012
@@ -1538,7 +1538,8 @@ svn_ra_serf__get_file(svn_ra_session_t *
svn_revnum_t *fetched_rev,
apr_hash_t **props,
apr_array_header_t **inherited_props,
- apr_pool_t *pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Implements svn_ra__vtable_t.change_rev_prop(). */
svn_error_t *
@@ -1657,7 +1658,8 @@ svn_error_t * svn_ra_serf__get_inherited
apr_array_header_t **iprops,
const char *path,
svn_revnum_t revision,
- apr_pool_t *pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Implements svn_ra__vtable_t.get_repos_root(). */
svn_error_t *
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/serf.c?rev=1377919&r1=1377918&r2=1377919&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/serf.c Tue Aug 28 00:24:03 2012
@@ -929,7 +929,8 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
const char *rel_path,
svn_revnum_t peg_rev,
apr_uint32_t dirent_fields,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_ra_serf__session_t *session = ra_session->priv;
const char *path;
@@ -940,7 +941,7 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
/* If we have a relative path, URI encode and append it. */
if (rel_path)
{
- path = svn_path_url_add_component2(path, rel_path, pool);
+ path = svn_path_url_add_component2(path, rel_path, scratch_pool);
}
/* If the user specified a peg revision other than HEAD, we have to fetch
@@ -951,7 +952,7 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
SVN_ERR(svn_ra_serf__get_stable_url(&path, fetched_rev,
session, NULL /* conn */,
path, revision,
- pool, pool));
+ scratch_pool, scratch_pool));
revision = SVN_INVALID_REVNUM;
}
/* REVISION is always SVN_INVALID_REVNUM */
@@ -971,8 +972,9 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
SVN_ERR(svn_ra_serf__retrieve_props(&props, session, session->conns[0],
path, SVN_INVALID_REVNUM, "1",
get_dirent_props(dirent_fields,
- session, pool),
- pool, pool));
+ session,
+ scratch_pool),
+ result_pool, scratch_pool));
/* Check if the path is really a directory. */
rtype = svn_ra_serf__get_prop(props, path, "DAV:", "resourcetype");
@@ -984,15 +986,15 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
* We're going to return the 2nd one back to the caller as it
* will have the basenames it expects.
*/
- dirent_walk.full_paths = apr_hash_make(pool);
- dirent_walk.base_paths = apr_hash_make(pool);
- dirent_walk.orig_path = svn_urlpath__canonicalize(path, pool);
+ dirent_walk.full_paths = apr_hash_make(scratch_pool);
+ dirent_walk.base_paths = apr_hash_make(result_pool);
+ dirent_walk.orig_path = svn_urlpath__canonicalize(path, scratch_pool);
dirent_walk.supports_deadprop_count = svn_tristate_unknown;
- dirent_walk.result_pool = pool;
+ dirent_walk.result_pool = result_pool;
SVN_ERR(svn_ra_serf__walk_all_paths(props, SVN_INVALID_REVNUM,
path_dirent_walker, &dirent_walk,
- pool));
+ scratch_pool));
if (dirent_walk.supports_deadprop_count == svn_tristate_false
&& session->supports_deadprop_count == svn_tristate_unknown
@@ -1005,15 +1007,16 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
session->conns[0],
path, SVN_INVALID_REVNUM, "1",
get_dirent_props(dirent_fields,
- session, pool),
- pool, pool));
+ session,
+ scratch_pool),
+ scratch_pool, scratch_pool));
- SVN_ERR(svn_hash__clear(dirent_walk.full_paths, pool));
- SVN_ERR(svn_hash__clear(dirent_walk.base_paths, pool));
+ SVN_ERR(svn_hash__clear(dirent_walk.full_paths, scratch_pool));
+ SVN_ERR(svn_hash__clear(dirent_walk.base_paths, scratch_pool));
SVN_ERR(svn_ra_serf__walk_all_paths(props, SVN_INVALID_REVNUM,
path_dirent_walker,
- &dirent_walk, pool));
+ &dirent_walk, scratch_pool));
}
*dirents = dirent_walk.base_paths;
@@ -1030,14 +1033,15 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
SVN_ERR(svn_ra_serf__fetch_node_props(&props, session->conns[0],
path, SVN_INVALID_REVNUM,
all_props,
- pool, pool));
+ result_pool, scratch_pool));
/* Check if the path is really a directory. */
SVN_ERR(resource_is_directory(props));
/* ### flatten_props() does not copy PROPVALUE, but fetch_node_props()
- ### put them into POOL, so we're okay. */
- SVN_ERR(svn_ra_serf__flatten_props(ret_props, props, pool, pool));
+ ### put them into RESULT_POOL, so we're okay. */
+ SVN_ERR(svn_ra_serf__flatten_props(ret_props, props, result_pool,
+ scratch_pool));
}
if (inherited_props)
@@ -1046,15 +1050,18 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
SVN_ERR(svn_ra_serf__has_capability(ra_session, &supports_iprops,
SVN_RA_CAPABILITY_INHERITED_PROPS,
- pool));
+ scratch_pool));
if (!supports_iprops)
{
*inherited_props = NULL;
}
else
{
- SVN_ERR(svn_ra_serf__get_inherited_props(ra_session, inherited_props,
- rel_path, peg_rev, pool));
+ SVN_ERR(svn_ra_serf__get_inherited_props(ra_session,
+ inherited_props,
+ rel_path, peg_rev,
+ result_pool,
+ scratch_pool));
}
}
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/update.c?rev=1377919&r1=1377918&r2=1377919&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/update.c Tue Aug 28 00:24:03 2012
@@ -2921,7 +2921,8 @@ svn_ra_serf__get_file(svn_ra_session_t *
svn_revnum_t *fetched_rev,
apr_hash_t **props,
apr_array_header_t **inherited_props,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_ra_serf__session_t *session = ra_session->priv;
svn_ra_serf__connection_t *conn;
@@ -2936,7 +2937,8 @@ svn_ra_serf__get_file(svn_ra_session_t *
/* Fetch properties. */
- fetch_url = svn_path_url_add_component2(session->session_url.path, path, pool);
+ fetch_url = svn_path_url_add_component2(session->session_url.path, path,
+ scratch_pool);
/* The simple case is if we want HEAD - then a GET on the fetch_url is fine.
*
@@ -2948,7 +2950,7 @@ svn_ra_serf__get_file(svn_ra_session_t *
SVN_ERR(svn_ra_serf__get_stable_url(&fetch_url, fetched_rev,
session, conn,
fetch_url, revision,
- pool, pool));
+ scratch_pool, scratch_pool));
revision = SVN_INVALID_REVNUM;
}
/* REVISION is always SVN_INVALID_REVNUM */
@@ -2970,7 +2972,7 @@ svn_ra_serf__get_file(svn_ra_session_t *
SVN_ERR(svn_ra_serf__fetch_node_props(&fetch_props, conn, fetch_url,
SVN_INVALID_REVNUM,
which_props,
- pool, pool));
+ result_pool, scratch_pool));
/* Verify that resource type is not collection. */
SVN_ERR(svn_ra_serf__get_resource_type(&res_kind, fetch_props));
@@ -2984,15 +2986,16 @@ svn_ra_serf__get_file(svn_ra_session_t *
if (props)
{
/* ### flatten_props() does not copy PROPVALUE, but fetch_node_props()
- ### put them into POOL, so we're okay. */
+ ### put them into RESULT_POOL, so we're okay. */
SVN_ERR(svn_ra_serf__flatten_props(props, fetch_props,
- pool, pool));
+ result_pool, scratch_pool));
}
if (stream)
{
svn_boolean_t found;
- SVN_ERR(try_get_wc_contents(&found, session, fetch_props, stream, pool));
+ SVN_ERR(try_get_wc_contents(&found, session, fetch_props, stream,
+ scratch_pool));
/* No contents found in the WC, let's fetch from server. */
if (!found)
@@ -3001,16 +3004,17 @@ svn_ra_serf__get_file(svn_ra_session_t *
svn_ra_serf__handler_t *handler;
/* Create the fetch context. */
- stream_ctx = apr_pcalloc(pool, sizeof(*stream_ctx));
+ stream_ctx = apr_pcalloc(scratch_pool, sizeof(*stream_ctx));
stream_ctx->target_stream = stream;
stream_ctx->sess = session;
stream_ctx->conn = conn;
- stream_ctx->info = apr_pcalloc(pool, sizeof(*stream_ctx->info));
+ stream_ctx->info = apr_pcalloc(scratch_pool,
+ sizeof(*stream_ctx->info));
stream_ctx->info->name = fetch_url;
- handler = apr_pcalloc(pool, sizeof(*handler));
+ handler = apr_pcalloc(scratch_pool, sizeof(*handler));
- handler->handler_pool = pool;
+ handler->handler_pool = scratch_pool;
handler->method = "GET";
handler->path = fetch_url;
handler->conn = conn;
@@ -3029,7 +3033,8 @@ svn_ra_serf__get_file(svn_ra_session_t *
svn_ra_serf__request_create(handler);
- SVN_ERR(svn_ra_serf__context_run_wait(&stream_ctx->done, session, pool));
+ SVN_ERR(svn_ra_serf__context_run_wait(&stream_ctx->done, session,
+ scratch_pool));
}
}
@@ -3039,7 +3044,7 @@ svn_ra_serf__get_file(svn_ra_session_t *
SVN_ERR(svn_ra_serf__has_capability(ra_session, &supports_iprops,
SVN_RA_CAPABILITY_INHERITED_PROPS,
- pool));
+ scratch_pool));
if (!supports_iprops)
{
*inherited_props = NULL;
@@ -3047,7 +3052,8 @@ svn_ra_serf__get_file(svn_ra_session_t *
else
{
SVN_ERR(svn_ra_serf__get_inherited_props(ra_session, inherited_props,
- path, peg_rev, pool));
+ path, peg_rev, result_pool,
+ scratch_pool));
}
}
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_svn/client.c?rev=1377919&r1=1377918&r2=1377919&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_svn/client.c Tue Aug 28 00:24:03 2012
@@ -1088,7 +1088,8 @@ static svn_error_t *ra_svn_get_file(svn_
svn_revnum_t *fetched_rev,
apr_hash_t **props,
apr_array_header_t **inherited_props,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_ra_svn__session_baton_t *sess_baton = session->priv;
svn_ra_svn_conn_t *conn = sess_baton->conn;
@@ -1099,20 +1100,21 @@ static svn_error_t *ra_svn_get_file(svn_
svn_checksum_ctx_t *checksum_ctx;
apr_pool_t *iterpool;
- SVN_ERR(svn_ra_svn_write_cmd(conn, pool, "get-file", "c(?r)bbb", path,
- rev, (props != NULL), (stream != NULL),
+ SVN_ERR(svn_ra_svn_write_cmd(conn, scratch_pool, "get-file", "c(?r)bbb",
+ path, rev, (props != NULL), (stream != NULL),
(inherited_props != NULL)));
- SVN_ERR(handle_auth_request(sess_baton, pool));
- SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "(?c)rl?l",
+ SVN_ERR(handle_auth_request(sess_baton, scratch_pool));
+ SVN_ERR(svn_ra_svn_read_cmd_response(conn, scratch_pool, "(?c)rl?l",
&expected_digest,
&rev, &proplist, &iproplist));
if (fetched_rev)
*fetched_rev = rev;
if (props)
- SVN_ERR(svn_ra_svn_parse_proplist(proplist, pool, props));
+ SVN_ERR(svn_ra_svn_parse_proplist(proplist, result_pool, props));
if (inherited_props)
- SVN_ERR(parse_iproplist(inherited_props, iproplist, session, pool, pool));
+ SVN_ERR(parse_iproplist(inherited_props, iproplist, session, result_pool,
+ scratch_pool));
/* We're done if the contents weren't wanted. */
if (!stream)
@@ -1121,12 +1123,12 @@ static svn_error_t *ra_svn_get_file(svn_
if (expected_digest)
{
SVN_ERR(svn_checksum_parse_hex(&expected_checksum, svn_checksum_md5,
- expected_digest, pool));
- checksum_ctx = svn_checksum_ctx_create(svn_checksum_md5, pool);
+ expected_digest, scratch_pool));
+ checksum_ctx = svn_checksum_ctx_create(svn_checksum_md5, scratch_pool);
}
/* Read the file's contents. */
- iterpool = svn_pool_create(pool);
+ iterpool = svn_pool_create(scratch_pool);
while (1)
{
svn_ra_svn_item_t *item;
@@ -1148,15 +1150,15 @@ static svn_error_t *ra_svn_get_file(svn_
}
svn_pool_destroy(iterpool);
- SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, ""));
+ SVN_ERR(svn_ra_svn_read_cmd_response(conn, scratch_pool, ""));
if (expected_checksum)
{
svn_checksum_t *checksum;
- SVN_ERR(svn_checksum_final(&checksum, checksum_ctx, pool));
+ SVN_ERR(svn_checksum_final(&checksum, checksum_ctx, scratch_pool));
if (!svn_checksum_match(checksum, expected_checksum))
- return svn_checksum_mismatch_err(expected_checksum, checksum, pool,
+ return svn_checksum_mismatch_err(expected_checksum, checksum, scratch_pool,
_("Checksum mismatch for '%s'"),
path);
}
@@ -1172,49 +1174,57 @@ static svn_error_t *ra_svn_get_dir(svn_r
const char *path,
svn_revnum_t rev,
apr_uint32_t dirent_fields,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_ra_svn__session_baton_t *sess_baton = session->priv;
svn_ra_svn_conn_t *conn = sess_baton->conn;
apr_array_header_t *proplist, *dirlist, *iproplist;
int i;
- SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "w(c(?r)bb(!", "get-dir", path,
- rev, (props != NULL), (dirents != NULL)));
+ SVN_ERR(svn_ra_svn_write_tuple(conn, scratch_pool, "w(c(?r)bb(!", "get-dir",
+ path, rev, (props != NULL),
+ (dirents != NULL)));
if (dirent_fields & SVN_DIRENT_KIND)
- SVN_ERR(svn_ra_svn_write_word(conn, pool, SVN_RA_SVN_DIRENT_KIND));
+ SVN_ERR(svn_ra_svn_write_word(conn, scratch_pool,
+ SVN_RA_SVN_DIRENT_KIND));
if (dirent_fields & SVN_DIRENT_SIZE)
- SVN_ERR(svn_ra_svn_write_word(conn, pool, SVN_RA_SVN_DIRENT_SIZE));
+ SVN_ERR(svn_ra_svn_write_word(conn, scratch_pool,
+ SVN_RA_SVN_DIRENT_SIZE));
if (dirent_fields & SVN_DIRENT_HAS_PROPS)
- SVN_ERR(svn_ra_svn_write_word(conn, pool, SVN_RA_SVN_DIRENT_HAS_PROPS));
+ SVN_ERR(svn_ra_svn_write_word(conn, scratch_pool,
+ SVN_RA_SVN_DIRENT_HAS_PROPS));
if (dirent_fields & SVN_DIRENT_CREATED_REV)
- SVN_ERR(svn_ra_svn_write_word(conn, pool, SVN_RA_SVN_DIRENT_CREATED_REV));
+ SVN_ERR(svn_ra_svn_write_word(conn, scratch_pool,
+ SVN_RA_SVN_DIRENT_CREATED_REV));
if (dirent_fields & SVN_DIRENT_TIME)
- SVN_ERR(svn_ra_svn_write_word(conn, pool, SVN_RA_SVN_DIRENT_TIME));
+ SVN_ERR(svn_ra_svn_write_word(conn, scratch_pool,
+ SVN_RA_SVN_DIRENT_TIME));
if (dirent_fields & SVN_DIRENT_LAST_AUTHOR)
- SVN_ERR(svn_ra_svn_write_word(conn, pool, SVN_RA_SVN_DIRENT_LAST_AUTHOR));
+ SVN_ERR(svn_ra_svn_write_word(conn, scratch_pool,
+ SVN_RA_SVN_DIRENT_LAST_AUTHOR));
- SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!)b)",
+ SVN_ERR(svn_ra_svn_write_tuple(conn, scratch_pool, "!)b)",
(inherited_props != NULL)));
- SVN_ERR(handle_auth_request(sess_baton, pool));
- SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "rll?l", &rev, &proplist,
- &dirlist, &iproplist));
+ SVN_ERR(handle_auth_request(sess_baton, scratch_pool));
+ SVN_ERR(svn_ra_svn_read_cmd_response(conn, scratch_pool, "rll?l", &rev,
+ &proplist, &dirlist, &iproplist));
if (fetched_rev)
*fetched_rev = rev;
if (props)
- SVN_ERR(svn_ra_svn_parse_proplist(proplist, pool, props));
+ SVN_ERR(svn_ra_svn_parse_proplist(proplist, result_pool, props));
if (inherited_props)
- SVN_ERR(parse_iproplist(inherited_props, iproplist, session, pool,
- pool));
+ SVN_ERR(parse_iproplist(inherited_props, iproplist, session, result_pool,
+ scratch_pool));
/* We're done if dirents aren't wanted. */
if (!dirents)
return SVN_NO_ERROR;
/* Interpret the directory list. */
- *dirents = apr_hash_make(pool);
+ *dirents = apr_hash_make(result_pool);
for (i = 0; i < dirlist->nelts; i++)
{
const char *name, *kind, *cdate, *cauthor;
@@ -1227,11 +1237,12 @@ static svn_error_t *ra_svn_get_dir(svn_r
if (elt->kind != SVN_RA_SVN_LIST)
return svn_error_create(SVN_ERR_RA_SVN_MALFORMED_DATA, NULL,
_("Dirlist element not a list"));
- SVN_ERR(svn_ra_svn_parse_tuple(elt->u.list, pool, "cwnbr(?c)(?c)",
+ SVN_ERR(svn_ra_svn_parse_tuple(elt->u.list, scratch_pool,
+ "cwnbr(?c)(?c)",
&name, &kind, &size, &has_props,
&crev, &cdate, &cauthor));
- name = svn_relpath_canonicalize(name, pool);
- dirent = apr_palloc(pool, sizeof(*dirent));
+ name = svn_relpath_canonicalize(name, result_pool);
+ dirent = apr_palloc(result_pool, sizeof(*dirent));
dirent->kind = svn_node_kind_from_word(kind);
dirent->size = size;/* FIXME: svn_filesize_t */
dirent->has_props = has_props;
@@ -1247,7 +1258,7 @@ static svn_error_t *ra_svn_get_dir(svn_r
if (cdate == NULL)
dirent->time = 0;
else
- SVN_ERR(svn_time_from_cstring(&dirent->time, cdate, pool));
+ SVN_ERR(svn_time_from_cstring(&dirent->time, cdate, result_pool));
dirent->last_author = cauthor;
apr_hash_set(*dirents, name, APR_HASH_KEY_STRING, dirent);
}
@@ -2611,17 +2622,19 @@ ra_svn_get_inherited_props(svn_ra_sessio
apr_array_header_t **iprops,
const char *path,
svn_revnum_t revision,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_ra_svn__session_baton_t *sess_baton = session->priv;
svn_ra_svn_conn_t *conn = sess_baton->conn;
apr_array_header_t *iproplist;
- SVN_ERR(svn_ra_svn_write_cmd(conn, pool, "get-iprops", "c(?r)", path,
- revision));
- SVN_ERR(handle_auth_request(sess_baton, pool));
- SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "l", &iproplist));
- SVN_ERR(parse_iproplist(iprops, iproplist, session, pool, pool));
+ SVN_ERR(svn_ra_svn_write_cmd(conn, scratch_pool, "get-iprops", "c(?r)",
+ path, revision));
+ SVN_ERR(handle_auth_request(sess_baton, scratch_pool));
+ SVN_ERR(svn_ra_svn_read_cmd_response(conn, scratch_pool, "l", &iproplist));
+ SVN_ERR(parse_iproplist(iprops, iproplist, session, result_pool,
+ scratch_pool));
return SVN_NO_ERROR;
}