You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/11/01 21:01:34 UTC

svn commit: r1404736 - /subversion/branches/1.6.x-rep_write_cleanup/subversion/libsvn_client/commit_util.c

Author: breser
Date: Thu Nov  1 20:01:33 2012
New Revision: 1404736

URL: http://svn.apache.org/viewvc?rev=1404736&view=rev
Log:
Fix the lack of a cleanup on an iterpool when an error occurs.

This is similar to changes that happened sometime prior to 1.7.

This creates problems for the r1403964 fix since the transaction gets
deleted before the pool gets cleaned up and thus we're executing our
cleanup in the wrong order.

* subversion/libsvn_client/commit_util.c
  (svn_client__do_commit): In case of errors from svn_wc_adm_retrieve() or
    svn_wc_transmit_text_deltas2() destroy the iterpool before returning.

Modified:
    subversion/branches/1.6.x-rep_write_cleanup/subversion/libsvn_client/commit_util.c

Modified: subversion/branches/1.6.x-rep_write_cleanup/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x-rep_write_cleanup/subversion/libsvn_client/commit_util.c?rev=1404736&r1=1404735&r2=1404736&view=diff
==============================================================================
--- subversion/branches/1.6.x-rep_write_cleanup/subversion/libsvn_client/commit_util.c (original)
+++ subversion/branches/1.6.x-rep_write_cleanup/subversion/libsvn_client/commit_util.c Thu Nov  1 20:01:33 2012
@@ -1643,6 +1643,7 @@ svn_client__do_commit(const char *base_u
       unsigned char digest[APR_MD5_DIGESTSIZE];
       svn_boolean_t fulltext = FALSE;
       svn_wc_adm_access_t *item_access;
+      svn_error_t *err;
 
       svn_pool_clear(iterpool);
       /* Get the next entry. */
@@ -1671,12 +1672,23 @@ svn_client__do_commit(const char *base_u
         fulltext = TRUE;
 
       dir_path = svn_path_dirname(item->path, iterpool);
-      SVN_ERR(svn_wc_adm_retrieve(&item_access, adm_access, dir_path,
-                                  iterpool));
-      SVN_ERR(svn_wc_transmit_text_deltas2(tempfiles ? &tempfile : NULL,
-                                           digest, item->path,
-                                           item_access, fulltext, editor,
-                                           file_baton, iterpool));
+      err = svn_wc_adm_retrieve(&item_access, adm_access, dir_path,
+                                iterpool);
+      if (err)
+        {
+          svn_pool_destroy(iterpool);
+          return err;
+        }
+      err = svn_wc_transmit_text_deltas2(tempfiles ? &tempfile : NULL,
+                                         digest, item->path,
+                                         item_access, fulltext, editor,
+                                         file_baton, iterpool);
+      if (err)
+        {
+          svn_pool_destroy(iterpool);
+          return err;
+        }
+
       if (tempfiles && tempfile)
         {
           tempfile = apr_pstrdup(pool, tempfile);