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 2010/04/22 19:32:37 UTC
svn commit: r936980 - /subversion/trunk/subversion/libsvn_client/commit.c
Author: julianfoad
Date: Thu Apr 22 17:32:36 2010
New Revision: 936980
URL: http://svn.apache.org/viewvc?rev=936980&view=rev
Log:
Follow-up r936810: adjust pool usage.
* subversion/libsvn_client/commit.c
(post_process_commit_item): Add 'const' to an input pointer. Don't take a
result_pool, as it doesn't need one. Rename 'pool' to 'scratch_pool'.
Remove a misleading comment.
(svn_client_commit4): Use an iterpool for a loop that didn't have one,
that I omitted in r936810. Adjust the call to post_process_commit_item().
Modified:
subversion/trunk/subversion/libsvn_client/commit.c
Modified: subversion/trunk/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit.c?rev=936980&r1=936979&r2=936980&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit.c Thu Apr 22 17:32:36 2010
@@ -933,16 +933,15 @@ collect_lock_tokens(apr_hash_t **result,
return SVN_NO_ERROR;
}
-/* Put ITEM onto QUEUE... */
+/* Put ITEM onto QUEUE, allocating it in QUEUE's pool... */
static svn_error_t *
post_process_commit_item(svn_wc_committed_queue_t *queue,
- svn_client_commit_item3_t *item,
+ const svn_client_commit_item3_t *item,
svn_wc_context_t *wc_ctx,
svn_boolean_t keep_changelists,
svn_boolean_t keep_locks,
apr_hash_t *checksums,
- apr_pool_t *result_pool,
- apr_pool_t *pool)
+ apr_pool_t *scratch_pool)
{
svn_boolean_t loop_recurse = FALSE;
svn_boolean_t remove_lock;
@@ -957,10 +956,11 @@ post_process_commit_item(svn_wc_committe
svn_boolean_t obstructed;
SVN_ERR(svn_wc__node_is_status_obstructed(&obstructed,
- wc_ctx, item->path, pool));
+ wc_ctx, item->path,
+ scratch_pool));
if (obstructed)
return svn_wc__temp_mark_missing_not_present(item->path,
- wc_ctx, pool);
+ wc_ctx, scratch_pool);
}
if ((item->state_flags & SVN_CLIENT_COMMIT_ITEM_ADD)
@@ -971,15 +971,13 @@ post_process_commit_item(svn_wc_committe
remove_lock = (! keep_locks && (item->state_flags
& SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN));
- /* Allocate the queue in a longer-lived pool than (iter)pool:
- we want it to survive the next iteration. */
return svn_wc_queue_committed3(queue, item->path,
loop_recurse, item->incoming_prop_changes,
remove_lock, !keep_changelists,
apr_hash_get(checksums,
item->path,
APR_HASH_KEY_STRING),
- result_pool);
+ scratch_pool);
}
@@ -1134,13 +1132,19 @@ svn_client_commit4(svn_commit_info_t **c
At the same time, if a non-recursive commit is desired, do not
allow a deleted directory as one of the targets. */
- for (i = 0; i < targets->nelts; i++)
- {
- const char *target_path = APR_ARRAY_IDX(targets, i, const char *);
+ {
+ apr_pool_t *iterpool = svn_pool_create(pool);
- SVN_ERR(check_nonrecursive_dir_delete(target_path, ctx->wc_ctx, depth,
- /*iter*/pool));
- }
+ for (i = 0; i < targets->nelts; i++)
+ {
+ const char *target_path = APR_ARRAY_IDX(targets, i, const char *);
+
+ svn_pool_clear(iterpool);
+ SVN_ERR(check_nonrecursive_dir_delete(target_path, ctx->wc_ctx, depth,
+ iterpool));
+ }
+ svn_pool_destroy(iterpool);
+ }
/* Crawl the working copy for commit items. */
if ((cmt_err = svn_client__harvest_committables(&committables,
@@ -1245,7 +1249,7 @@ svn_client_commit4(svn_commit_info_t **c
svn_pool_clear(iterpool);
bump_err = post_process_commit_item(queue, item, ctx->wc_ctx,
keep_changelists, keep_locks,
- checksums, pool, iterpool);
+ checksums, iterpool);
if (bump_err)
goto cleanup;
}