subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1152016 [2/5] - in /subversion/branches/revprop-packing: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ notes/ subversion/bindings/swig/ subversion/bindings/swig/perl/native/t/ subversion/include/ subversion/include/priv...
Date Thu, 28 Jul 2011 21:59:01 GMT
Modified: subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.c Thu Jul 28 21:58:49 2011
@@ -1847,16 +1847,20 @@ svn_client_mergeinfo_log(svn_boolean_t f
          subtrees. */
       if (apr_hash_count(merged_noninheritable))
         {
+          apr_pool_t *iterpool2 = svn_pool_create(iterpool);
+
           for (hi = apr_hash_first(iterpool, merged_noninheritable);
                hi;
                hi = apr_hash_next(hi))
             {
               apr_array_header_t *list = svn__apr_hash_index_val(hi);
-              SVN_ERR(svn_rangelist_merge(
-                &master_noninheritable_rangelist,
+              svn_pool_clear(iterpool2);
+              SVN_ERR(svn_rangelist_merge2(
+                master_noninheritable_rangelist,
                 svn_rangelist_dup(list, scratch_pool),
-                scratch_pool));
+                scratch_pool, iterpool2));
             }
+          svn_pool_destroy(iterpool2);
         }
 
       /* Find the intersection of the inheritable part of TGT_MERGEINFO
@@ -1874,6 +1878,7 @@ svn_client_mergeinfo_log(svn_boolean_t f
              to SUBTREE_PATH. */
           apr_array_header_t *subtree_merged_rangelist =
             apr_array_make(scratch_pool, 1, sizeof(svn_merge_range_t *));
+          apr_pool_t *iterpool2 = svn_pool_create(iterpool);
 
           for (hi = apr_hash_first(iterpool, merged);
                hi;
@@ -1881,15 +1886,17 @@ svn_client_mergeinfo_log(svn_boolean_t f
             {
               apr_array_header_t *list = svn__apr_hash_index_val(hi);
 
-              SVN_ERR(svn_rangelist_merge(&master_inheritable_rangelist,
-                                          svn_rangelist_dup(list,
-                                                            scratch_pool),
-                                          scratch_pool));
-              SVN_ERR(svn_rangelist_merge(&subtree_merged_rangelist,
-                                          svn_rangelist_dup(list,
+              svn_pool_clear(iterpool2);
+              SVN_ERR(svn_rangelist_merge2(master_inheritable_rangelist,
+                                           svn_rangelist_dup(list,
+                                                             scratch_pool),
+                                           scratch_pool, iterpool2));
+              SVN_ERR(svn_rangelist_merge2(subtree_merged_rangelist,
+                                           svn_rangelist_dup(list,
                                                             scratch_pool),
-                                          scratch_pool));
+                                           scratch_pool, iterpool2));
             }
+          svn_pool_destroy(iterpool2);
 
           apr_hash_set(inheritable_subtree_merges,
                        apr_pstrdup(scratch_pool, subtree_path),
@@ -1937,9 +1944,9 @@ svn_client_mergeinfo_log(svn_boolean_t f
           if (deleted_rangelist->nelts)
             {
               svn_rangelist__set_inheritance(deleted_rangelist, FALSE);
-              SVN_ERR(svn_rangelist_merge(&master_noninheritable_rangelist,
-                                          deleted_rangelist,
-                                          scratch_pool));
+              SVN_ERR(svn_rangelist_merge2(master_noninheritable_rangelist,
+                                           deleted_rangelist,
+                                           scratch_pool, iterpool));
               SVN_ERR(svn_rangelist_remove(&master_inheritable_rangelist,
                                            deleted_rangelist,
                                            master_inheritable_rangelist,
@@ -1952,9 +1959,9 @@ svn_client_mergeinfo_log(svn_boolean_t f
   if (finding_merged)
     {
       /* Roll all the merged revisions into one rangelist. */
-      SVN_ERR(svn_rangelist_merge(&master_inheritable_rangelist,
-                                  master_noninheritable_rangelist,
-                                  scratch_pool));
+      SVN_ERR(svn_rangelist_merge2(master_inheritable_rangelist,
+                                   master_noninheritable_rangelist,
+                                   scratch_pool, scratch_pool));
 
     }
   else
@@ -1970,9 +1977,10 @@ svn_client_mergeinfo_log(svn_boolean_t f
           apr_array_header_t *subtree_merged_rangelist =
             svn__apr_hash_index_val(hi);
 
-          SVN_ERR(svn_rangelist_merge(&source_master_rangelist,
-                                      subtree_merged_rangelist,
-                                      iterpool));
+          svn_pool_clear(iterpool);
+          SVN_ERR(svn_rangelist_merge2(source_master_rangelist,
+                                       subtree_merged_rangelist,
+                                       scratch_pool, iterpool));
         }
 
       /* From what might be eligible subtract what we know is partially merged
@@ -1981,9 +1989,9 @@ svn_client_mergeinfo_log(svn_boolean_t f
                                    master_noninheritable_rangelist,
                                    source_master_rangelist,
                                    FALSE, scratch_pool));
-      SVN_ERR(svn_rangelist_merge(&source_master_rangelist,
-                                  master_noninheritable_rangelist,
-                                  scratch_pool));
+      SVN_ERR(svn_rangelist_merge2(source_master_rangelist,
+                                   master_noninheritable_rangelist,
+                                   scratch_pool, scratch_pool));
       SVN_ERR(svn_rangelist_remove(&master_inheritable_rangelist,
                                    master_inheritable_rangelist,
                                    source_master_rangelist,

Modified: subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.h?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.h (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.h Thu Jul 28 21:58:49 2011
@@ -99,7 +99,7 @@ svn_client__merge_path_dup(const svn_cli
    the range of the parent's last committed revision to the parent's base
    revision (inclusive) or is LOCAL_ABSPATH is a local addition.  If asking
    for the inherited mergeinfo of an added path (i.e. one with no base
-   revision), that path may inherit mergeinfo from it's nearest parent
+   revision), that path may inherit mergeinfo from its nearest parent
    with a base revision and explicit mergeinfo.
 
    INHERIT indicates whether explicit, explicit or inherited, or only

Modified: subversion/branches/revprop-packing/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_client/repos_diff.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_client/repos_diff.c Thu Jul 28 21:58:49 2011
@@ -67,9 +67,6 @@ struct edit_baton {
   const svn_wc_diff_callbacks4_t *diff_callbacks;
   void *diff_cmd_baton;
 
-  /* DRY_RUN is TRUE if this is a dry-run diff, false otherwise. */
-  svn_boolean_t dry_run;
-
   /* RA_SESSION is the open session for making requests to the RA layer */
   svn_ra_session_t *ra_session;
 
@@ -334,11 +331,11 @@ get_file_from_ra(struct file_baton *b,
       svn_stream_t *fstream;
 
       SVN_ERR(svn_stream_open_unique(&fstream, &(b->path_start_revision), NULL,
-                                     svn_io_file_del_on_pool_cleanup, b->pool,
-                                     b->pool));
+                                     svn_io_file_del_on_pool_cleanup,
+                                     scratch_pool, scratch_pool));
 
       fstream = svn_stream_checksummed2(fstream, NULL, &b->start_md5_checksum,
-                                        svn_checksum_md5, TRUE, b->pool);
+                                        svn_checksum_md5, TRUE, scratch_pool);
 
       /* Retrieve the file and its properties */
       SVN_ERR(svn_ra_get_file(b->edit_baton->ra_session,
@@ -898,7 +895,7 @@ apply_textdelta(void *file_baton,
 
   /* We need the expected pristine file, so go get it */
   if (!b->added)
-    SVN_ERR(get_file_from_ra(b, FALSE, b->pool));
+    SVN_ERR(get_file_from_ra(b, FALSE, scratch_pool));
   else
     SVN_ERR(get_empty_file(b->edit_baton, &(b->path_start_revision)));
 
@@ -1113,9 +1110,6 @@ close_directory(void *dir_baton,
   if (!b->added && b->propchanges->nelts > 0)
     remove_non_prop_changes(b->pristine_props, b->propchanges);
 
-  /* Don't do the props_changed stuff if this is a dry_run and we don't
-     have an access baton, since in that case the directory will already
-     have been recognised as added, in which case they cannot conflict. */
   if (b->propchanges->nelts > 0)
     {
       svn_boolean_t tree_conflicted = FALSE;
@@ -1316,15 +1310,13 @@ svn_client__get_diff_editor(const svn_de
                             svn_ra_session_t *ra_session,
                             svn_revnum_t revision,
                             svn_boolean_t walk_deleted_dirs,
-                            svn_boolean_t dry_run,
                             const svn_wc_diff_callbacks4_t *diff_callbacks,
                             void *diff_cmd_baton,
                             svn_cancel_func_t cancel_func,
                             void *cancel_baton,
                             svn_wc_notify_func2_t notify_func,
                             void *notify_baton,
-                            apr_pool_t *result_pool,
-                            apr_pool_t *scratch_pool)
+                            apr_pool_t *result_pool)
 {
   apr_pool_t *editor_pool = svn_pool_create(result_pool);
   svn_delta_editor_t *tree_editor = svn_delta_default_editor(editor_pool);
@@ -1339,7 +1331,6 @@ svn_client__get_diff_editor(const svn_de
   eb->depth = depth;
   eb->diff_callbacks = diff_callbacks;
   eb->diff_cmd_baton = diff_cmd_baton;
-  eb->dry_run = dry_run;
   eb->ra_session = ra_session;
 
   eb->revision = revision;

Modified: subversion/branches/revprop-packing/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs/fs-loader.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs/fs-loader.c Thu Jul 28 21:58:49 2011
@@ -29,6 +29,7 @@
 #include <apr_thread_mutex.h>
 #include <apr_uuid.h>
 
+#include "svn_ctype.h"
 #include "svn_types.h"
 #include "svn_dso.h"
 #include "svn_version.h"
@@ -1305,6 +1306,31 @@ svn_fs_lock(svn_lock_t **lock, svn_fs_t 
            _("Lock comment contains illegal characters"));
     }
 
+  /* Enforce that the token be an XML-safe URI. */
+  if (token)
+    {
+      const char *c;
+
+      if (strncmp(token, "opaquelocktoken:", 16))
+        return svn_error_createf(SVN_ERR_FS_BAD_LOCK_TOKEN, NULL,
+                                 _("Lock token URI '%s' has bad scheme; "
+                                   "expected '%s'"),
+                                 token, "opaquelocktoken");
+
+      for (c = token; *c; c++)
+        if (! svn_ctype_isascii(*c))
+          return svn_error_createf(SVN_ERR_FS_BAD_LOCK_TOKEN, NULL,
+                                   _("Lock token '%s' is not ASCII "
+                                     "at byte %u"),
+                                   token, (unsigned)(c - token));
+
+      /* strlen(token) == c - token. */
+      if (! svn_xml_is_xml_safe(token, c - token))
+        return svn_error_createf(SVN_ERR_FS_BAD_LOCK_TOKEN, NULL,
+                                 _("Lock token URI '%s' is not XML-safe"),
+                                 token);
+    }
+
   if (expiration_date < 0)
         return svn_error_create
           (SVN_ERR_INCORRECT_PARAMS, NULL,

Modified: subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c Thu Jul 28 21:58:49 2011
@@ -853,8 +853,10 @@ get_writable_proto_rev_body(svn_fs_t *fs
 
   if (err)
     {
-      svn_error_clear(unlock_proto_rev_list_locked(fs, txn_id, *lockcookie,
-                                                   pool));
+      err = svn_error_compose_create(
+              err,
+              unlock_proto_rev_list_locked(fs, txn_id, *lockcookie, pool));
+      
       *lockcookie = NULL;
     }
 
@@ -6945,7 +6947,7 @@ svn_fs_fs__create(svn_fs_t *fs,
                               ? "0\n" : "0 1 1\n"),
                              pool));
   SVN_ERR(svn_io_file_create(path_lock(fs, pool), "", pool));
-  SVN_ERR(svn_fs_fs__set_uuid(fs, svn_uuid_generate(pool), pool));
+  SVN_ERR(svn_fs_fs__set_uuid(fs, NULL, pool));
 
   SVN_ERR(write_revision_zero(fs));
 
@@ -8302,14 +8304,19 @@ svn_fs_fs__verify(svn_fs_t *fs,
                   apr_pool_t *pool)
 {
   fs_fs_data_t *ffd = fs->fsap_data;
+  svn_boolean_t exists;
 
   if (ffd->format < SVN_FS_FS__MIN_REP_SHARING_FORMAT)
     return SVN_NO_ERROR;
 
-  /* Don't take any lock. */
-  SVN_ERR(svn_fs_fs__walk_rep_reference(fs, verify_walker, NULL,
-                                        cancel_func, cancel_baton,
-                                        pool));
+  /* Do not attempt to walk the rep-cache database if its file does not exists,
+     since doing so would create it --- which may confuse the administrator. */
+  SVN_ERR(svn_fs_fs__exists_rep_cache(&exists, fs, pool));
+  if (exists)
+    /* Don't take any lock. */
+    SVN_ERR(svn_fs_fs__walk_rep_reference(fs, verify_walker, NULL,
+                                          cancel_func, cancel_baton,
+                                          pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.c Thu Jul 28 21:58:49 2011
@@ -43,7 +43,12 @@ REP_CACHE_DB_SQL_DECLARE_STATEMENTS(stat
 
 
 /** Helper functions. **/
-
+static APR_INLINE const char *
+path_rep_cache_db(const char *fs_path,
+                  apr_pool_t *result_pool)
+{
+  return svn_dirent_join(fs_path, REP_CACHE_DB_NAME, result_pool);
+}
 
 /* Check that REP refers to a revision that exists in FS. */
 static svn_error_t *
@@ -91,7 +96,7 @@ open_rep_cache(void *baton,
 
   /* Open (or create) the sqlite database.  It will be automatically
      closed when fs->pool is destoyed. */
-  db_path = svn_dirent_join(fs->path, REP_CACHE_DB_NAME, pool);
+  db_path = path_rep_cache_db(fs->path, pool);
   SVN_ERR(svn_sqlite__open(&ffd->rep_cache_db, db_path,
                            svn_sqlite__mode_rwcreate, statements,
                            0, NULL,
@@ -120,6 +125,19 @@ svn_fs_fs__open_rep_cache(svn_fs_t *fs,
 }
 
 svn_error_t *
+svn_fs_fs__exists_rep_cache(svn_boolean_t *exists,
+                            svn_fs_t *fs, apr_pool_t *pool)
+{
+  svn_node_kind_t kind;
+
+  SVN_ERR(svn_io_check_path(path_rep_cache_db(fs->path, pool),
+                            &kind, pool));
+
+  *exists = (kind != svn_node_none);
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_fs_fs__walk_rep_reference(svn_fs_t *fs,
                               svn_error_t *(*walker)(representation_t *,
                                                      void *,

Modified: subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.h?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.h (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.h Thu Jul 28 21:58:49 2011
@@ -40,6 +40,11 @@ svn_error_t *
 svn_fs_fs__open_rep_cache(svn_fs_t *fs,
                           apr_pool_t *pool);
 
+/* Set *EXISTS to TRUE iff the rep-cache DB file exists. */
+svn_error_t *
+svn_fs_fs__exists_rep_cache(svn_boolean_t *exists,
+                            svn_fs_t *fs, apr_pool_t *pool);
+
 /* Iterate all representations currently in FS's cache. */
 svn_error_t *
 svn_fs_fs__walk_rep_reference(svn_fs_t *fs,

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_local/ra_plugin.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_local/ra_plugin.c Thu Jul 28 21:58:49 2011
@@ -860,14 +860,26 @@ struct log_baton
 };
 
 static svn_error_t *
-cancellation_log_receiver(void *baton,
-                          svn_log_entry_t *log_entry,
-                          apr_pool_t *pool)
+log_receiver_wrapper(void *baton,
+                     svn_log_entry_t *log_entry,
+                     apr_pool_t *pool)
 {
   struct log_baton *b = baton;
   svn_ra_local__session_baton_t *sess = b->sess;
 
-  SVN_ERR((sess->callbacks->cancel_func)(sess->callback_baton));
+  if (sess->callbacks->cancel_func)
+    SVN_ERR((sess->callbacks->cancel_func)(sess->callback_baton));
+
+  /* For consistency with the other RA layers, replace an empty
+     changed-paths hash with a NULL one.
+
+     ### Should this be done by svn_ra_get_log2() instead, then? */
+  if ((log_entry->changed_paths2)
+      && (apr_hash_count(log_entry->changed_paths2) == 0))
+    {
+      log_entry->changed_paths = NULL;
+      log_entry->changed_paths2 = NULL;
+    }
 
   return b->real_cb(b->real_baton, log_entry, pool);
 }
@@ -904,16 +916,11 @@ svn_ra_local__get_log(svn_ra_session_t *
         }
     }
 
-  if (sess->callbacks &&
-      sess->callbacks->cancel_func)
-    {
-      lb.real_cb = receiver;
-      lb.real_baton = receiver_baton;
-      lb.sess = sess;
-
-      receiver = cancellation_log_receiver;
-      receiver_baton = &lb;
-    }
+  lb.real_cb = receiver;
+  lb.real_baton = receiver_baton;
+  lb.sess = sess;
+  receiver = log_receiver_wrapper;
+  receiver_baton = &lb;
 
   return svn_repos_get_logs4(sess->repos,
                              abs_paths,

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_neon/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_neon/log.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_neon/log.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_neon/log.c Thu Jul 28 21:58:49 2011
@@ -529,5 +529,5 @@ svn_error_t * svn_ra_neon__get_log(svn_r
       err = SVN_NO_ERROR;
     }
 
-  return err;
+  return svn_error_trace(err);
 }

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_serf/getlocationsegments.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_serf/getlocationsegments.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_serf/getlocationsegments.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_serf/getlocationsegments.c Thu Jul 28 21:58:49 2011
@@ -184,7 +184,7 @@ svn_ra_serf__get_location_segments(svn_r
   svn_ra_serf__handler_t *handler;
   svn_ra_serf__xml_parser_t *parser_ctx;
   const char *relative_url, *basecoll_url, *req_url;
-  svn_error_t *err, *err2;
+  svn_error_t *err;
 
   gls_ctx = apr_pcalloc(pool, sizeof(*gls_ctx));
   gls_ctx->path = path;
@@ -233,20 +233,16 @@ svn_ra_serf__get_location_segments(svn_r
                             _("Location segment report failed on '%s'@'%ld'"),
                               path, peg_revision);
 
-  err2 = svn_ra_serf__error_on_status(gls_ctx->status_code,
+  err = svn_error_compose_create(
+         svn_ra_serf__error_on_status(gls_ctx->status_code,
                                       handler->path,
-                                      parser_ctx->location);
-  if (err2)
-    {
-      /* Prefer err2 to err. */
-      svn_error_clear(err);
-      return err2;
-    }
+                                      parser_ctx->location),
+         err);;
 
   svn_pool_destroy(gls_ctx->subpool);
 
   if (err && (err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE))
     return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, err, NULL);
 
-  return err;
+  return svn_error_trace(err);
 }

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_serf/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_serf/log.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_serf/log.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_serf/log.c Thu Jul 28 21:58:49 2011
@@ -464,7 +464,7 @@ cdata_log(svn_ra_serf__xml_parser_t *par
       case DELETED_PATH:
       case MODIFIED_PATH:
         svn_ra_serf__expand_string(&info->tmp, &info->tmp_len,
-                                   data, len, parser->state->pool);
+                                   data, len, info->pool);
         break;
       default:
         break;
@@ -589,6 +589,7 @@ svn_ra_serf__get_log(svn_ra_session_t *r
   svn_ra_serf__xml_parser_t *parser_ctx;
   svn_boolean_t want_custom_revprops;
   svn_revnum_t peg_rev;
+  svn_error_t *err;
   const char *relative_url, *basecoll_url, *req_url;
 
   log_ctx = apr_pcalloc(pool, sizeof(*log_ctx));
@@ -674,7 +675,13 @@ svn_ra_serf__get_log(svn_ra_session_t *r
 
   svn_ra_serf__request_create(handler);
 
-  SVN_ERR(svn_ra_serf__context_run_wait(&log_ctx->done, session, pool));
+  err = svn_ra_serf__context_run_wait(&log_ctx->done, session, pool);
+
+  SVN_ERR(svn_error_compose_create(
+              svn_ra_serf__error_on_status(log_ctx->status_code,
+                                           req_url,
+                                           parser_ctx->location),
+              err));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_serf/ra_serf.h?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_serf/ra_serf.h Thu Jul 28 21:58:49 2011
@@ -74,7 +74,7 @@ typedef struct svn_ra_serf__connection_t
   serf_bucket_alloc_t *bkt_alloc;
 
   /* Host name */
-  const char *hostinfo;
+  const char *hostname;
 
   /* Are we using ssl */
   svn_boolean_t using_ssl;
@@ -139,9 +139,13 @@ struct svn_ra_serf__session_t {
   const svn_ra_callbacks2_t *wc_callbacks;
   void *wc_callback_baton;
 
-  /* Callback function to send info to WC */
-  svn_ra_progress_notify_func_t wc_progress_func;
-  void *wc_progress_baton;
+  /* Callback function to send progress info to the client */
+  svn_ra_progress_notify_func_t progress_func;
+  void *progress_baton;
+
+  /* Callback function to handle cancellation */
+  svn_cancel_func_t cancel_func;
+  void *cancel_baton;
 
   /* Error that we've received but not yet returned upstream. */
   svn_error_t *pending_error;

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_serf/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_serf/replay.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_serf/replay.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_serf/replay.c Thu Jul 28 21:58:49 2011
@@ -194,6 +194,7 @@ start_replay(svn_ra_serf__xml_parser_t *
 
       /* Create a pool for the commit editor. */
       ctx->dst_rev_pool = svn_pool_create(ctx->src_rev_pool);
+      ctx->file_pool = svn_pool_create(ctx->dst_rev_pool);
 
       /* ### it would be nice to have a proper scratch_pool.  */
       SVN_ERR(svn_ra_serf__select_revprops(&ctx->props,
@@ -650,7 +651,6 @@ svn_ra_serf__replay(svn_ra_session_t *ra
 
   replay_ctx = apr_pcalloc(pool, sizeof(*replay_ctx));
   replay_ctx->src_rev_pool = pool;
-  replay_ctx->file_pool = svn_pool_create(pool);
   replay_ctx->editor = editor;
   replay_ctx->editor_baton = edit_baton;
   replay_ctx->done = FALSE;
@@ -756,6 +756,9 @@ svn_ra_serf__replay_range(svn_ra_session
          to store the response status code. */
       int status_code;
 
+      if (session->cancel_func)
+        SVN_ERR(session->cancel_func(session->cancel_baton));
+
       /* Send pending requests, if any. Limit the number of outstanding
          requests to MAX_OUTSTANDING_REQUESTS. */
       if (rev <= end_revision  && active_reports < MAX_OUTSTANDING_REQUESTS)
@@ -766,7 +769,6 @@ svn_ra_serf__replay_range(svn_ra_session
 
           replay_ctx = apr_pcalloc(ctx_pool, sizeof(*replay_ctx));
           replay_ctx->src_rev_pool = ctx_pool;
-          replay_ctx->file_pool = svn_pool_create(pool);
           replay_ctx->revstart_func = revstart_func;
           replay_ctx->revfinish_func = revfinish_func;
           replay_ctx->replay_baton = replay_baton;

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_serf/serf.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_serf/serf.c Thu Jul 28 21:58:49 2011
@@ -326,11 +326,11 @@ static void
 svn_ra_serf__progress(void *progress_baton, apr_off_t read, apr_off_t written)
 {
   const svn_ra_serf__session_t *serf_sess = progress_baton;
-  if (serf_sess->wc_progress_func)
+  if (serf_sess->progress_func)
     {
-      serf_sess->wc_progress_func(read + written, -1,
-                                  serf_sess->wc_progress_baton,
-                                  serf_sess->pool);
+      serf_sess->progress_func(read + written, -1,
+                               serf_sess->progress_baton,
+                               serf_sess->pool);
     }
 }
 
@@ -355,8 +355,10 @@ svn_ra_serf__open(svn_ra_session_t *sess
   serf_sess->pool = svn_pool_create(pool);
   serf_sess->wc_callbacks = callbacks;
   serf_sess->wc_callback_baton = callback_baton;
-  serf_sess->wc_progress_baton = callbacks->progress_baton;
-  serf_sess->wc_progress_func = callbacks->progress_func;
+  serf_sess->progress_func = callbacks->progress_func;
+  serf_sess->progress_baton = callbacks->progress_baton;
+  serf_sess->cancel_func = callbacks->cancel_func;
+  serf_sess->cancel_baton = callback_baton;
 
   /* todo: reuse serf context across sessions */
   serf_sess->context = serf_context_create(serf_sess->pool);
@@ -400,7 +402,7 @@ svn_ra_serf__open(svn_ra_session_t *sess
 
   serf_sess->conns[0]->using_ssl = serf_sess->using_ssl;
   serf_sess->conns[0]->using_compression = serf_sess->using_compression;
-  serf_sess->conns[0]->hostinfo = url.hostinfo;
+  serf_sess->conns[0]->hostname = url.hostname;
   serf_sess->conns[0]->useragent = NULL;
 
   /* create the user agent string */

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_serf/update.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_serf/update.c Thu Jul 28 21:58:49 2011
@@ -2214,7 +2214,7 @@ open_connection_if_needed(svn_ra_serf__s
       sess->conns[cur] = apr_palloc(sess->pool, sizeof(*sess->conns[cur]));
       sess->conns[cur]->bkt_alloc = serf_bucket_allocator_create(sess->pool,
                                                                  NULL, NULL);
-      sess->conns[cur]->hostinfo = sess->conns[0]->hostinfo;
+      sess->conns[cur]->hostname  = sess->conns[0]->hostname;
       sess->conns[cur]->using_ssl = sess->conns[0]->using_ssl;
       sess->conns[cur]->using_compression = sess->conns[0]->using_compression;
       sess->conns[cur]->useragent = sess->conns[0]->useragent;
@@ -2362,6 +2362,9 @@ finish_report(void *report_baton,
       /* Note: this throws out the old ITERPOOL_INNER.  */
       svn_pool_clear(iterpool);
 
+      if (sess->cancel_func)
+        SVN_ERR(sess->cancel_func(sess->cancel_baton));
+
       /* We need to be careful between the outer and inner ITERPOOLs,
          and what items are allocated within.  */
       iterpool_inner = svn_pool_create(iterpool);

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_serf/util.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_serf/util.c Thu Jul 28 21:58:49 2011
@@ -117,6 +117,7 @@ static int pbtest_step = 0;
                : ((p)->spill == NULL ? ((p)->head == NULL ? 2 : 3) \
                                      : ((p)->head == NULL ? 6 : 4)))
 
+/* Note: INJECT and COMPLETED are only used for debug output.  */
 typedef struct {
   svn_boolean_t paused;   /* pause the parser on this step?  */
   svn_boolean_t inject;   /* inject pending content on this step?  */
@@ -143,13 +144,17 @@ static const pbtest_desc_t pbtest_descri
 };
 
 #define PBTEST_SET_PAUSED(ctx) \
-  (pbtest_step < 14                                          \
+  (PBTEST_THIS_REQ(ctx) && pbtest_step < 14                  \
    ? (ctx)->paused = pbtest_description[pbtest_step].paused  \
    : FALSE)
 
-#define PBTEST_MAYBE_STEP(ctx) maybe_next_step(ctx)
+#define PBTEST_MAYBE_STEP(ctx, force) maybe_next_step(ctx, force)
 
-#define PBTEST_FORCE_SPILL() (pbtest_step == 6)
+#define PBTEST_FORCE_SPILL(ctx) (PBTEST_THIS_REQ(ctx) && pbtest_step == 6)
+
+#define PBTEST_THIS_REQ(ctx) \
+  ((ctx)->response_type != NULL \
+   && strcmp((ctx)->response_type, "update-report") == 0)
 
 #else /* PBTEST_ACTIVE  */
 
@@ -157,9 +162,10 @@ static const pbtest_desc_t pbtest_descri
    end up with "statement with no effect" warnings. Obviously, this
    depends upon particular usage, which is easy to verify.  */
 #define PBTEST_SET_PAUSED(ctx)  /* empty */
-#define PBTEST_MAYBE_STEP(ctx)  /* empty */
+#define PBTEST_MAYBE_STEP(ctx, force)  /* empty */
 
-#define PBTEST_FORCE_SPILL() FALSE
+#define PBTEST_FORCE_SPILL(ctx) FALSE
+#define PBTEST_THIS_REQ(ctx) FALSE
 
 #endif /* PBTEST_ACTIVE  */
 
@@ -296,7 +302,7 @@ ssl_server_cert(void *baton, int failure
       int i;
       for (i = 0; i < san->nelts; i++) {
           char *s = APR_ARRAY_IDX(san, i, char*);
-          if (apr_fnmatch(s, conn->hostinfo,
+          if (apr_fnmatch(s, conn->hostname,
                           APR_FNM_PERIOD) == APR_SUCCESS) {
               found_matching_hostname = 1;
               cert_info.hostname = s;
@@ -308,7 +314,7 @@ ssl_server_cert(void *baton, int failure
   /* Match server certificate CN with the hostname of the server */
   if (!found_matching_hostname && cert_info.hostname)
     {
-      if (apr_fnmatch(cert_info.hostname, conn->hostinfo,
+      if (apr_fnmatch(cert_info.hostname, conn->hostname,
                       APR_FNM_PERIOD) == APR_FNM_NOMATCH)
         {
           svn_failures |= SVN_AUTH_SSL_CNMISMATCH;
@@ -422,7 +428,7 @@ conn_setup(apr_socket_t *sock,
           conn->ssl_context = serf_bucket_ssl_encrypt_context_get(*read_bkt);
 
 #if SERF_VERSION_AT_LEAST(1,0,0)
-          serf_ssl_set_hostname(conn->ssl_context, conn->hostinfo);
+          serf_ssl_set_hostname(conn->ssl_context, conn->hostname);
 #endif
 
           serf_ssl_client_cert_provider_set(conn->ssl_context,
@@ -743,9 +749,8 @@ svn_ra_serf__context_run_wait(svn_boolea
 
       svn_pool_clear(iterpool);
 
-      if (sess->wc_callbacks &&
-          sess->wc_callbacks->cancel_func)
-        SVN_ERR((sess->wc_callbacks->cancel_func)(sess->wc_callback_baton));
+      if (sess->cancel_func)
+        SVN_ERR((*sess->cancel_func)(sess->cancel_baton));
 
       status = serf_context_run(sess->context, sess->timeout, iterpool);
 
@@ -1311,9 +1316,10 @@ add_done_item(svn_ra_serf__xml_parser_t 
 #ifdef PBTEST_ACTIVE
 
 /* Determine whether we should move to the next step. Print out the
-   transition for debugging purposes.  */
+   transition for debugging purposes. If FORCE is TRUE, then we
+   definitely make a step (injection has completed).  */
 static void
-maybe_next_step(svn_ra_serf__xml_parser_t *parser)
+maybe_next_step(svn_ra_serf__xml_parser_t *parser, svn_boolean_t force)
 {
   const pbtest_desc_t *desc;
   int state;
@@ -1323,10 +1329,15 @@ maybe_next_step(svn_ra_serf__xml_parser_
   if (pbtest_step == 14)
     return;
 
+  /* If this is not the request running the test, then exit.  */
+  if (!PBTEST_THIS_REQ(parser))
+    return;
+
   desc = &pbtest_description[pbtest_step];
   state = PBTEST_STATE(parser->pending);
 
-  if (desc->inject || state == desc->when_next || pbtest_step == 0)
+  /* Forced? ... or reached target state?  */
+  if (force || state == desc->when_next)
     {
       ++pbtest_step;
 
@@ -1337,8 +1348,8 @@ maybe_next_step(svn_ra_serf__xml_parser_
       ++desc;
       parser->paused = desc->paused;
 
-      SVN_DBG(("PBTEST: advanced: step=%d  paused=%d  inject=%d\n",
-               pbtest_step, desc->paused, desc->inject));
+      SVN_DBG(("PBTEST: advanced: step=%d  paused=%d  inject=%d  state=%d\n",
+               pbtest_step, desc->paused, desc->inject, state));
     }
   else
     {
@@ -1397,13 +1408,13 @@ write_to_pending(svn_ra_serf__xml_parser
 
      For testing purposes, there are points when we may want to
      create the spill file, regardless.  */
-  if (PBTEST_FORCE_SPILL()
+  if (PBTEST_FORCE_SPILL(ctx)
       || (ctx->pending->spill == NULL
           && ctx->pending->memory_size > SPILL_SIZE))
     {
 #ifdef PBTEST_ACTIVE
       /* Only allow a spill file for steps 6 or later.  */
-      if (pbtest_step >= 6)
+      if (!PBTEST_THIS_REQ(ctx) || pbtest_step >= 6)
 #endif
       SVN_ERR(svn_io_open_unique_file3(&ctx->pending->spill,
                                        NULL /* temp_path */,
@@ -1500,15 +1511,16 @@ svn_ra_serf__process_pending(svn_ra_serf
 
 #ifdef PBTEST_ACTIVE
   /* If this step should not inject content, then fast-path exit.  */
-  if (pbtest_step < 14 && !pbtest_description[pbtest_step].inject)
+  if (PBTEST_THIS_REQ(parser)
+      && pbtest_step < 14 && !pbtest_description[pbtest_step].inject)
     {
       SVN_DBG(("PBTEST: process: injection disabled\n"));
       return SVN_NO_ERROR;
     }
 #endif
 
-  /* Fast path exit: already paused, or nothing to do.  */
-  if (parser->paused || parser->pending == NULL)
+  /* Fast path exit: already paused, nothing to do, or already done.  */
+  if (parser->paused || parser->pending == NULL || *parser->done)
     return SVN_NO_ERROR;
 
   /* ### it is possible that the XML parsing of the pending content is
@@ -1548,9 +1560,10 @@ svn_ra_serf__process_pending(svn_ra_serf
   /* For steps 4 and 9, we wait until all of the memory content has been
      injected. At that point, we can take another step which will pause
      the parser, and we'll need to exit.  */
-  if (pbtest_step == 4 || pbtest_step == 9)
+  if (PBTEST_THIS_REQ(parser)
+      && (pbtest_step == 4 || pbtest_step == 9))
     {
-      PBTEST_MAYBE_STEP(parser);
+      PBTEST_MAYBE_STEP(parser, TRUE);
       return SVN_NO_ERROR;
     }
 #endif
@@ -1609,17 +1622,25 @@ svn_ra_serf__process_pending(svn_ra_serf
      the network, then we're completely done with the parsing.  */
   if (parser->pending->network_eof)
     {
+#ifdef PBTEST_ACTIVE
+      if (PBTEST_THIS_REQ(parser))
+        SVN_DBG(("process: terminating parse.\n"));
+#endif
+
+      SVN_ERR_ASSERT(parser->xmlp != NULL);
+
       /* Tell the parser that no more content will be parsed. Ignore the
          return status. We just don't care.  */
       (void) XML_Parse(parser->xmlp, NULL, 0, 1);
 
       XML_ParserFree(parser->xmlp);
+      parser->xmlp = NULL;
       add_done_item(parser);
     }
 
   /* For testing step 12, we have written all of the disk content. This
      will advance to step 13 and pause the parser again.  */
-  PBTEST_MAYBE_STEP(parser);
+  PBTEST_MAYBE_STEP(parser, TRUE);
 
   return SVN_NO_ERROR;
 }
@@ -1682,9 +1703,8 @@ svn_ra_serf__handle_xml_parser(serf_requ
       /* This is the first invocation. If we're looking at an update
          report, then move to step 1 of the testing sequence.  */
 #ifdef PBTEST_ACTIVE
-      if (ctx->response_type != NULL
-          && strcmp(ctx->response_type, "update-report") == 0)
-        PBTEST_MAYBE_STEP(ctx);
+      if (PBTEST_THIS_REQ(ctx))
+        PBTEST_MAYBE_STEP(ctx, TRUE);
 #endif
     }
 
@@ -1717,9 +1737,17 @@ svn_ra_serf__handle_xml_parser(serf_requ
       PBTEST_SET_PAUSED(ctx);
 
 #ifdef PBTEST_ACTIVE
-      SVN_DBG(("response: len=%d  paused=%d  status=%08x\n",
-               (int)len, ctx->paused, status));
-      SVN_DBG(("content=%s\n", data));
+      if (PBTEST_THIS_REQ(ctx))
+        {
+          SVN_DBG(("response: len=%d  paused=%d  status=%08x\n",
+                   (int)len, ctx->paused, status));
+#if 0
+          /* ### DATA is not necessarily NUL-terminated, but this
+             ### generally works. so if you want to see content... */
+          if (len > 0)
+            SVN_DBG(("content=%s\n", data));
+#endif
+        }
 #endif
 
       /* Note: once the callbacks invoked by inject_to_parser() sets the
@@ -1731,7 +1759,6 @@ svn_ra_serf__handle_xml_parser(serf_requ
          We want to save arriving content into the PENDING structures if
          the parser has been paused, or we already have data in there (so
          the arriving data is appended, rather than injected out of order)  */
-#ifdef PBTEST_ACTIVE
       if (ctx->paused || HAS_PENDING_DATA(ctx->pending))
         {
           err = write_to_pending(ctx, data, len, pool);
@@ -1741,10 +1768,9 @@ svn_ra_serf__handle_xml_parser(serf_requ
              Note: this only happens on writing to PENDING. If the
              parser is unpaused, then we will never change state within
              this network-reading loop.  */
-          PBTEST_MAYBE_STEP(ctx);
+          PBTEST_MAYBE_STEP(ctx, FALSE);
         }
       else
-#endif
         {
           err = inject_to_parser(ctx, data, len, &sl);
           if (err)
@@ -1755,7 +1781,10 @@ svn_ra_serf__handle_xml_parser(serf_requ
         }
       if (err)
         {
+          SVN_ERR_ASSERT(ctx->xmlp != NULL);
+
           XML_ParserFree(ctx->xmlp);
+          ctx->xmlp = NULL;
           add_done_item(ctx);
           return svn_error_trace(err);
         }
@@ -1770,14 +1799,27 @@ svn_ra_serf__handle_xml_parser(serf_requ
           if (ctx->pending != NULL)
             ctx->pending->network_eof = TRUE;
 
+#ifdef PBTEST_ACTIVE
+          if (PBTEST_THIS_REQ(ctx))
+            SVN_DBG(("network: reached EOF.\n"));
+#endif
+
           /* We just hit the end of the network content. If we have nothing
              in the PENDING structures, then we're completely done.  */
           if (!HAS_PENDING_DATA(ctx->pending))
             {
+#ifdef PBTEST_ACTIVE
+              if (PBTEST_THIS_REQ(ctx))
+                SVN_DBG(("network: terminating parse.\n"));
+#endif
+
+              SVN_ERR_ASSERT(ctx->xmlp != NULL);
+
               /* Ignore the return status. We just don't care.  */
               (void) XML_Parse(ctx->xmlp, NULL, 0, 1);
 
               XML_ParserFree(ctx->xmlp);
+              ctx->xmlp = NULL;
               add_done_item(ctx);
             }
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_repos/commit.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_repos/commit.c Thu Jul 28 21:58:49 2011
@@ -94,6 +94,9 @@ struct edit_baton
   /* The object representing the root directory of the svn txn. */
   svn_fs_root_t *txn_root;
 
+  /* Avoid aborting an fs transaction more than once */
+  svn_boolean_t txn_aborted;
+
   /** Filled in when the edit is closed: **/
 
   /* The new revision created by this commit. */
@@ -718,12 +721,13 @@ close_edit(void *edit_baton,
          So, in a nutshell: svn commits are an all-or-nothing deal.
          Each commit creates a new fs txn which either succeeds or is
          aborted completely.  No second chances;  the user simply
-         needs to update and commit again  :)
+         needs to update and commit again  :) */
+
+      eb->txn_aborted = TRUE;
 
-         We ignore the possible error result from svn_fs_abort_txn();
-         it's more important to return the original error. */
-      svn_error_clear(svn_fs_abort_txn(eb->txn, pool));
-      return svn_error_trace(err);
+      return svn_error_trace(
+                svn_error_compose_create(err,
+                                         svn_fs_abort_txn(eb->txn, pool)));
     }
 
   /* Pass new revision information to the caller's callback. */
@@ -769,9 +773,12 @@ abort_edit(void *edit_baton,
            apr_pool_t *pool)
 {
   struct edit_baton *eb = edit_baton;
-  if ((! eb->txn) || (! eb->txn_owner))
+  if ((! eb->txn) || (! eb->txn_owner) || eb->txn_aborted)
     return SVN_NO_ERROR;
-  return svn_fs_abort_txn(eb->txn, pool);
+
+  eb->txn_aborted = TRUE;
+
+  return svn_error_trace(svn_fs_abort_txn(eb->txn, pool));
 }
 
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_repos/hooks.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_repos/hooks.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_repos/hooks.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_repos/hooks.c Thu Jul 28 21:58:49 2011
@@ -202,7 +202,8 @@ run_hook_cmd(svn_string_t **result,
 
   if (err)
     {
-      err = svn_error_createf
+      /* CMD_PROC is not safe to use. Bail. */
+      return svn_error_createf
         (SVN_ERR_REPOS_HOOK_FAILURE, err, _("Failed to start '%s' hook"), cmd);
     }
   else
@@ -618,18 +619,9 @@ svn_repos__hooks_pre_lock(svn_repos_t *r
                            pool));
 
       if (token)
-        {
-          svn_error_t *err;
-          /* Convert hook output from native encoding to UTF-8. */
-          err = svn_utf_cstring_to_utf8(token, buf->data, pool);
-          if (err)
-            {
-              return svn_error_create(SVN_ERR_REPOS_HOOK_FAILURE, err,
-                                      _("Output of pre-lock hook could not be "
-                                        "translated from the native locale to "
-                                        "UTF-8."));
-            }
-        }
+        /* No validation here; the FS will take care of that. */
+        *token = buf->data;
+
     }
   else if (token)
     *token = "";

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/auth.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/auth.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/auth.c Thu Jul 28 21:58:49 2011
@@ -382,11 +382,10 @@ svn_auth_ssl_server_cert_info_dup
 }
 
 svn_error_t *
-svn_auth_get_platform_specific_provider
-  (svn_auth_provider_object_t **provider,
-   const char *provider_name,
-   const char *provider_type,
-   apr_pool_t *pool)
+svn_auth_get_platform_specific_provider(svn_auth_provider_object_t **provider,
+                                        const char *provider_name,
+                                        const char *provider_type,
+                                        apr_pool_t *pool)
 {
   *provider = NULL;
 
@@ -447,6 +446,13 @@ svn_auth_get_platform_specific_provider
     }
   else
     {
+#if defined(SVN_HAVE_GPG_AGENT)
+      if (strcmp(provider_name, "gpg_agent") == 0 &&
+          strcmp(provider_type, "simple") == 0)
+        {
+          svn_auth_get_gpg_agent_simple_provider(provider, pool);
+        }
+#endif
 #ifdef SVN_HAVE_KEYCHAIN_SERVICES
       if (strcmp(provider_name, "keychain") == 0 &&
           strcmp(provider_type, "simple") == 0)
@@ -483,27 +489,30 @@ svn_auth_get_platform_specific_provider
 }
 
 svn_error_t *
-svn_auth_get_platform_specific_client_providers
-  (apr_array_header_t **providers,
-   svn_config_t *config,
-   apr_pool_t *pool)
+svn_auth_get_platform_specific_client_providers(apr_array_header_t **providers,
+                                                svn_config_t *config,
+                                                apr_pool_t *pool)
 {
   svn_auth_provider_object_t *provider;
   const char *password_stores_config_option;
   apr_array_header_t *password_stores;
   int i;
 
+#define SVN__DEFAULT_AUTH_PROVIDER_LIST \
+         "gnome-keyring,kwallet,keychain,gpg-agent,windows-cryptoapi"
+
   if (config)
     {
-      svn_config_get(config,
-                     &password_stores_config_option,
-                     SVN_CONFIG_SECTION_AUTH,
-                     SVN_CONFIG_OPTION_PASSWORD_STORES,
-                     "gnome-keyring,kwallet,keychain,windows-cryptoapi");
+      svn_config_get
+        (config,
+         &password_stores_config_option,
+         SVN_CONFIG_SECTION_AUTH,
+         SVN_CONFIG_OPTION_PASSWORD_STORES,
+         SVN__DEFAULT_AUTH_PROVIDER_LIST);
     }
   else
     {
-      password_stores_config_option = "gnome-keyring,kwallet,keychain,windows-cryptoapi";
+      password_stores_config_option = SVN__DEFAULT_AUTH_PROVIDER_LIST;
     }
 
   *providers = apr_array_make(pool, 12, sizeof(svn_auth_provider_object_t *));
@@ -539,6 +548,20 @@ svn_auth_get_platform_specific_client_pr
           continue;
         }
 
+      /* GPG-AGENT */
+      if (apr_strnatcmp(password_store, "gpg-agent") == 0)
+        {
+          SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
+                                                          "gpg_agent",
+                                                          "simple",
+                                                          pool));
+
+          if (provider)
+            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
+
+          continue;
+        }
+
       /* KWallet */
       if (apr_strnatcmp(password_store, "kwallet") == 0)
         {

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/cmdline.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/cmdline.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/cmdline.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/cmdline.c Thu Jul 28 21:58:49 2011
@@ -459,8 +459,8 @@ svn_cmdline_create_auth_baton(svn_auth_b
   apr_array_header_t *providers;
 
   /* Populate the registered providers with the platform-specific providers */
-  SVN_ERR(svn_auth_get_platform_specific_client_providers
-            (&providers, cfg, pool));
+  SVN_ERR(svn_auth_get_platform_specific_client_providers(&providers,
+                                                          cfg, pool));
 
   /* If we have a cancellation function, cram it and the stuff it
      needs into the prompt baton. */

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/config_file.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/config_file.c Thu Jul 28 21:58:49 2011
@@ -954,6 +954,7 @@ svn_config_ensure(const char *config_dir
         "### Valid password stores:"                                         NL
         "###   gnome-keyring        (Unix-like systems)"                     NL
         "###   kwallet              (Unix-like systems)"                     NL
+        "###   gpg-agent            (Unix-like systems)"                     NL
         "###   keychain             (Mac OS X)"                              NL
         "###   windows-cryptoapi    (Windows)"                               NL
 #ifdef SVN_HAVE_KEYCHAIN_SERVICES
@@ -961,7 +962,7 @@ svn_config_ensure(const char *config_dir
 #elif defined(WIN32) && !defined(__MINGW32__)
         "# password-stores = windows-cryptoapi"                              NL
 #else
-        "# password-stores = gnome-keyring,kwallet"                          NL
+        "# password-stores = gpg-agent,gnome-keyring,kwallet"                NL
 #endif
         "### To disable all password stores, use an empty list:"             NL
         "# password-stores ="                                                NL

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/deprecated.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/deprecated.c Thu Jul 28 21:58:49 2011
@@ -1126,3 +1126,12 @@ svn_xml_make_header(svn_stringbuf_t **st
 {
   svn_xml_make_header2(str, NULL, pool);
 }
+
+svn_error_t *
+svn_rangelist_merge(apr_array_header_t **rangelist,
+                    const apr_array_header_t *changes,
+                    apr_pool_t *pool)
+{
+  return svn_error_trace(svn_rangelist_merge2(*rangelist, changes,
+                                              pool, pool));
+}

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/dso.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/dso.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/dso.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/dso.c Thu Jul 28 21:58:49 2011
@@ -105,9 +105,12 @@ svn_dso_load(apr_dso_handle_t **dso, con
       status = apr_dso_load(dso, fname, dso_pool);
       if (status)
         {
-#if 0
+#ifdef SVN_DEBUG_DSO
           char buf[1024];
-          fprintf(stderr, "%s\n", apr_dso_error(*dso, buf, 1024));
+          fprintf(stderr,
+                  "Dynamic loading of '%s' failed with the following error:\n%s\n",
+                  fname,
+                  apr_dso_error(*dso, buf, 1024));
 #endif
           *dso = NULL;
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/io.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/io.c Thu Jul 28 21:58:49 2011
@@ -2489,10 +2489,17 @@ svn_io_start_cmd2(apr_proc_t *cmd_proc,
 
   /* Forward request for pipes to APR. */
   if (infile_pipe || outfile_pipe || errfile_pipe)
-    apr_procattr_io_set(cmdproc_attr,
-                        infile_pipe ? APR_FULL_BLOCK : APR_NO_PIPE,
-                        outfile_pipe ? APR_FULL_BLOCK : APR_NO_PIPE,
-                        errfile_pipe ? APR_FULL_BLOCK : APR_NO_PIPE);
+    {
+      apr_err = apr_procattr_io_set(cmdproc_attr,
+                                    infile_pipe ? APR_FULL_BLOCK : APR_NO_PIPE,
+                                    outfile_pipe ? APR_FULL_BLOCK : APR_NO_PIPE,
+                                    errfile_pipe ? APR_FULL_BLOCK : APR_NO_PIPE);
+
+      if (apr_err)
+        return svn_error_wrap_apr(apr_err,
+                                  _("Can't set process '%s' stdio pipes"),
+                                  cmd);
+    }
 
   /* Have the child print any problems executing its program to errfile. */
   apr_err = apr_pool_userdata_set(errfile, ERRFILE_KEY, NULL, pool);

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/mergeinfo.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/mergeinfo.c Thu Jul 28 21:58:49 2011
@@ -37,6 +37,7 @@
 #include "private/svn_string_private.h"
 #include "svn_private_config.h"
 #include "svn_hash.h"
+#include "private/svn_dep_compat.h"
 
 /* Attempt to combine two ranges, IN1 and IN2. If they are adjacent or
    overlapping, and their inheritability allows them to be combined, put
@@ -671,7 +672,7 @@ parse_revision_line(const char **input, 
      absolute path key. */
   existing_rangelist = apr_hash_get(hash, pathname->data, APR_HASH_KEY_STRING);
   if (existing_rangelist)
-    SVN_ERR(svn_rangelist_merge(&rangelist, existing_rangelist, pool));
+    SVN_ERR(svn_rangelist_merge2(rangelist, existing_rangelist, pool, pool));
 
   apr_hash_set(hash, pathname->data, APR_HASH_KEY_STRING, rangelist);
 
@@ -707,23 +708,26 @@ svn_mergeinfo_parse(svn_mergeinfo_t *mer
   return err;
 }
 
-
 svn_error_t *
-svn_rangelist_merge(apr_array_header_t **rangelist,
-                    const apr_array_header_t *changes,
-                    apr_pool_t *pool)
+svn_rangelist_merge2(apr_array_header_t *rangelist,
+                     const apr_array_header_t *changes,
+                     apr_pool_t *result_pool,
+                     apr_pool_t *scratch_pool)
 {
   int i, j;
-  apr_array_header_t *output = apr_array_make(pool, 1,
-                                              sizeof(svn_merge_range_t *));
+  apr_array_header_t *original_rangelist;
+  
+  original_rangelist = apr_array_copy(scratch_pool, rangelist);
+  apr_array_clear(rangelist);
+
   i = 0;
   j = 0;
-  while (i < (*rangelist)->nelts && j < changes->nelts)
+  while (i < (original_rangelist)->nelts && j < changes->nelts)
     {
       svn_merge_range_t *elt1, *elt2;
       int res;
 
-      elt1 = APR_ARRAY_IDX(*rangelist, i, svn_merge_range_t *);
+      elt1 = APR_ARRAY_IDX(original_rangelist, i, svn_merge_range_t *);
       elt2 = APR_ARRAY_IDX(changes, j, svn_merge_range_t *);
 
       res = svn_sort_compare_ranges(&elt1, &elt2);
@@ -734,46 +738,45 @@ svn_rangelist_merge(apr_array_header_t *
              result. */
           if (elt1->inheritable || elt2->inheritable)
             elt1->inheritable = TRUE;
-          SVN_ERR(combine_with_lastrange(elt1, output,
-                                         TRUE, pool, pool));
+          SVN_ERR(combine_with_lastrange(elt1, rangelist, TRUE, result_pool,
+                                         scratch_pool));
           i++;
           j++;
         }
       else if (res < 0)
         {
-          SVN_ERR(combine_with_lastrange(elt1, output,
-                                         TRUE, pool, pool));
+          SVN_ERR(combine_with_lastrange(elt1, rangelist, TRUE, result_pool,
+                                         scratch_pool));
           i++;
         }
       else
         {
-          SVN_ERR(combine_with_lastrange(elt2, output,
-                                         TRUE, pool, pool));
+          SVN_ERR(combine_with_lastrange(elt2, rangelist, TRUE, result_pool,
+                                         scratch_pool));
           j++;
         }
     }
   /* Copy back any remaining elements.
      Only one of these loops should end up running, if anything. */
 
-  SVN_ERR_ASSERT(!(i < (*rangelist)->nelts && j < changes->nelts));
+  SVN_ERR_ASSERT(!(i < (original_rangelist)->nelts && j < changes->nelts));
 
-  for (; i < (*rangelist)->nelts; i++)
+  for (; i < (original_rangelist)->nelts; i++)
     {
-      svn_merge_range_t *elt = APR_ARRAY_IDX(*rangelist, i,
+      svn_merge_range_t *elt = APR_ARRAY_IDX(original_rangelist, i,
                                              svn_merge_range_t *);
-      SVN_ERR(combine_with_lastrange(elt, output,
-                                     TRUE, pool, pool));
+      SVN_ERR(combine_with_lastrange(elt, rangelist, TRUE, result_pool,
+                                     scratch_pool));
     }
 
 
   for (; j < changes->nelts; j++)
     {
       svn_merge_range_t *elt = APR_ARRAY_IDX(changes, j, svn_merge_range_t *);
-      SVN_ERR(combine_with_lastrange(elt, output,
-                                     TRUE, pool, pool));
+      SVN_ERR(combine_with_lastrange(elt, rangelist,
+                                     TRUE, result_pool, scratch_pool));
     }
 
-  *rangelist = output;
   return SVN_NO_ERROR;
 }
 
@@ -1297,6 +1300,7 @@ svn_mergeinfo_merge(svn_mergeinfo_t merg
 {
   apr_array_header_t *sorted1, *sorted2;
   int i, j;
+  apr_pool_t *iterpool;
 
   if (!apr_hash_count(changes))
     return SVN_NO_ERROR;
@@ -1306,11 +1310,14 @@ svn_mergeinfo_merge(svn_mergeinfo_t merg
 
   i = 0;
   j = 0;
+  iterpool = svn_pool_create(pool);
   while (i < sorted1->nelts && j < sorted2->nelts)
     {
       svn_sort__item_t elt1, elt2;
       int res;
 
+      svn_pool_clear(iterpool);
+
       elt1 = APR_ARRAY_IDX(sorted1, i, svn_sort__item_t);
       elt2 = APR_ARRAY_IDX(sorted2, j, svn_sort__item_t);
       res = svn_sort_compare_items_as_paths(&elt1, &elt2);
@@ -1322,8 +1329,7 @@ svn_mergeinfo_merge(svn_mergeinfo_t merg
           rl1 = elt1.value;
           rl2 = elt2.value;
 
-          SVN_ERR(svn_rangelist_merge(&rl1, rl2,
-                                      pool));
+          SVN_ERR(svn_rangelist_merge2(rl1, rl2, pool, iterpool));
           apr_hash_set(mergeinfo, elt1.key, elt1.klen, rl1);
           i++;
           j++;
@@ -1338,6 +1344,7 @@ svn_mergeinfo_merge(svn_mergeinfo_t merg
           j++;
         }
     }
+  svn_pool_destroy(iterpool);
 
   /* Copy back any remaining elements from the second hash. */
   for (; j < sorted2->nelts; j++)

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/simple_providers.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/simple_providers.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/simple_providers.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/simple_providers.c Thu Jul 28 21:58:49 2011
@@ -358,7 +358,8 @@ svn_auth__simple_save_creds_helper(svn_b
            (strcmp(passtype, SVN_AUTH__WINCRYPT_PASSWORD_TYPE) == 0
             || strcmp(passtype, SVN_AUTH__KEYCHAIN_PASSWORD_TYPE) == 0
             || strcmp(passtype, SVN_AUTH__KWALLET_PASSWORD_TYPE) == 0
-            || strcmp(passtype, SVN_AUTH__GNOME_KEYRING_PASSWORD_TYPE) == 0) )
+            || strcmp(passtype, SVN_AUTH__GNOME_KEYRING_PASSWORD_TYPE) == 0
+            || strcmp(passtype, SVN_AUTH__GPG_AGENT_PASSWORD_TYPE) == 0))
         {
           may_save_password = TRUE;
         }

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/subst.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/subst.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/subst.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/subst.c Thu Jul 28 21:58:49 2011
@@ -1267,15 +1267,16 @@ static svn_error_t *
 translated_stream_close(void *baton)
 {
   struct translated_stream_baton *b = baton;
+  svn_error_t *err = NULL;
 
   if (b->written)
-    SVN_ERR(translate_chunk(b->stream, b->out_baton, NULL, 0, b->iterpool));
+    err = translate_chunk(b->stream, b->out_baton, NULL, 0, b->iterpool);
 
-  SVN_ERR(svn_stream_close(b->stream));
+  err = svn_error_compose_create(err, svn_stream_close(b->stream));
 
   svn_pool_destroy(b->iterpool);
 
-  return SVN_NO_ERROR;
+  return svn_error_trace(err);
 }
 
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/svn_string.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/svn_string.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/svn_string.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/svn_string.c Thu Jul 28 21:58:49 2011
@@ -839,3 +839,16 @@ svn_cstring_atoi(int *n, const char *str
   *n = (int)val;
   return SVN_NO_ERROR;
 }
+
+
+apr_status_t
+svn__strtoff(apr_off_t *offset, const char *buf, char **end, int base)
+{
+#if !APR_VERSION_AT_LEAST(1,0,0)
+  errno = 0;
+  *offset = strtol(buf, end, base);
+  return APR_FROM_OS_ERROR(errno);
+#else
+  return apr_strtoff(offset, buf, end, base);
+#endif
+}

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/adm_crawler.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/adm_crawler.c Thu Jul 28 21:58:49 2011
@@ -124,9 +124,9 @@ svn_wc_restore(svn_wc_context_t *wc_ctx,
 
   if (status == svn_wc__db_status_added)
     SVN_ERR(svn_wc__db_scan_addition(&status, NULL, NULL, NULL, NULL, NULL,
-                                         NULL, NULL, NULL,
-                                         wc_ctx->db, local_abspath,
-                                         scratch_pool, scratch_pool));
+                                     NULL, NULL, NULL, NULL, NULL,
+                                     wc_ctx->db, local_abspath,
+                                     scratch_pool, scratch_pool));
 
   if (status != svn_wc__db_status_normal
       && status != svn_wc__db_status_copied
@@ -385,7 +385,7 @@ report_revisions_and_depths(svn_wc__db_t
           if (wrk_status == svn_wc__db_status_added)
             SVN_ERR(svn_wc__db_scan_addition(&wrk_status, NULL, NULL, NULL,
                                              NULL, NULL, NULL, NULL, NULL,
-                                             db, this_abspath,
+                                             NULL, NULL, db, this_abspath,
                                              iterpool, iterpool));
 
           if (wrk_status == svn_wc__db_status_normal
@@ -736,7 +736,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
 
       if (wrk_status == svn_wc__db_status_added)
         SVN_ERR(svn_wc__db_scan_addition(&wrk_status, NULL, NULL, NULL, NULL,
-                                         NULL, NULL, NULL, NULL,
+                                         NULL, NULL, NULL, NULL, NULL, NULL,
                                          db, local_abspath,
                                          scratch_pool, scratch_pool));
 
@@ -1112,21 +1112,12 @@ svn_wc__internal_transmit_text_deltas(co
                         NULL, NULL,
                         scratch_pool, scratch_pool);
 
-  /* Close the two streams to force writing the digest,
-     if we already have an error, ignore this one. */
-  if (err)
-    {
-      svn_error_clear(svn_stream_close(base_stream));
-      svn_error_clear(svn_stream_close(local_stream));
-    }
-  else
-    {
-      SVN_ERR(svn_stream_close(base_stream));
-      SVN_ERR(svn_stream_close(local_stream));
-    }
+  /* Close the two streams to force writing the digest */
+  err = svn_error_compose_create(err, svn_stream_close(base_stream));
+  err = svn_error_compose_create(err, svn_stream_close(local_stream));
 
-  /* If we have an error, it may be caused by a corrupt text base.
-     Check the checksum and discard `err' if they don't match. */
+  /* If we have an error, it may be caused by a corrupt text base,
+     so check the checksum. */
   if (expected_md5_checksum && verify_checksum
       && !svn_checksum_match(expected_md5_checksum, verify_checksum))
     {
@@ -1142,19 +1133,20 @@ svn_wc__internal_transmit_text_deltas(co
          investigate.  Other commands could be affected,
          too, such as `svn diff'.  */
 
-      /* Deliberately ignore errors; the error about the
-         checksum mismatch is more important to return. */
-      svn_error_clear(err);
       if (tempfile)
-        svn_error_clear(svn_io_remove_file2(*tempfile, TRUE, scratch_pool));
+        err = svn_error_compose_create(
+                      err,
+                      svn_io_remove_file2(*tempfile, TRUE, scratch_pool));
 
-      return svn_error_create(SVN_ERR_WC_CORRUPT_TEXT_BASE,
-            svn_checksum_mismatch_err(expected_md5_checksum, verify_checksum,
+      err = svn_error_compose_create(
+              svn_checksum_mismatch_err(expected_md5_checksum, verify_checksum,
                             scratch_pool,
                             _("Checksum mismatch for text base of '%s'"),
                             svn_dirent_local_style(local_abspath,
                                                    scratch_pool)),
-            NULL);
+              err);
+
+      return svn_error_create(SVN_ERR_WC_CORRUPT_TEXT_BASE, err, NULL);
     }
 
   /* Now, handle that delta transmission error if any, so we can stop

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/adm_files.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/adm_files.c Thu Jul 28 21:58:49 2011
@@ -484,8 +484,8 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
                                              &db_repos_relpath,
                                              &db_repos_root_url,
                                              &db_repos_uuid,
-                                             NULL, NULL, NULL, NULL,
-                                             db, local_abspath,
+                                             NULL, NULL, NULL, NULL, NULL,
+                                             NULL, db, local_abspath,
                                              scratch_pool, scratch_pool));
           else
             SVN_ERR(svn_wc__db_scan_base_repos(&db_repos_relpath,

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/adm_ops.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/adm_ops.c Thu Jul 28 21:58:49 2011
@@ -595,15 +595,16 @@ erase_unversioned_from_wc(const char *pa
 
 
 svn_error_t *
-svn_wc_delete4(svn_wc_context_t *wc_ctx,
-               const char *local_abspath,
-               svn_boolean_t keep_local,
-               svn_boolean_t delete_unversioned_target,
-               svn_cancel_func_t cancel_func,
-               void *cancel_baton,
-               svn_wc_notify_func2_t notify_func,
-               void *notify_baton,
-               apr_pool_t *scratch_pool)
+svn_wc__delete_internal(svn_wc_context_t *wc_ctx,
+                        const char *local_abspath,
+                        svn_boolean_t keep_local,
+                        svn_boolean_t delete_unversioned_target,
+                        const char *moved_to_abspath,
+                        svn_cancel_func_t cancel_func,
+                        void *cancel_baton,
+                        svn_wc_notify_func2_t notify_func,
+                        void *notify_baton,
+                        apr_pool_t *scratch_pool)
 {
   apr_pool_t *pool = scratch_pool;
   svn_wc__db_t *db = wc_ctx->db;
@@ -670,7 +671,7 @@ svn_wc_delete4(svn_wc_context_t *wc_ctx,
     SVN_ERR(svn_wc__db_read_conflicts(&conflicts, db, local_abspath,
                                       scratch_pool, scratch_pool));
 
-  SVN_ERR(svn_wc__db_op_delete(db, local_abspath,
+  SVN_ERR(svn_wc__db_op_delete(db, local_abspath, moved_to_abspath,
                                notify_func, notify_baton,
                                cancel_func, cancel_baton,
                                pool));
@@ -726,6 +727,26 @@ svn_wc_delete4(svn_wc_context_t *wc_ctx,
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_wc_delete4(svn_wc_context_t *wc_ctx,
+               const char *local_abspath,
+               svn_boolean_t keep_local,
+               svn_boolean_t delete_unversioned_target,
+               svn_cancel_func_t cancel_func,
+               void *cancel_baton,
+               svn_wc_notify_func2_t notify_func,
+               void *notify_baton,
+               apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(svn_wc__delete_internal(wc_ctx, local_abspath,
+                                                 keep_local,
+                                                 delete_unversioned_target,
+                                                 NULL,
+                                                 cancel_func, cancel_baton,
+                                                 notify_func, notify_baton,
+                                                 scratch_pool));
+}
+
 
 /* Schedule the single node at LOCAL_ABSPATH, of kind KIND, for addition in
  * its parent directory in the WC.  It will have no properties. */
@@ -813,7 +834,7 @@ check_can_add_to_parent(const char **rep
       if (parent_status == svn_wc__db_status_added)
         SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
                                          repos_root_url, repos_uuid, NULL,
-                                         NULL, NULL, NULL,
+                                         NULL, NULL, NULL, NULL, NULL,
                                          db, parent_abspath,
                                          result_pool, scratch_pool));
       else
@@ -1389,8 +1410,6 @@ revert_restore(svn_wc__db_t *db,
       else if (on_disk == svn_node_file)
         {
           svn_boolean_t modified;
-          svn_boolean_t executable;
-          svn_boolean_t read_only;
           apr_hash_t *props;
 #ifdef HAVE_SYMLINK
           svn_string_t *special_prop;
@@ -1438,11 +1457,6 @@ revert_restore(svn_wc__db_t *db,
                                                          db, local_abspath,
                                                          TRUE, scratch_pool));
 
-              SVN_ERR(svn_io__is_finfo_executable(&executable, &finfo,
-                                                  scratch_pool));
-              SVN_ERR(svn_io__is_finfo_read_only(&read_only, &finfo,
-                                                 scratch_pool));
-
               if (modified)
                 {
                   SVN_ERR(svn_io_remove_file2(local_abspath, FALSE,
@@ -1451,10 +1465,12 @@ revert_restore(svn_wc__db_t *db,
                 }
               else
                 {
+                  svn_boolean_t read_only;
                   svn_string_t *needs_lock_prop;
-#if !defined(WIN32) && !defined(__OS2__)
-                  svn_string_t *executable_prop;
-#endif
+
+                  SVN_ERR(svn_io__is_finfo_read_only(&read_only, &finfo,
+                                                     scratch_pool));
+
                   needs_lock_prop = apr_hash_get(props, SVN_PROP_NEEDS_LOCK,
                                                  APR_HASH_KEY_STRING);
                   if (needs_lock_prop && !read_only)
@@ -1471,19 +1487,31 @@ revert_restore(svn_wc__db_t *db,
                     }
 
 #if !defined(WIN32) && !defined(__OS2__)
-                  executable_prop = apr_hash_get(props, SVN_PROP_EXECUTABLE,
-                                                 APR_HASH_KEY_STRING);
-                  if (executable_prop && !executable)
-                    {
-                      SVN_ERR(svn_io_set_file_executable(local_abspath, TRUE,
-                                                         FALSE, scratch_pool));
-                      notify_required = TRUE;
-                    }
-                  else if (!executable_prop && executable)
+#ifdef HAVE_SYMLINK
+                  if (!special)
+#endif
                     {
-                      SVN_ERR(svn_io_set_file_executable(local_abspath, FALSE,
-                                                         FALSE, scratch_pool));
-                      notify_required = TRUE;
+                      svn_boolean_t executable;
+                      svn_string_t *executable_prop;
+
+                      SVN_ERR(svn_io__is_finfo_executable(&executable, &finfo,
+                                                          scratch_pool));
+                      executable_prop = apr_hash_get(props, SVN_PROP_EXECUTABLE,
+                                                     APR_HASH_KEY_STRING);
+                      if (executable_prop && !executable)
+                        {
+                          SVN_ERR(svn_io_set_file_executable(local_abspath,
+                                                             TRUE, FALSE,
+                                                             scratch_pool));
+                          notify_required = TRUE;
+                        }
+                      else if (!executable_prop && executable)
+                        {
+                          SVN_ERR(svn_io_set_file_executable(local_abspath,
+                                                             FALSE, FALSE,
+                                                             scratch_pool));
+                          notify_required = TRUE;
+                        }
                     }
 #endif
                 }
@@ -1574,15 +1602,15 @@ revert_restore(svn_wc__db_t *db,
 /* Revert tree LOCAL_ABSPATH to depth DEPTH and notify for all
    reverts. */
 static svn_error_t *
-new_revert_internal(svn_wc__db_t *db,
-                    const char *local_abspath,
-                    svn_depth_t depth,
-                    svn_boolean_t use_commit_times,
-                    svn_cancel_func_t cancel_func,
-                    void *cancel_baton,
-                    svn_wc_notify_func2_t notify_func,
-                    void *notify_baton,
-                    apr_pool_t *scratch_pool)
+revert_internal(svn_wc__db_t *db,
+                const char *local_abspath,
+                svn_depth_t depth,
+                svn_boolean_t use_commit_times,
+                svn_cancel_func_t cancel_func,
+                void *cancel_baton,
+                svn_wc_notify_func2_t notify_func,
+                void *notify_baton,
+                apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
 
@@ -1624,16 +1652,16 @@ new_revert_internal(svn_wc__db_t *db,
 /* Revert files in LOCAL_ABSPATH to depth DEPTH that match
    CHANGELIST_HASH and notify for all reverts. */
 static svn_error_t *
-new_revert_changelist(svn_wc__db_t *db,
-                      const char *local_abspath,
-                      svn_depth_t depth,
-                      svn_boolean_t use_commit_times,
-                      apr_hash_t *changelist_hash,
-                      svn_cancel_func_t cancel_func,
-                      void *cancel_baton,
-                      svn_wc_notify_func2_t notify_func,
-                      void *notify_baton,
-                      apr_pool_t *scratch_pool)
+revert_changelist(svn_wc__db_t *db,
+                  const char *local_abspath,
+                  svn_depth_t depth,
+                  svn_boolean_t use_commit_times,
+                  apr_hash_t *changelist_hash,
+                  svn_cancel_func_t cancel_func,
+                  void *cancel_baton,
+                  svn_wc_notify_func2_t notify_func,
+                  void *notify_baton,
+                  apr_pool_t *scratch_pool)
 {
   apr_pool_t *iterpool;
   const apr_array_header_t *children;
@@ -1645,11 +1673,11 @@ new_revert_changelist(svn_wc__db_t *db,
   /* Revert this node (depth=empty) if it matches one of the changelists.  */
   if (svn_wc__internal_changelist_match(db, local_abspath, changelist_hash,
                                         scratch_pool))
-    SVN_ERR(new_revert_internal(db, local_abspath,
-                                svn_depth_empty, use_commit_times,
-                                cancel_func, cancel_baton,
-                                notify_func, notify_baton,
-                                scratch_pool));
+    SVN_ERR(revert_internal(db, local_abspath,
+                            svn_depth_empty, use_commit_times,
+                            cancel_func, cancel_baton,
+                            notify_func, notify_baton,
+                            scratch_pool));
 
   if (depth == svn_depth_empty)
     return SVN_NO_ERROR;
@@ -1679,11 +1707,11 @@ new_revert_changelist(svn_wc__db_t *db,
                                                     const char *),
                                       iterpool);
 
-      SVN_ERR(new_revert_changelist(db, child_abspath, depth,
-                                    use_commit_times, changelist_hash,
-                                    cancel_func, cancel_baton,
-                                    notify_func, notify_baton,
-                                    iterpool));
+      SVN_ERR(revert_changelist(db, child_abspath, depth,
+                                use_commit_times, changelist_hash,
+                                cancel_func, cancel_baton,
+                                notify_func, notify_baton,
+                                iterpool));
     }
 
   svn_pool_destroy(iterpool);
@@ -1701,15 +1729,15 @@ new_revert_changelist(svn_wc__db_t *db,
    ### the non-recursive revert on the dir will fail.  Not sure how a
    ### partially recursive revert should handle actual-only nodes. */
 static svn_error_t *
-new_revert_partial(svn_wc__db_t *db,
-                   const char *local_abspath,
-                   svn_depth_t depth,
-                   svn_boolean_t use_commit_times,
-                   svn_cancel_func_t cancel_func,
-                   void *cancel_baton,
-                   svn_wc_notify_func2_t notify_func,
-                   void *notify_baton,
-                   apr_pool_t *scratch_pool)
+revert_partial(svn_wc__db_t *db,
+               const char *local_abspath,
+               svn_depth_t depth,
+               svn_boolean_t use_commit_times,
+               svn_cancel_func_t cancel_func,
+               void *cancel_baton,
+               svn_wc_notify_func2_t notify_func,
+               void *notify_baton,
+               apr_pool_t *scratch_pool)
 {
   apr_pool_t *iterpool;
   const apr_array_header_t *children;
@@ -1724,9 +1752,9 @@ new_revert_partial(svn_wc__db_t *db,
 
   /* Revert the root node itself (depth=empty), then move on to the
      children.  */
-  SVN_ERR(new_revert_internal(db, local_abspath, svn_depth_empty,
-                              use_commit_times, cancel_func, cancel_baton,
-                              notify_func, notify_baton, iterpool));
+  SVN_ERR(revert_internal(db, local_abspath, svn_depth_empty,
+                          use_commit_times, cancel_func, cancel_baton,
+                          notify_func, notify_baton, iterpool));
 
   SVN_ERR(svn_wc__db_read_children_of_working_node(&children, db,
                                                    local_abspath,
@@ -1754,11 +1782,11 @@ new_revert_partial(svn_wc__db_t *db,
         }
 
       /* Revert just this node (depth=empty).  */
-      SVN_ERR(new_revert_internal(db, child_abspath,
-                                  svn_depth_empty, use_commit_times,
-                                  cancel_func, cancel_baton,
-                                  notify_func, notify_baton,
-                                  iterpool));
+      SVN_ERR(revert_internal(db, child_abspath,
+                              svn_depth_empty, use_commit_times,
+                              cancel_func, cancel_baton,
+                              notify_func, notify_baton,
+                              iterpool));
     }
 
   svn_pool_destroy(iterpool);
@@ -1785,20 +1813,20 @@ svn_wc_revert4(svn_wc_context_t *wc_ctx,
 
       SVN_ERR(svn_hash_from_cstring_keys(&changelist_hash, changelist_filter,
                                          scratch_pool));
-      return svn_error_trace(new_revert_changelist(wc_ctx->db, local_abspath,
-                                                   depth, use_commit_times,
-                                                   changelist_hash,
-                                                   cancel_func, cancel_baton,
-                                                   notify_func, notify_baton,
-                                                   scratch_pool));
-    }
-
-  if (depth == svn_depth_empty || depth == svn_depth_infinity)
-    return svn_error_trace(new_revert_internal(wc_ctx->db, local_abspath,
+      return svn_error_trace(revert_changelist(wc_ctx->db, local_abspath,
                                                depth, use_commit_times,
+                                               changelist_hash,
                                                cancel_func, cancel_baton,
                                                notify_func, notify_baton,
                                                scratch_pool));
+    }
+
+  if (depth == svn_depth_empty || depth == svn_depth_infinity)
+    return svn_error_trace(revert_internal(wc_ctx->db, local_abspath,
+                                           depth, use_commit_times,
+                                           cancel_func, cancel_baton,
+                                           notify_func, notify_baton,
+                                           scratch_pool));
 
   /* The user may expect svn_depth_files/svn_depth_immediates to work
      on copied dirs with one level of children.  It doesn't, the user
@@ -1807,11 +1835,11 @@ svn_wc_revert4(svn_wc_context_t *wc_ctx,
      revert too much we could invoke the recursive call above. */
 
   if (depth == svn_depth_files || depth == svn_depth_immediates)
-    return svn_error_trace(new_revert_partial(wc_ctx->db, local_abspath,
-                                              depth, use_commit_times,
-                                              cancel_func, cancel_baton,
-                                              notify_func, notify_baton,
-                                              scratch_pool));
+    return svn_error_trace(revert_partial(wc_ctx->db, local_abspath,
+                                          depth, use_commit_times,
+                                          cancel_func, cancel_baton,
+                                          notify_func, notify_baton,
+                                          scratch_pool));
 
   /* Bogus depth. Tell the caller.  */
   return svn_error_create(SVN_ERR_WC_INVALID_OPERATION_DEPTH, NULL, NULL);

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/conflicts.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/conflicts.c Thu Jul 28 21:58:49 2011
@@ -215,7 +215,6 @@ resolve_conflict_on_node(svn_wc__db_t *d
 
   if (resolve_text)
     {
-      svn_stream_t *tmp_stream = NULL;
       const char *auto_resolve_src;
 
       /* Handle automatic conflict resolution before the temporary files are
@@ -240,6 +239,7 @@ resolve_conflict_on_node(svn_wc__db_t *d
             if (conflict_old && conflict_working && conflict_new)
               {
                 const char *temp_dir;
+                svn_stream_t *tmp_stream = NULL;
                 svn_diff_t *diff;
                 svn_diff_conflict_display_style_t style =
                   conflict_choice == svn_wc_conflict_choose_theirs_conflict
@@ -252,7 +252,7 @@ resolve_conflict_on_node(svn_wc__db_t *d
                 SVN_ERR(svn_stream_open_unique(&tmp_stream,
                                                &auto_resolve_src,
                                                temp_dir,
-                                               svn_io_file_del_on_close,
+                                               svn_io_file_del_on_pool_cleanup,
                                                pool, pool));
 
                 SVN_ERR(svn_diff_file_diff3_2(&diff,
@@ -269,6 +269,7 @@ resolve_conflict_on_node(svn_wc__db_t *d
                                                     NULL, NULL, NULL, NULL,
                                                     style,
                                                     pool));
+                SVN_ERR(svn_stream_close(tmp_stream));
               }
             else
               auto_resolve_src = NULL;
@@ -283,9 +284,6 @@ resolve_conflict_on_node(svn_wc__db_t *d
         SVN_ERR(svn_io_copy_file(
           svn_dirent_join(conflict_dir_abspath, auto_resolve_src, pool),
           local_abspath, TRUE, pool));
-
-      if (tmp_stream)
-        SVN_ERR(svn_stream_close(tmp_stream));
     }
 
   /* Records whether we found any of the conflict files.  */



Mime
View raw message