You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/01/12 17:09:08 UTC
svn commit: r1058213 - /subversion/trunk/subversion/libsvn_client/commit.c
Author: stsp
Date: Wed Jan 12 16:09:07 2011
New Revision: 1058213
URL: http://svn.apache.org/viewvc?rev=1058213&view=rev
Log:
* subversion/libsvn_client/commit.c
(svn_client_commit5): Add a comment documenting the unusual error
handling requirements of this function. Fix a potential problem
where the working copy might be left locked after an error.
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=1058213&r1=1058212&r2=1058213&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit.c Wed Jan 12 16:09:07 2011
@@ -1091,6 +1091,13 @@ svn_client_commit5(const apr_array_heade
SVN_ERR(svn_wc__acquire_write_lock(NULL, ctx->wc_ctx, base_abspath,
FALSE, pool, pool));
+ /*
+ * At this point, the working copy must be unlocked (if possible)
+ * before returning from this function. So we must now handle every
+ * error explicitly, rather than using SVN_ERR().
+ *
+ */
+
/* One day we might support committing from multiple working copies, but
we don't yet. This check ensures that we don't silently commit a
subset of the targets.
@@ -1105,8 +1112,13 @@ svn_client_commit5(const apr_array_heade
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));
+ cmt_err = check_nonrecursive_dir_delete(target_path, ctx->wc_ctx,
+ depth, iterpool);
+ if (cmt_err)
+ {
+ svn_pool_destroy(iterpool);
+ goto cleanup;
+ }
}
svn_pool_destroy(iterpool);
}