You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2016/06/05 15:03:54 UTC

svn commit: r1746927 [5/8] - in /subversion/branches/authzperf: ./ build/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib/server-side/ contrib/server-side/fsfsfixer/fixer/ notes/directory-index/ notes/move-tracking/ sub...

Modified: subversion/branches/authzperf/subversion/libsvn_fs_x/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_x/temp_serializer.c?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_x/temp_serializer.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_x/temp_serializer.c Sun Jun  5 15:03:52 2016
@@ -680,7 +680,7 @@ svn_fs_x__deserialize_node_revision(void
 
 /* Utility function that returns the directory serialized inside CONTEXT
  * to DATA and DATA_LEN.  If OVERPROVISION is set, allocate some extra
- * room for future in-place changes by svn_fs_fs__replace_dir_entry. */
+ * room for future in-place changes by svn_fs_x__replace_dir_entry. */
 static svn_error_t *
 return_serialized_dir_context(svn_temp_serializer__context_t *context,
                               void **data,
@@ -1126,47 +1126,29 @@ deserialize_change(void *buffer,
   svn_temp_deserializer__resolve(change, (void **)&change->copyfrom_path);
 }
 
-/* Auxiliary structure representing the content of a svn_fs_x__change_t array.
-   This structure is much easier to (de-)serialize than an APR array.
- */
-typedef struct changes_data_t
-{
-  /* number of entries in the array */
-  int count;
-
-  /* reference to the changes */
-  svn_fs_x__change_t **changes;
-} changes_data_t;
-
 svn_error_t *
 svn_fs_x__serialize_changes(void **data,
                             apr_size_t *data_len,
                             void *in,
                             apr_pool_t *pool)
 {
-  apr_array_header_t *array = in;
-  changes_data_t changes;
+  svn_fs_x__changes_list_t *changes = in;
   svn_temp_serializer__context_t *context;
   svn_stringbuf_t *serialized;
   int i;
 
-  /* initialize our auxiliary data structure and link it to the
-   * array elements */
-  changes.count = array->nelts;
-  changes.changes = (svn_fs_x__change_t **)array->elts;
-
   /* serialize it and all its elements */
-  context = svn_temp_serializer__init(&changes,
-                                      sizeof(changes),
-                                      changes.count * 250,
+  context = svn_temp_serializer__init(changes,
+                                      sizeof(*changes),
+                                      changes->count * 250,
                                       pool);
 
   svn_temp_serializer__push(context,
-                            (const void * const *)&changes.changes,
-                            changes.count * sizeof(*changes.changes));
+                            (const void * const *)&changes->changes,
+                            changes->count * sizeof(*changes->changes));
 
-  for (i = 0; i < changes.count; ++i)
-    serialize_change(context, &changes.changes[i]);
+  for (i = 0; i < changes->count; ++i)
+    serialize_change(context, &changes->changes[i]);
 
   svn_temp_serializer__pop(context);
 
@@ -1186,9 +1168,7 @@ svn_fs_x__deserialize_changes(void **out
                               apr_pool_t *result_pool)
 {
   int i;
-  changes_data_t *changes = (changes_data_t *)data;
-  apr_array_header_t *array = apr_array_make(result_pool, 0,
-                                             sizeof(svn_fs_x__change_t *));
+  svn_fs_x__changes_list_t *changes = (svn_fs_x__changes_list_t *)data;
 
   /* de-serialize our auxiliary data structure */
   svn_temp_deserializer__resolve(changes, (void**)&changes->changes);
@@ -1198,69 +1178,8 @@ svn_fs_x__deserialize_changes(void **out
     deserialize_change(changes->changes,
                        (svn_fs_x__change_t **)&changes->changes[i]);
 
-  /* Use the changes buffer as the array's data buffer
-   * (DATA remains valid for at least as long as POOL). */
-  array->elts = (char *)changes->changes;
-  array->nelts = changes->count;
-  array->nalloc = changes->count;
-
-  /* done */
-  *out = array;
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_fs_x__read_changes_block(void **out,
-                             const void *data,
-                             apr_size_t data_len,
-                             void *baton,
-                             apr_pool_t *pool)
-{
-  int first;
-  int last;
-  int i;
-  enum { BLOCK_SIZE = 100 };
-  apr_array_header_t *array;
-
-  svn_fs_x__read_changes_block_baton_t *b = baton;
-  changes_data_t changes = *(const changes_data_t *)data;
-
-  /* Restrict range to the block requested by the BATON.
-   * Tell the caller whether we reached the end of the list. */
-  first = MIN(b->start, changes.count);
-  last = MIN(first + BLOCK_SIZE, changes.count);
-  *b->eol = last == changes.count;
-
-  /* de-serialize our auxiliary data structure */
-  svn_temp_deserializer__resolve(data, (void**)&changes.changes);
-
-  /* de-serialize each entry and add it to the array */
-  array = apr_array_make(pool, last - first, sizeof(svn_fs_x__change_t *));
-  for (i = first; i < last; ++i)
-    {
-      svn_fs_x__change_t *change;
-
-      /* Get a pointer to the in-cache change struct at offset I. */
-      svn_fs_x__change_t *cached_change = changes.changes[i];
-      svn_temp_deserializer__resolve(changes.changes,
-                                     (void**)&cached_change);
-
-      /* Duplicate that struct into the result POOL. */
-      change = apr_pmemdup(pool, cached_change, sizeof(*change));
-
-      /* fix-up of pointers within the struct */
-      svn_temp_deserializer__resolve(cached_change,
-                                     (void **)&change->path.data);
-      svn_temp_deserializer__resolve(cached_change,
-                                     (void **)&change->copyfrom_path);
-
-      /* Add the change to result. */
-      APR_ARRAY_PUSH(array, svn_fs_x__change_t *) = change;
-    }
-
   /* done */
-  *out = array;
+  *out = changes;
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/authzperf/subversion/libsvn_fs_x/temp_serializer.h
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_x/temp_serializer.h?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_x/temp_serializer.h (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_x/temp_serializer.h Sun Jun  5 15:03:52 2016
@@ -266,9 +266,34 @@ svn_fs_x__deserialize_rep_header(void **
                                  apr_size_t data_len,
                                  apr_pool_t *result_pool);
 
+/*** Block of changes in a changed paths list. */
+typedef struct svn_fs_x__changes_list_t
+{
+  /* Offset of the first element in CHANGES within the changed paths list
+     on disk. */
+  apr_off_t start_offset;
+
+  /* Offset of the first element behind CHANGES within the changed paths
+     list on disk. */
+  apr_off_t end_offset;
+
+  /* End of list reached? This may have false negatives in case the number
+     of elements in the list is a multiple of our block / range size. */
+  svn_boolean_t eol;
+
+  /* Array of #svn_fs_x__change_t * representing a consecutive sub-range of
+     elements in a changed paths list. */
+
+  /* number of entries in the array */
+  int count;
+
+  /* reference to the changes */
+  svn_fs_x__change_t **changes;
+
+} svn_fs_x__changes_list_t;
+
 /**
- * Implements #svn_cache__serialize_func_t for an #apr_array_header_t of
- * #svn_fs_x__change_t *.
+ * Implements #svn_cache__serialize_func_t for a #svn_fs_x__changes_list_t.
  */
 svn_error_t *
 svn_fs_x__serialize_changes(void **data,
@@ -277,8 +302,7 @@ svn_fs_x__serialize_changes(void **data,
                             apr_pool_t *pool);
 
 /**
- * Implements #svn_cache__deserialize_func_t for an #apr_array_header_t of
- * #svn_fs_x__change_t *.
+ * Implements #svn_cache__deserialize_func_t for a #svn_fs_x__changes_list_t.
  */
 svn_error_t *
 svn_fs_x__deserialize_changes(void **out,
@@ -286,28 +310,4 @@ svn_fs_x__deserialize_changes(void **out
                               apr_size_t data_len,
                               apr_pool_t *result_pool);
 
-/* Baton type to be used with svn_fs_x__read_changes_block. */
-typedef struct svn_fs_x__read_changes_block_baton_t
-{
-  /* Deliver data starting from this index within the changes list. */
-  int start;
-
-  /* To be set by svn_fs_x__read_changes_block:
-     Did we deliver the last change in that list? */
-  svn_boolean_t *eol;
-} svn_fs_x__read_changes_block_baton_t;
-
-/**
- * Implements #svn_cache__partial_getter_func_t, returning a number of
- * #svn_fs_x__change_t * in an #apr_array_header_t.  The @a *baton of type
- * 'svn_fs_x__read_changes_block_baton_t describes what the first index
- * in that block should be.
- */
-svn_error_t *
-svn_fs_x__read_changes_block(void **out,
-                             const void *data,
-                             apr_size_t data_len,
-                             void *baton,
-                             apr_pool_t *pool);
-
 #endif

Modified: subversion/branches/authzperf/subversion/libsvn_fs_x/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_x/transaction.c?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_x/transaction.c Sun Jun  5 15:03:52 2016
@@ -3730,7 +3730,8 @@ commit_body(void *baton,
 
   /* Use this to force all data to be flushed to physical storage
      (to the degree our environment will allow). */
-  SVN_ERR(svn_fs_x__batch_fsync_create(&batch, scratch_pool));
+  SVN_ERR(svn_fs_x__batch_fsync_create(&batch, ffd->flush_to_disk,
+                                       scratch_pool));
 
   /* Set up the target directory. */
   SVN_ERR(auto_create_shard(cb->fs, new_rev, batch, subpool));
@@ -3862,6 +3863,8 @@ svn_fs_x__commit(svn_revnum_t *new_rev_p
 
   if (ffd->rep_sharing_allowed)
     {
+      svn_error_t *err;
+
       SVN_ERR(svn_fs_x__open_rep_cache(fs, scratch_pool));
 
       /* Write new entries to the rep-sharing database.
@@ -3872,9 +3875,21 @@ svn_fs_x__commit(svn_revnum_t *new_rev_p
       /* ### A commit that touches thousands of files will starve other
              (reader/writer) commits for the duration of the below call.
              Maybe write in batches? */
-      SVN_SQLITE__WITH_TXN(
-        write_reps_to_cache(fs, cb.reps_to_cache, scratch_pool),
-        ffd->rep_cache_db);
+      SVN_ERR(svn_sqlite__begin_transaction(ffd->rep_cache_db));
+      err = write_reps_to_cache(fs, cb.reps_to_cache, scratch_pool);
+      err = svn_sqlite__finish_transaction(ffd->rep_cache_db, err);
+
+      if (svn_error_find_cause(err, SVN_ERR_SQLITE_ROLLBACK_FAILED))
+        {
+          /* Failed rollback means that our db connection is unusable, and
+             the only thing we can do is close it.  The connection will be
+             reopened during the next operation with rep-cache.db. */
+          return svn_error_trace(
+              svn_error_compose_create(err,
+                                       svn_fs_x__close_rep_cache(fs)));
+        }
+      else if (err)
+        return svn_error_trace(err);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/authzperf/subversion/libsvn_fs_x/transaction.h
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_x/transaction.h?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_x/transaction.h (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_x/transaction.h Sun Jun  5 15:03:52 2016
@@ -64,8 +64,8 @@ svn_fs_x__with_txn_current_lock(svn_fs_t
    call BODY with BATON and that subpool, destroy the subpool (releasing
    the locks) and return what BODY returned.
 
-   This combines svn_fs_fs__with_write_lock, svn_fs_fs__with_pack_lock,
-   and svn_fs_fs__with_txn_current_lock, ensuring correct lock ordering. */
+   This combines svn_fs_x__with_write_lock, svn_fs_x__with_pack_lock,
+   and svn_fs_x__with_txn_current_lock, ensuring correct lock ordering. */
 svn_error_t *
 svn_fs_x__with_all_locks(svn_fs_t *fs,
                          svn_error_t *(*body)(void *baton,

Modified: subversion/branches/authzperf/subversion/libsvn_fs_x/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_x/util.c?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_x/util.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_x/util.c Sun Jun  5 15:03:52 2016
@@ -535,6 +535,7 @@ svn_fs_x__write_min_unpacked_rev(svn_fs_
                                  svn_revnum_t revnum,
                                  apr_pool_t *scratch_pool)
 {
+  svn_fs_x__data_t *ffd = fs->fsap_data;
   const char *final_path;
   char buf[SVN_INT64_BUFFER_SIZE];
   apr_size_t len = svn__i64toa(buf, revnum);
@@ -543,8 +544,8 @@ svn_fs_x__write_min_unpacked_rev(svn_fs_
   final_path = svn_fs_x__path_min_unpacked_rev(fs, scratch_pool);
 
   SVN_ERR(svn_io_write_atomic2(final_path, buf, len + 1,
-                               final_path /* copy_perms */, TRUE,
-                               scratch_pool));
+                               final_path /* copy_perms */,
+                               ffd->flush_to_disk, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -567,7 +568,7 @@ svn_fs_x__read_current(svn_revnum_t *rev
   return SVN_NO_ERROR;
 }
 
-/* Atomically update the 'current' file to hold the specifed REV.
+/* Atomically update the 'current' file to hold the specified REV.
    Perform temporary allocations in SCRATCH_POOL. */
 svn_error_t *
 svn_fs_x__write_current(svn_fs_t *fs,

Modified: subversion/branches/authzperf/subversion/libsvn_fs_x/util.h
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_x/util.h?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_x/util.h (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_x/util.h Sun Jun  5 15:03:52 2016
@@ -369,7 +369,7 @@ svn_fs_x__check_file_buffer_numeric(cons
                                     apr_pool_t *scratch_pool);
 
 /* Set *MIN_UNPACKED_REV to the integer value read from the file returned
- * by #svn_fs_fs__path_min_unpacked_rev() for FS.
+ * by #svn_fs_x__path_min_unpacked_rev() for FS.
  * Use SCRATCH_POOL for temporary allocations.
  */
 svn_error_t *
@@ -449,7 +449,7 @@ svn_fs_x__read_number_from_stream(apr_in
    Temporary allocations are from SCRATCH_POOL.
 
    This function almost duplicates svn_io_file_move(), but it tries to
-   guarantee a flush. */
+   guarantee a flush if BATCH->FLUSH_TO_DISK is non-zero. */
 svn_error_t *
 svn_fs_x__move_into_place(const char *old_filename,
                           const char *new_filename,

Modified: subversion/branches/authzperf/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_ra_local/ra_plugin.c?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_ra_local/ra_plugin.c Sun Jun  5 15:03:52 2016
@@ -1134,19 +1134,19 @@ svn_ra_local__get_log(svn_ra_session_t *
   receiver = log_receiver_wrapper;
   receiver_baton = &lb;
 
-  return svn_repos_get_logs4(sess->repos,
-                             abs_paths,
-                             start,
-                             end,
-                             limit,
-                             discover_changed_paths,
-                             strict_node_history,
-                             include_merged_revisions,
-                             revprops,
-                             NULL, NULL,
-                             receiver,
-                             receiver_baton,
-                             pool);
+  return svn_repos__get_logs_compat(sess->repos,
+                                    abs_paths,
+                                    start,
+                                    end,
+                                    limit,
+                                    discover_changed_paths,
+                                    strict_node_history,
+                                    include_merged_revisions,
+                                    revprops,
+                                    NULL, NULL,
+                                    receiver,
+                                    receiver_baton,
+                                    pool);
 }
 
 

Modified: subversion/branches/authzperf/subversion/libsvn_repos/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_repos/deprecated.c?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_repos/deprecated.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_repos/deprecated.c Sun Jun  5 15:03:52 2016
@@ -36,6 +36,8 @@
 
 #include "repos.h"
 
+#include "private/svn_repos_private.h"
+
 
 
 
@@ -507,6 +509,30 @@ svn_repos_fs_get_locks(apr_hash_t **lock
 
 /*** From logs.c ***/
 svn_error_t *
+svn_repos_get_logs4(svn_repos_t *repos,
+                    const apr_array_header_t *paths,
+                    svn_revnum_t start,
+                    svn_revnum_t end,
+                    int limit,
+                    svn_boolean_t discover_changed_paths,
+                    svn_boolean_t strict_node_history,
+                    svn_boolean_t include_merged_revisions,
+                    const apr_array_header_t *revprops,
+                    svn_repos_authz_func_t authz_read_func,
+                    void *authz_read_baton,
+                    svn_log_entry_receiver_t receiver,
+                    void *receiver_baton,
+                    apr_pool_t *pool)
+{
+  return svn_repos__get_logs_compat(repos, paths, start, end, limit,
+                                    discover_changed_paths,
+                                    strict_node_history,
+                                    include_merged_revisions, revprops,
+                                    authz_read_func, authz_read_baton,
+                                    receiver, receiver_baton, pool);
+}
+
+svn_error_t *
 svn_repos_get_logs3(svn_repos_t *repos,
                     const apr_array_header_t *paths,
                     svn_revnum_t start,

Modified: subversion/branches/authzperf/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_repos/log.c?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_repos/log.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_repos/log.c Sun Jun  5 15:03:52 2016
@@ -1897,7 +1897,7 @@ store_search(svn_mergeinfo_t processed,
 
    If HANDLING_MERGED_REVISIONS is TRUE then this is a recursive call for
    merged revisions, see INCLUDE_MERGED_REVISIONS argument to
-   svn_repos_get_logs4().  If SUBTRACTIVE_MERGE is true, then this is a
+   svn_repos_get_logs5().  If SUBTRACTIVE_MERGE is true, then this is a
    recursive call for reverse merged revisions.
 
    If NESTED_MERGES is not NULL then it is a hash of revisions (svn_revnum_t *
@@ -1912,7 +1912,7 @@ store_search(svn_mergeinfo_t processed,
    revisions that have already been searched.  Allocated like
    NESTED_MERGES above.
 
-   All other parameters are the same as svn_repos_get_logs4().
+   All other parameters are the same as svn_repos_get_logs5().
  */
 static svn_error_t *
 do_logs(svn_fs_t *fs,
@@ -2172,7 +2172,7 @@ struct location_segment_baton
   apr_pool_t *pool;
 };
 
-/* svn_location_segment_receiver_t implementation for svn_repos_get_logs4. */
+/* svn_location_segment_receiver_t implementation for svn_repos_get_logs5. */
 static svn_error_t *
 location_segment_receiver(svn_location_segment_t *segment,
                           void *baton,
@@ -2192,7 +2192,7 @@ location_segment_receiver(svn_location_s
    filesystem.  START_REV and END_REV must be valid revisions.  RESULT_POOL
    is used to allocate *PATHS_HISTORY_MERGEINFO, SCRATCH_POOL is used for all
    other (temporary) allocations.  Other parameters are the same as
-   svn_repos_get_logs4(). */
+   svn_repos_get_logs5(). */
 static svn_error_t *
 get_paths_history_as_mergeinfo(svn_mergeinfo_t *paths_history_mergeinfo,
                                svn_repos_t *repos,
@@ -2414,143 +2414,3 @@ svn_repos_get_logs5(svn_repos_t *repos,
                  include_merged_revisions, FALSE, FALSE, FALSE,
                  revprops, descending_order, &callbacks, scratch_pool);
 }
-
-/* Baton type to be used with both log4 compatibility callbacks.
- * For each revision, we collect the CHANGES and then pass them
- * on to INNER. */
-typedef struct log_entry_receiver_baton_t
-{
-  /* Pool to use to allocate CHANGES and its entries.
-   * Gets cleared after each revision. */
-  apr_pool_t *changes_pool;
-
-  /* Path changes reported so far for the current revision.
-   * Will be NULL before the first item gets added and will be reset
-   * to NULL after the INNER callback has returned. */
-  apr_hash_t *changes;
-
-  /* User-provided callback to send the log entry to. */
-  svn_log_entry_receiver_t inner;
-  void *inner_baton;
-} log_entry_receiver_baton_t;
-
-/* Return the action character (see svn_log_changed_path2_t) for KIND.
- * Returns 0 for invalid KINDs. */
-static char
-path_change_kind_to_char(svn_fs_path_change_kind_t kind)
-{
-  const char symbol[] = "MADR";
-
-  if (kind < svn_fs_path_change_modify || kind > svn_fs_path_change_replace)
-    return 0;
-
-  return symbol[kind];
-}
-
-/* Implement svn_repos_path_change_receiver_t.
- * Convert CHANGE and add it to the CHANGES list in *BATON. */
-static svn_error_t *
-log4_path_change_receiver(void *baton,
-                          svn_repos_path_change_t *change,
-                          apr_pool_t *scratch_pool)
-{
-  log_entry_receiver_baton_t *b = baton;
-  svn_log_changed_path2_t *change_copy;
-  const char *path = apr_pstrmemdup(b->changes_pool, change->path.data,
-                                    change->path.len);
-
-  /* Create a deep copy of the temporary CHANGE struct. */
-  change_copy = svn_log_changed_path2_create(b->changes_pool);
-  change_copy->action = path_change_kind_to_char(change->change_kind);
-
-  if (change->copyfrom_path)
-    change_copy->copyfrom_path = apr_pstrdup(b->changes_pool,
-                                             change->copyfrom_path);
-
-  change_copy->copyfrom_rev = change->copyfrom_rev;
-  change_copy->node_kind = change->node_kind;
-  change_copy->text_modified = change->text_mod ? svn_tristate_true
-                                                : svn_tristate_false;
-  change_copy->props_modified = change->prop_mod ? svn_tristate_true
-                                                 : svn_tristate_false;
-
-  /* Auto-create the CHANGES container (happens for each first change
-   * in any revison. */
-  if (b->changes == NULL)
-    b->changes = svn_hash__make(b->changes_pool);
-
-  /* Add change to per-revision collection. */
-  apr_hash_set(b->changes, path, change->path.len, change_copy);
-
-  return SVN_NO_ERROR;
-}
-
-/* Implement svn_log_entry_receiver_t.
- * Combine the data gathered in BATON for this revision and send it
- * to the user-provided log4-compatible callback. */
-static svn_error_t *
-log4_entry_receiver(void *baton,
-                    svn_repos_log_entry_t *log_entry,
-                    apr_pool_t *scratch_pool)
-{
-  log_entry_receiver_baton_t *b = baton;
-  svn_log_entry_t *entry = svn_log_entry_create(scratch_pool);
-
-  /* Complete the ENTRY. */
-  entry->changed_paths = b->changes;
-  entry->revision = log_entry->revision;
-  entry->revprops = log_entry->revprops;
-  entry->has_children = log_entry->has_children;
-  entry->changed_paths2 = b->changes;
-  entry->non_inheritable = log_entry->non_inheritable;
-  entry->subtractive_merge = log_entry->subtractive_merge;
-
-  /* Invoke the log4-compatible callback. */
-  SVN_ERR(b->inner(b->inner_baton, entry, scratch_pool));
-
-  /* Release per-revision data. */
-  svn_pool_clear(b->changes_pool);
-  b->changes = NULL;
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_repos_get_logs4(svn_repos_t *repos,
-                    const apr_array_header_t *paths,
-                    svn_revnum_t start,
-                    svn_revnum_t end,
-                    int limit,
-                    svn_boolean_t discover_changed_paths,
-                    svn_boolean_t strict_node_history,
-                    svn_boolean_t include_merged_revisions,
-                    const apr_array_header_t *revprops,
-                    svn_repos_authz_func_t authz_read_func,
-                    void *authz_read_baton,
-                    svn_log_entry_receiver_t receiver,
-                    void *receiver_baton,
-                    apr_pool_t *pool)
-{
-  apr_pool_t *changes_pool = svn_pool_create(pool);
-
-  log_entry_receiver_baton_t baton;
-  baton.changes_pool = changes_pool;
-  baton.changes = NULL;
-  baton.inner = receiver;
-  baton.inner_baton = receiver_baton;
-
-  SVN_ERR(svn_repos_get_logs5(repos, paths, start, end, limit,
-                              strict_node_history,
-                              include_merged_revisions,
-                              revprops,
-                              authz_read_func, authz_read_baton,
-                              discover_changed_paths
-                                ? log4_path_change_receiver
-                                : NULL,
-                              &baton,
-                              log4_entry_receiver, &baton,
-                              pool));
-
-  svn_pool_destroy(changes_pool);
-  return SVN_NO_ERROR;
-}

Modified: subversion/branches/authzperf/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_subr/sqlite.c?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_subr/sqlite.c Sun Jun  5 15:03:52 2016
@@ -213,13 +213,6 @@ struct svn_sqlite__value_t
                              sqlite_err__temp, msg);             \
 } while (0)
 
-#define SVN_ERR_CLOSE(x, db) do                                       \
-{                                                                     \
-  svn_error_t *svn__err = (x);                                        \
-  if (svn__err)                                                       \
-    return svn_error_compose_create(svn__err, svn_sqlite__close(db)); \
-} while (0)
-
 
 /* Time (in milliseconds) to wait for sqlite locks before giving up. */
 #define BUSY_TIMEOUT 10000
@@ -1141,7 +1134,7 @@ svn_sqlite__open(svn_sqlite__db_t **db,
   sqlite3_profile((*db)->db3, sqlite_profiler, (*db)->db3);
 #endif
 
-  SVN_ERR_CLOSE(exec_sql(*db,
+  SVN_SQLITE__ERR_CLOSE(exec_sql(*db,
               /* The default behavior of the LIKE operator is to ignore case
                  for ASCII characters. Hence, by default 'a' LIKE 'A' is true.
                  The case_sensitive_like pragma installs a new application-
@@ -1180,8 +1173,8 @@ svn_sqlite__open(svn_sqlite__db_t **db,
   /* When running in debug mode, enable the checking of foreign key
      constraints.  This has possible performance implications, so we don't
      bother to do it for production...for now. */
-  SVN_ERR_CLOSE(exec_sql(*db, "PRAGMA foreign_keys=ON;"),
-                *db);
+  SVN_SQLITE__ERR_CLOSE(exec_sql(*db, "PRAGMA foreign_keys=ON;"),
+                        *db);
 #endif
 
 #ifdef SVN_SQLITE_REVERSE_UNORDERED_SELECTS
@@ -1189,8 +1182,8 @@ svn_sqlite__open(svn_sqlite__db_t **db,
      clause to emit their results in the reverse order of what they normally
      would.  This can help detecting invalid assumptions about the result
      order.*/
-  SVN_ERR_CLOSE(exec_sql(*db, "PRAGMA reverse_unordered_selects=ON;"),
-                *db);
+  SVN_SQLITE__ERR_CLOSE(exec_sql(*db, "PRAGMA reverse_unordered_selects=ON;"),
+                        *db);
 #endif
 
   /* Store temporary tables in RAM instead of in temporary files, but don't

Modified: subversion/branches/authzperf/subversion/libsvn_subr/win32_crashrpt.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_subr/win32_crashrpt.c?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_subr/win32_crashrpt.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_subr/win32_crashrpt.c Sun Jun  5 15:03:52 2016
@@ -43,7 +43,7 @@ typedef int win32_crashrpt__dummy;
 #include "win32_crashrpt_dll.h"
 
 /*** Global variables ***/
-HANDLE dbghelp_dll = INVALID_HANDLE_VALUE;
+static HANDLE dbghelp_dll = INVALID_HANDLE_VALUE;
 
 /* Email address where the crash reports should be sent too. */
 #define CRASHREPORT_EMAIL "users@subversion.apache.org"

Modified: subversion/branches/authzperf/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/svn/conflict-callbacks.c?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/authzperf/subversion/svn/conflict-callbacks.c Sun Jun  5 15:03:52 2016
@@ -434,6 +434,16 @@ static const resolver_option_t builtin_r
   /* Options for incoming dir add vs local dir add upon merge. */
   { "m", N_("merge the directories"), NULL,
     svn_client_conflict_option_merge_incoming_added_dir_merge },
+  { "R", N_("replace my directory with incoming directory"), NULL,
+    svn_client_conflict_option_merge_incoming_added_dir_replace },
+  { "M", N_("replace my directory with incoming directory and merge"), NULL,
+    svn_client_conflict_option_merge_incoming_added_dir_replace_and_merge },
+
+  /* Options for incoming delete vs any. */
+  { "i", N_("ignore incoming deletion"), NULL,
+    svn_client_conflict_option_incoming_delete_ignore },
+  { "a", N_("accept incoming deletion"), NULL,
+    svn_client_conflict_option_incoming_delete_accept },
 
   { NULL }
 };
@@ -792,7 +802,9 @@ mark_conflict_resolved(svn_client_confli
  * SCRATCH_POOL is used for temporary allocations. */
 static svn_error_t *
 handle_text_conflict(svn_boolean_t *resolved,
+                     svn_boolean_t *postponed,
                      svn_boolean_t *quit,
+                     svn_boolean_t *printed_description,
                      svn_client_conflict_t *conflict,
                      const char *path_prefix,
                      svn_cmdline_prompt_baton_t *pb,
@@ -832,15 +844,19 @@ handle_text_conflict(svn_boolean_t *reso
                                                     local_abspath,
                                                     scratch_pool);
 
-  if (is_binary)
-    SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
-                                _("Merge conflict discovered in binary "
-                                  "file '%s'.\n"),
-                                local_relpath));
-  else
-    SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
-                                _("Merge conflict discovered in file '%s'.\n"),
-                                local_relpath));
+  if (!*printed_description)
+    {
+      if (is_binary)
+        SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+                                    _("Merge conflict discovered in binary "
+                                      "file '%s'.\n"),
+                                    local_relpath));
+      else
+        SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+                                    _("Merge conflict discovered in file '%s'.\n"),
+                                    local_relpath));
+      *printed_description = TRUE;
+    }
 
   /* ### TODO This whole feature availability check is grossly outdated.
      DIFF_ALLOWED needs either to be redefined or to go away.
@@ -1129,7 +1145,10 @@ handle_text_conflict(svn_boolean_t *reso
       *resolved = TRUE;
     }
   else
+    {
       *resolved = FALSE;
+      *postponed = (option_id == svn_client_conflict_option_postpone);
+    }
 
   return SVN_NO_ERROR;
 }
@@ -1316,8 +1335,9 @@ handle_one_prop_conflict(svn_client_conf
  * SCRATCH_POOL is used for temporary allocations. */
 static svn_error_t *
 handle_prop_conflicts(svn_boolean_t *resolved,
-                      const svn_string_t **merged_value,
+                      svn_boolean_t *postponed,
                       svn_boolean_t *quit,
+                      const svn_string_t **merged_value,
                       const char *path_prefix,
                       svn_cmdline_prompt_baton_t *pb,
                       const char *editor_cmd,
@@ -1359,7 +1379,13 @@ handle_prop_conflicts(svn_boolean_t *res
                                          path_prefix, conflict_stats,
                                          ctx, iterpool));
           nresolved++;
+          *postponed = FALSE;
         }
+      else
+        *postponed = (option_id == svn_client_conflict_option_postpone);
+
+      if (*quit)
+        break;
     }
   svn_pool_destroy(iterpool);
 
@@ -1435,7 +1461,9 @@ build_tree_conflict_options(resolver_opt
  * SCRATCH_POOL is used for temporary allocations. */
 static svn_error_t *
 handle_tree_conflict(svn_boolean_t *resolved,
+                     svn_boolean_t *postponed,
                      svn_boolean_t *quit,
+                     svn_boolean_t *printed_description,
                      svn_client_conflict_t *conflict,
                      const char *path_prefix,
                      svn_cmdline_prompt_baton_t *pb,
@@ -1443,12 +1471,12 @@ handle_tree_conflict(svn_boolean_t *reso
                      svn_client_ctx_t *ctx,
                      apr_pool_t *scratch_pool)
 {
-  const char *local_change_description;
-  const char *incoming_change_description;
   apr_pool_t *iterpool;
   resolver_option_t *tree_conflict_options;
   svn_client_conflict_option_id_t option_id;
   const char *conflict_description;
+  const char *local_change_description;
+  const char *incoming_change_description;
 
   option_id = svn_client_conflict_option_unspecified;
 
@@ -1461,13 +1489,15 @@ handle_tree_conflict(svn_boolean_t *reso
   conflict_description = apr_psprintf(scratch_pool, "%s\n%s",
                                       incoming_change_description,
                                       local_change_description);
-  SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
-                              _("Tree conflict on '%s':\n%s\n"),
-                              svn_cl__local_style_skip_ancestor(
-                                path_prefix,
-                                svn_client_conflict_get_local_abspath(conflict),
-                                scratch_pool),
-                              conflict_description));
+  if (!*printed_description)
+    SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+                                _("Tree conflict on '%s':\n%s\n"),
+                                svn_cl__local_style_skip_ancestor(
+                                  path_prefix,
+                                  svn_client_conflict_get_local_abspath(conflict),
+                                  scratch_pool),
+                                conflict_description));
+
   SVN_ERR(build_tree_conflict_options(&tree_conflict_options, conflict,
                                       scratch_pool, scratch_pool));
   iterpool = svn_pool_create(scratch_pool);
@@ -1478,7 +1508,9 @@ handle_tree_conflict(svn_boolean_t *reso
       svn_pool_clear(iterpool);
 
       SVN_ERR(prompt_user(&opt, tree_conflict_options, NULL,
-                          conflict_description, pb, iterpool));
+                          *printed_description ? NULL : conflict_description,
+                          pb, iterpool));
+      *printed_description = TRUE;
       if (! opt)
         continue;
 
@@ -1505,7 +1537,10 @@ handle_tree_conflict(svn_boolean_t *reso
       *resolved = TRUE;
     }
   else
+    {
       *resolved = FALSE;
+      *postponed = (option_id == svn_client_conflict_option_postpone);
+    }
 
   return SVN_NO_ERROR;
 }
@@ -1669,9 +1704,11 @@ resolve_conflict_by_accept_option(svn_cl
 
 static svn_error_t *
 resolve_conflict_interactively(svn_boolean_t *resolved,
+                               svn_boolean_t *postponed,
                                svn_boolean_t *quit,
                                svn_boolean_t *external_failed,
                                svn_boolean_t *printed_summary,
+                               svn_boolean_t *printed_description,
                                svn_client_conflict_t *conflict,
                                const char *editor_cmd,
                                apr_hash_t *config,
@@ -1707,17 +1744,17 @@ resolve_conflict_interactively(svn_boole
            svn_wc_conflict_action_edit)
        && (svn_client_conflict_get_local_change(conflict) ==
            svn_wc_conflict_reason_edited))
-    SVN_ERR(handle_text_conflict(resolved, quit, conflict,
-                                 path_prefix, pb, editor_cmd, config,
+    SVN_ERR(handle_text_conflict(resolved, postponed, quit, printed_description,
+                                 conflict, path_prefix, pb, editor_cmd, config,
                                  conflict_stats, ctx, scratch_pool));
   if (props_conflicted->nelts > 0)
-    SVN_ERR(handle_prop_conflicts(resolved, &merged_propval, quit,
-                                  path_prefix, pb, editor_cmd, config,
-                                  conflict, conflict_stats, ctx,
-                                  result_pool, scratch_pool));
+    SVN_ERR(handle_prop_conflicts(resolved, postponed, quit, &merged_propval,
+                                  path_prefix, pb, editor_cmd, config, conflict,
+                                  conflict_stats, ctx, result_pool, scratch_pool));
   if (tree_conflicted)
-    SVN_ERR(handle_tree_conflict(resolved, quit, conflict, path_prefix, pb,
-                                 conflict_stats, ctx, scratch_pool));
+    SVN_ERR(handle_tree_conflict(resolved, postponed, quit, printed_description,
+                                 conflict, path_prefix, pb, conflict_stats, ctx,
+                                 scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -1762,15 +1799,36 @@ svn_cl__resolve_conflict(svn_boolean_t *
 
       if (option_id == svn_client_conflict_option_unspecified)
         {
+          svn_boolean_t postponed = FALSE;
+          svn_boolean_t printed_description = FALSE;
+          svn_error_t *err;
+
+          *quit = FALSE;
+
           /* We're in interactive mode and either the user gave no --accept
              option or the option did not apply; let's prompt. */
-          SVN_ERR(resolve_conflict_interactively(resolved, quit,
-                                                 external_failed,
-                                                 printed_summary, conflict,
-                                                 editor_cmd, config,
-                                                 path_prefix, pb,
-                                                 conflict_stats, ctx,
-                                                 scratch_pool, scratch_pool));
+          while (!*resolved && !postponed && !*quit)
+            {
+              err = resolve_conflict_interactively(resolved, &postponed, quit,
+                                                   external_failed,
+                                                   printed_summary,
+                                                   &printed_description,
+                                                   conflict,
+                                                   editor_cmd, config,
+                                                   path_prefix, pb,
+                                                   conflict_stats, ctx,
+                                                   scratch_pool, scratch_pool);
+              if (err && err->apr_err == SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE)
+                {
+                  /* Conflict resolution has failed. Let the user try again.
+                   * It is always possible to break out of this loop with
+                   * the 'quit' or 'postpone' options. */
+                  svn_handle_warning2(stderr, err, "svn: ");
+                  svn_error_clear(err);
+                  err = SVN_NO_ERROR;
+                }
+              SVN_ERR(err);
+            }
         }
 
       return SVN_NO_ERROR;

Modified: subversion/branches/authzperf/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/svnadmin/svnadmin.c?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/svnadmin/svnadmin.c (original)
+++ subversion/branches/authzperf/subversion/svnadmin/svnadmin.c Sun Jun  5 15:03:52 2016
@@ -2221,8 +2221,6 @@ subcommand_info(apr_getopt_t *os, void *
     if (!strcmp(info->fs_type, SVN_FS_TYPE_FSFS))
       {
         const svn_fs_fsfs_info_t *fsfs_info = (const void *)info;
-        svn_revnum_t youngest;
-        SVN_ERR(svn_fs_youngest_rev(&youngest, fs, pool));
 
         if (fsfs_info->shard_size)
           SVN_ERR(svn_cmdline_printf(pool, _("FSFS Sharded: yes\n")));
@@ -2238,7 +2236,7 @@ subcommand_info(apr_getopt_t *os, void *
           {
             const int shard_size = fsfs_info->shard_size;
             const long shards_packed = fsfs_info->min_unpacked_rev / shard_size;
-            const long shards_full = (youngest + 1) / shard_size;
+            const long shards_full = (head_rev + 1) / shard_size;
             SVN_ERR(svn_cmdline_printf(pool, _("FSFS Shards Packed: %ld/%ld\n"),
                                        shards_packed, shards_full));
           }
@@ -2248,6 +2246,19 @@ subcommand_info(apr_getopt_t *os, void *
         else
           SVN_ERR(svn_cmdline_printf(pool, _("FSFS Logical Addressing: no\n")));
       }
+    else if (!strcmp(info->fs_type, SVN_FS_TYPE_FSX))
+      {
+        const svn_fs_fsx_info_t *fsx_info = (const void *)info;
+
+        const int shard_size = fsx_info->shard_size;
+        const long shards_packed = fsx_info->min_unpacked_rev / shard_size;
+        long shards_full = (head_rev + 1) / shard_size;
+
+        SVN_ERR(svn_cmdline_printf(pool, _("FSX Shard Size: %d\n"),
+                                   shard_size));
+        SVN_ERR(svn_cmdline_printf(pool, _("FSX Shards Packed: %ld/%ld\n"),
+                                   shards_packed, shards_full));
+      }
   }
 
   {

Modified: subversion/branches/authzperf/subversion/tests/cmdline/authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/authz_tests.py?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/authz_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/authz_tests.py Sun Jun  5 15:03:52 2016
@@ -1108,7 +1108,9 @@ def authz_recursive_ls(sbox):
     'A/D/gamma',
     'iota',
     ]
-  svntest.actions.run_and_verify_svn(map(lambda x: x + '\n', expected_entries),
+  with_newline = svntest.main.ensure_list(map(lambda x: x + '\n',
+                                              expected_entries))
+  svntest.actions.run_and_verify_svn(with_newline,
                                      [], 'ls', '-R',
                                      sbox.repo_url)
 

Modified: subversion/branches/authzperf/subversion/tests/cmdline/autoprop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/autoprop_tests.py?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/autoprop_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/autoprop_tests.py Sun Jun  5 15:03:52 2016
@@ -25,7 +25,7 @@
 ######################################################################
 
 # General modules
-import os, logging
+import os, logging, stat
 
 logger = logging.getLogger()
 
@@ -634,7 +634,8 @@ def svn_prop_inheritable_autoprops_add_v
   # addition will notice the executable bits and set svn:executable
   # again, which is not what we are here to test.
   if os.name == 'posix':
-    os.chmod(os.path.join(sbox.wc_dir, 'D', 'rip.bat'), 0664)
+    os.chmod(os.path.join(sbox.wc_dir, 'D', 'rip.bat'),
+                          svntest.main.S_ALL_READ | stat.S_IWUSR | stat.S_IWGRP)
 
   os.chdir(sbox.wc_dir)
   svntest.main.run_svn(None, 'add', '.', '--force', '--no-auto-props',

Modified: subversion/branches/authzperf/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/basic_tests.py?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/basic_tests.py Sun Jun  5 15:03:52 2016
@@ -394,8 +394,9 @@ def basic_commit_corruption(sbox):
   mu_saved_tb_path = mu_tb_path + "-saved"
   tb_dir_saved_mode = os.stat(tb_dir_path)[stat.ST_MODE]
   mu_tb_saved_mode = os.stat(mu_tb_path)[stat.ST_MODE]
-  os.chmod(tb_dir_path, 0777)  ### What's a more portable way to do this?
-  os.chmod(mu_tb_path, 0666)   ### Would rather not use hardcoded numbers.
+  ### What's a more portable way to do this?
+  os.chmod(tb_dir_path, svntest.main.S_ALL_RWX)
+  os.chmod(mu_tb_path, svntest.main.S_ALL_RW)
   shutil.copyfile(mu_tb_path, mu_saved_tb_path)
   svntest.main.file_append(mu_tb_path, 'Aaagggkkk, corruption!')
   os.chmod(tb_dir_path, tb_dir_saved_mode)
@@ -407,8 +408,8 @@ def basic_commit_corruption(sbox):
                                         "svn: E200014: Checksum")
 
   # Restore the uncorrupted text base.
-  os.chmod(tb_dir_path, 0777)
-  os.chmod(mu_tb_path, 0666)
+  os.chmod(tb_dir_path, svntest.main.S_ALL_RWX)
+  os.chmod(mu_tb_path, svntest.main.S_ALL_RW)
   os.remove(mu_tb_path)
   os.rename(mu_saved_tb_path, mu_tb_path)
   os.chmod(tb_dir_path, tb_dir_saved_mode)
@@ -480,8 +481,8 @@ def basic_update_corruption(sbox):
   mu_saved_tb_path = mu_tb_path + "-saved"
   tb_dir_saved_mode = os.stat(tb_dir_path)[stat.ST_MODE]
   mu_tb_saved_mode = os.stat(mu_tb_path)[stat.ST_MODE]
-  os.chmod(tb_dir_path, 0777)
-  os.chmod(mu_tb_path, 0666)
+  os.chmod(tb_dir_path, svntest.main.S_ALL_RWX)
+  os.chmod(mu_tb_path, svntest.main.S_ALL_RW)
   shutil.copyfile(mu_tb_path, mu_saved_tb_path)
   svntest.main.file_append(mu_tb_path, 'Aiyeeeee, corruption!\nHelp!\n')
   os.chmod(tb_dir_path, tb_dir_saved_mode)
@@ -499,8 +500,8 @@ def basic_update_corruption(sbox):
                                         "svn: E155017: Checksum")
 
   # Restore the uncorrupted text base.
-  os.chmod(tb_dir_path, 0777)
-  os.chmod(mu_tb_path, 0666)
+  os.chmod(tb_dir_path, svntest.main.S_ALL_RWX)
+  os.chmod(mu_tb_path, svntest.main.S_ALL_RW)
   os.remove(mu_tb_path)
   os.rename(mu_saved_tb_path, mu_tb_path)
   os.chmod(tb_dir_path, tb_dir_saved_mode)
@@ -1556,7 +1557,7 @@ def basic_add_ignores(sbox):
   foo_c_path = os.path.join(dir_path, 'foo.c')
   foo_o_path = os.path.join(dir_path, 'foo.o')
 
-  os.mkdir(dir_path, 0755)
+  os.mkdir(dir_path, svntest.main.S_ALL_RX | stat.S_IWUSR)
   open(foo_c_path, 'w')
   open(foo_o_path, 'w')
 
@@ -1607,7 +1608,7 @@ def basic_add_no_ignores(sbox):
   foo_lo_path = os.path.join(dir_path, 'foo.lo')
   foo_rej_path = os.path.join(dir_path, 'foo.rej')
 
-  os.mkdir(dir_path, 0755)
+  os.mkdir(dir_path, svntest.main.S_ALL_RX | stat.S_IWUSR)
   open(foo_c_path, 'w')
   open(foo_o_path, 'w')
   open(foo_lo_path, 'w')
@@ -1636,9 +1637,9 @@ def basic_add_parents(sbox):
   omicron_path = os.path.join(Y_path, 'omicron')
 
   # Create some unversioned directories
-  os.mkdir(X_path, 0755)
-  os.mkdir(Y_path, 0755)
-  os.mkdir(Z_path, 0755)
+  os.mkdir(X_path, svntest.main.S_ALL_RX | stat.S_IWUSR)
+  os.mkdir(Y_path, svntest.main.S_ALL_RX | stat.S_IWUSR)
+  os.mkdir(Z_path, svntest.main.S_ALL_RX | stat.S_IWUSR)
 
   # Create new files
   z = open(zeta_path, 'w')
@@ -3086,12 +3087,12 @@ def plaintext_password_storage_disabled(
   os.mkdir(config_dir_path)
 
   # disable all encryped password stores
-  config_file = file(os.path.join(config_dir_path, "config"), "w")
+  config_file = open(os.path.join(config_dir_path, "config"), "w")
   config_file.write("[auth]\npassword-stores =\n")
   config_file.close()
 
   # disable plaintext password storage
-  servers_file = file(os.path.join(config_dir_path, "servers"), "w")
+  servers_file = open(os.path.join(config_dir_path, "servers"), "w")
   servers_file.write("[global]\nstore-plaintext-passwords=no\n")
   servers_file.close()
   
@@ -3107,7 +3108,7 @@ def plaintext_password_storage_disabled(
   for root, dirs, files, in os.walk(os.path.join(config_dir_path, "auth")):
     for file_name in files:
       path = os.path.join(root, file_name)
-      f = file(path, "r")
+      f = open(path, "r")
       for line in f.readlines():
         if svntest.main.wc_passwd in line:
           f.close()

Modified: subversion/branches/authzperf/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/copy_tests.py?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/copy_tests.py Sun Jun  5 15:03:52 2016
@@ -1297,10 +1297,10 @@ def repos_to_wc_copy_eol_keywords(sbox):
   line_contents = f.readlines()
   f.close()
 
-  if re.match('[^\\r]\\n', raw_contents):
+  if re.match(b'[^\\r]\\n', raw_contents):
     raise svntest.Failure
 
-  if not re.match('.*\$LastChangedRevision:\s*\d+\s*\$', line_contents[3]):
+  if not re.match(b'.*\$LastChangedRevision:\s*\d+\s*\$', line_contents[3]):
     raise svntest.Failure
 
 #-------------------------------------------------------------

Modified: subversion/branches/authzperf/subversion/tests/cmdline/export_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/export_tests.py?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/export_tests.py Sun Jun  5 15:03:52 2016
@@ -254,10 +254,11 @@ def export_eol_translation(sbox):
   expected_output.desc[''] = Item()
   expected_output.tweak(contents=None, status='A ')
 
-  svntest.actions.run_and_verify_export(sbox.repo_url,
-                                        export_target,
-                                        expected_output,
-                                        expected_disk)
+  svntest.actions.run_and_verify_export2(sbox.repo_url,
+                                         export_target,
+                                         expected_output,
+                                         expected_disk,
+                                         keep_eol_style=True)
 
 def export_working_copy_with_keyword_translation(sbox):
   "export working copy with keyword translation"
@@ -348,10 +349,11 @@ def export_working_copy_with_property_mo
     'iota'              : Item(status='A '),
   })
 
-  svntest.actions.run_and_verify_export(wc_dir,
-                                        export_target,
-                                        expected_output,
-                                        expected_disk)
+  svntest.actions.run_and_verify_export2(wc_dir,
+                                         export_target,
+                                         expected_output,
+                                         expected_disk,
+                                         keep_eol_style=True)
 
 @XFail()
 @Issue(3798)
@@ -452,11 +454,12 @@ def export_native_eol_option(sbox):
   expected_output.desc[''] = Item()
   expected_output.tweak(contents=None, status='A ')
 
-  svntest.actions.run_and_verify_export(sbox.repo_url,
-                                        export_target,
-                                        expected_output,
-                                        expected_disk,
-                                        '--native-eol','CR')
+  svntest.actions.run_and_verify_export2(sbox.repo_url,
+                                         export_target,
+                                         expected_output,
+                                         expected_disk,
+                                         True,
+                                         '--native-eol','CR')
 
 def export_nonexistent_file(sbox):
   "export nonexistent file"
@@ -846,11 +849,12 @@ def export_externals_with_native_eol(sbo
   expected_output.wc_dir = export_target
   expected_output.desc[''] = Item()
   expected_output.tweak(contents=None, status='A ')
-  svntest.actions.run_and_verify_export(sbox.repo_url,
-                                        export_target,
-                                        expected_output,
-                                        expected_disk,
-                                        '--native-eol', 'CR')
+  svntest.actions.run_and_verify_export2(sbox.repo_url,
+                                         export_target,
+                                         expected_output,
+                                         expected_disk,
+                                         True,
+                                         '--native-eol', 'CR')
 
 @Issue(3727)
 def export_to_current_dir(sbox):

Modified: subversion/branches/authzperf/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/externals_tests.py?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/externals_tests.py Sun Jun  5 15:03:52 2016
@@ -918,43 +918,43 @@ def disallow_propset_invalid_formatted_e
 
   # It should not be possible to set these external properties on a
   # directory.
-  for ext in [ 'arg1',
-               'arg1 arg2 arg3',
-               'arg1 arg2 arg3 arg4',
-               'arg1 arg2 arg3 arg4 arg5',
-               '-r',
-               '-r1',
-               '-r 1',
-               '-r1 arg1',
-               '-r 1 arg1',
-               'arg1 -r',
-               'arg1 -r1',
-               'arg1 -r 1',
+  for ext in [ b'arg1',
+               b'arg1 arg2 arg3',
+               b'arg1 arg2 arg3 arg4',
+               b'arg1 arg2 arg3 arg4 arg5',
+               b'-r',
+               b'-r1',
+               b'-r 1',
+               b'-r1 arg1',
+               b'-r 1 arg1',
+               b'arg1 -r',
+               b'arg1 -r1',
+               b'arg1 -r 1',
                ]:
     change_external_expect_error(A_path, ext,
                                  '.*Error parsing svn:externals.*')
 
-  for ext in [ '-r abc arg1 arg2',
-               '-rabc arg1 arg2',
-               'arg1 -r abc arg2',
-               'arg1 -rabc arg2',
+  for ext in [ b'-r abc arg1 arg2',
+               b'-rabc arg1 arg2',
+               b'arg1 -r abc arg2',
+               b'arg1 -rabc arg2',
                ]:
     change_external_expect_error(A_path, ext,
                                  '.*Error parsing svn:externals.*')
 
-  for ext in [ 'http://example.com/ http://example.com/',
-               '-r1 http://example.com/ http://example.com/',
-               '-r 1 http://example.com/ http://example.com/',
-               'http://example.com/ -r1 http://example.com/',
-               'http://example.com/ -r 1 http://example.com/',
+  for ext in [ b'http://example.com/ http://example.com/',
+               b'-r1 http://example.com/ http://example.com/',
+               b'-r 1 http://example.com/ http://example.com/',
+               b'http://example.com/ -r1 http://example.com/',
+               b'http://example.com/ -r 1 http://example.com/',
                ]:
     change_external_expect_error(A_path, ext,
                                  '.*cannot use two absolute URLs.*')
 
-  for ext in [ 'http://example.com/ -r1 foo',
-               'http://example.com/ -r 1 foo',
-               '-r1 foo http://example.com/',
-               '-r 1 foo http://example.com/'
+  for ext in [ b'http://example.com/ -r1 foo',
+               b'http://example.com/ -r 1 foo',
+               b'-r1 foo http://example.com/',
+               b'-r 1 foo http://example.com/'
                ]:
     change_external_expect_error(A_path, ext,
                                  '.*cannot use a URL \'.*\' as the ' \
@@ -3244,7 +3244,7 @@ def file_external_unversioned_obstructio
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  expected_output = verify.RegexOutput('r2 committed .*')
+  expected_output = verify.RegexOutput(b'r2 committed .*')
   svntest.actions.run_and_verify_svnmucc(expected_output, [],
                            '-U', sbox.repo_url, '-m', 'r2: set external',
                            'propset', 'svn:externals', '^/A/mu mu-ext', 'A')

Modified: subversion/branches/authzperf/subversion/tests/cmdline/import_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/import_tests.py?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/import_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/import_tests.py Sun Jun  5 15:03:52 2016
@@ -25,7 +25,7 @@
 ######################################################################
 
 # General modules
-import re, os.path, sys
+import re, os.path, sys, stat
 
 # Our testing module
 import svntest
@@ -70,11 +70,11 @@ def import_executable(sbox):
     svntest.main.file_append(path, "some text")
 
   # set executable bits
-  os.chmod(all_path, 0777)
-  os.chmod(none_path, 0666)
-  os.chmod(user_path, 0766)
-  os.chmod(group_path, 0676)
-  os.chmod(other_path, 0667)
+  os.chmod(all_path, svntest.main.S_ALL_RWX)
+  os.chmod(none_path, svntest.main.S_ALL_RW)
+  os.chmod(user_path, svntest.main.S_ALL_RW | stat.S_IXUSR)
+  os.chmod(group_path, svntest.main.S_ALL_RW | stat.S_IXGRP)
+  os.chmod(other_path, svntest.main.S_ALL_RW | stat.S_IXOTH)
 
   # import new files into repository
   url = sbox.repo_url
@@ -149,7 +149,7 @@ def import_ignores(sbox):
   foo_c_path = os.path.join(dir_path, 'foo.c')
   foo_o_path = os.path.join(dir_path, 'foo.o')
 
-  os.mkdir(dir_path, 0755)
+  os.mkdir(dir_path, svntest.main.S_ALL_RX | stat.S_IWUSR)
   open(foo_c_path, 'w')
   open(foo_o_path, 'w')
 
@@ -213,7 +213,7 @@ def import_no_ignores(sbox):
   foo_lo_path = os.path.join(dir_path, 'foo.lo')
   foo_rej_path = os.path.join(dir_path, 'foo.rej')
 
-  os.mkdir(dir_path, 0755)
+  os.mkdir(dir_path, svntest.main.S_ALL_RX | stat.S_IWUSR)
   open(foo_c_path, 'w')
   open(foo_o_path, 'w')
   open(foo_lo_path, 'w')
@@ -326,7 +326,7 @@ enable-auto-props = yes
   imp_dir_path = 'dir'
   imp_file_path = os.path.join(imp_dir_path, file_name)
 
-  os.mkdir(imp_dir_path, 0755)
+  os.mkdir(imp_dir_path, svntest.main.S_ALL_RX | stat.S_IWUSR)
   svntest.main.file_write(imp_file_path, "This is file test.dsp.\n")
 
   svntest.actions.run_and_verify_svn(None, [], 'import',
@@ -378,7 +378,7 @@ enable-auto-props = yes
   imp_dir_path = 'dir2'
   imp_file_path = os.path.join(imp_dir_path, file_name)
 
-  os.mkdir(imp_dir_path, 0755)
+  os.mkdir(imp_dir_path, svntest.main.S_ALL_RX | stat.S_IWUSR)
   svntest.main.file_append_binary(imp_file_path,
                                   "This is file test.txt.\n" + \
                                   "The second line.\r\n" + \

Modified: subversion/branches/authzperf/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/lock_tests.py?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/lock_tests.py Sun Jun  5 15:03:52 2016
@@ -356,9 +356,9 @@ def enforce_lock(sbox):
   svntest.actions.set_prop('svn:needs-lock', '      ', mu_path, expected_err)
 
   # Check svn:needs-lock
-  svntest.actions.check_prop('svn:needs-lock', iota_path, ['*'])
-  svntest.actions.check_prop('svn:needs-lock', lambda_path, ['*'])
-  svntest.actions.check_prop('svn:needs-lock', mu_path, ['*'])
+  svntest.actions.check_prop('svn:needs-lock', iota_path, [b'*'])
+  svntest.actions.check_prop('svn:needs-lock', lambda_path, [b'*'])
+  svntest.actions.check_prop('svn:needs-lock', mu_path, [b'*'])
 
   svntest.main.run_svn(None, 'commit',
                        '-m', '', iota_path, lambda_path, mu_path)
@@ -1422,7 +1422,7 @@ def lock_twice_in_one_wc(sbox):
                                      'lock', '-m', '', mu2_path)
 
   # Change the file anyway
-  os.chmod(mu2_path, 0700)
+  os.chmod(mu2_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
   svntest.main.file_append(mu2_path, "Updated text")
 
   # Commit will just succeed as the DB owns the lock. It's a user decision
@@ -1689,7 +1689,10 @@ def lock_invalid_token(sbox):
   svntest.main.create_python_hook_script(hook_path,
     '# encoding=utf-8\n'
     'import sys\n'
-    'sys.stdout.write("тест")\n'
+    'if sys.version_info < (3, 0):\n'
+    '  sys.stdout.write("тест")\n'
+    'else:\n'
+    '  sys.stdout.buffer.write(("тест").encode("utf-8"))\n'
     'sys.exit(0)\n')
 
   fname = 'iota'
@@ -2078,7 +2081,6 @@ def dav_lock_timeout(sbox):
 def create_dav_lock_timeout(sbox):
   "create generic DAV lock with timeout"
 
-  import httplib
   import base64
 
   sbox.build()
@@ -2096,7 +2098,7 @@ def create_dav_lock_timeout(sbox):
               '</D:lockinfo>'
 
   lock_headers = {
-    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Authorization': 'Basic ' + base64.b64encode(b'jrandom:rayjandom').decode(),
     'Timeout': 'Second-86400'
   }
 
@@ -2216,7 +2218,13 @@ def many_locks_hooks(sbox):
 def dav_lock_refresh(sbox):
   "refresh timeout of DAV lock"
 
-  import httplib
+  try:
+    # Python <3.0
+    import httplib
+  except ImportError:
+    # Python >=3.0
+    import http.client as httplib
+
   import base64
 
   sbox.build(create_wc = False)
@@ -2231,7 +2239,7 @@ def dav_lock_refresh(sbox):
   lock_token = svntest.actions.run_and_parse_info(sbox.repo_url + '/iota')[0]['Lock Token']
 
   lock_headers = {
-    'Authorization': 'Basic ' + base64.b64encode('jrandom:rayjandom'),
+    'Authorization': 'Basic ' + base64.b64encode(b'jrandom:rayjandom').decode(),
     'If': '(<' + lock_token + '>)',
     'Timeout': 'Second-7200'
   }
@@ -2427,7 +2435,7 @@ def delete_locks_on_depth_commit(sbox):
   expected_status.tweak('', 'iota', wc_rev=2)
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
-@Issue(4557)
+@Issue(4634)
 @XFail(svntest.main.is_ra_type_dav)
 def replace_dir_with_lots_of_locked_files(sbox):
   "replace directory containing lots of locked files"

Modified: subversion/branches/authzperf/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/log_tests.py?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/log_tests.py Sun Jun  5 15:03:52 2016
@@ -937,7 +937,7 @@ def log_through_copyfrom_history(sbox):
 def escape_control_chars(sbox):
   "mod_dav_svn must escape invalid XML control chars"
 
-  dump_str = """SVN-fs-dump-format-version: 2
+  dump_str = b"""SVN-fs-dump-format-version: 2
 
 UUID: ffcae364-69ee-0310-a980-ca5f10462af2
 

Modified: subversion/branches/authzperf/subversion/tests/cmdline/merge_automatic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/merge_automatic_tests.py?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/merge_automatic_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/merge_automatic_tests.py Sun Jun  5 15:03:52 2016
@@ -213,7 +213,7 @@ def get_3ways_from_output(output):
 
   merges = []
   for line in output:
-    print "## " + line,
+    sys.stdout.write("## " + line + " ")
     # Extract "A1" from a line like "DBG: merge.c:11336: base  svn://.../A@1"
     match = re.search(r'merge\.c:.* base .* /(\w+)@([0-9-]+)', line)
     if match:

Modified: subversion/branches/authzperf/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/merge_tests.py?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/merge_tests.py Sun Jun  5 15:03:52 2016
@@ -496,16 +496,10 @@ def simple_property_merges(sbox):
   beta_path = sbox.ospath('A/B/E/beta')
   E_path = sbox.ospath('A/B/E')
 
-  svntest.actions.run_and_verify_svn(None, [],
-                                     'propset', 'foo', 'foo_val',
-                                     alpha_path)
+  svntest.actions.set_prop('foo', 'foo_val', alpha_path)
   # A binary, non-UTF8 property value
-  svntest.actions.run_and_verify_svn(None, [],
-                                     'propset', 'foo', 'foo\201val',
-                                     beta_path)
-  svntest.actions.run_and_verify_svn(None, [],
-                                     'propset', 'foo', 'foo_val',
-                                     E_path)
+  svntest.actions.set_prop('foo', b'foo\201val', beta_path)
+  svntest.actions.set_prop('foo', 'foo_val', E_path)
 
   # Commit change as rev 2
   expected_output = svntest.wc.State(wc_dir, {
@@ -530,18 +524,12 @@ def simple_property_merges(sbox):
   svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
   # Modify a property and add a property for the file and directory
-  svntest.actions.run_and_verify_svn(None, [],
-                                     'propset', 'foo', 'mod_foo', alpha_path)
-  svntest.actions.run_and_verify_svn(None, [],
-                                     'propset', 'bar', 'bar_val', alpha_path)
-  svntest.actions.run_and_verify_svn(None, [],
-                                     'propset', 'foo', 'mod\201foo', beta_path)
-  svntest.actions.run_and_verify_svn(None, [],
-                                     'propset', 'bar', 'bar\201val', beta_path)
-  svntest.actions.run_and_verify_svn(None, [],
-                                     'propset', 'foo', 'mod_foo', E_path)
-  svntest.actions.run_and_verify_svn(None, [],
-                                     'propset', 'bar', 'bar_val', E_path)
+  svntest.actions.set_prop('foo', 'mod_foo', alpha_path)
+  svntest.actions.set_prop('bar', 'bar_val', alpha_path)
+  svntest.actions.set_prop('foo', b'mod\201foo', beta_path)
+  svntest.actions.set_prop('bar', b'bar\201val', beta_path)
+  svntest.actions.set_prop('foo', 'mod_foo', E_path)
+  svntest.actions.set_prop('bar', 'bar_val', E_path)
 
   # Commit change as rev 4
   expected_status = svntest.actions.get_virginal_state(wc_dir, 3)
@@ -585,7 +573,7 @@ def simple_property_merges(sbox):
   expected_disk.tweak('E', 'E/alpha',
                       props={'foo' : 'mod_foo', 'bar' : 'bar_val'})
   expected_disk.tweak('E/beta',
-                      props={'foo' : 'mod\201foo', 'bar' : 'bar\201val'})
+                      props={'foo' : b'mod\201foo', 'bar' : b'bar\201val'})
   expected_status = wc.State(B2_path, {
     ''        : Item(status=' M'),
     'E'       : Item(status=' M'),
@@ -645,7 +633,7 @@ def simple_property_merges(sbox):
     : Item(error_message('foo', 'foo?\\81val', 'mod?\\81foo')),
     })
   expected_disk.tweak('E', 'E/alpha', props={'bar' : 'bar_val'})
-  expected_disk.tweak('E/beta', props={'bar' : 'bar\201val'})
+  expected_disk.tweak('E/beta', props={'bar' : b'bar\201val'})
   expected_status.tweak('', status=' M')
   expected_status.tweak('E', 'E/alpha', 'E/beta', status=' C')
   expected_output.tweak('E', 'E/alpha', 'E/beta', status=' C')
@@ -1202,7 +1190,7 @@ def merge_binary_file(sbox):
   expected_disk = svntest.main.greek_state.copy()
   expected_disk.add({
     ''        : Item(props={SVN_PROP_MERGEINFO : '/:3'}),
-    'A/theta' : Item(theta_contents + "some extra junk",
+    'A/theta' : Item(theta_contents + b"some extra junk",
                      props={'svn:mime-type' : 'application/octet-stream'}),
     })
   expected_status = svntest.actions.get_virginal_state(other_wc, 1)
@@ -1834,7 +1822,7 @@ def merge_binary_with_common_ancestry(sb
   # Add a binary file to the common ancestry path
   theta_contents = open(os.path.join(sys.path[0], "theta.bin"), 'rb').read()
   theta_I_path = os.path.join(I_path, 'theta')
-  svntest.main.file_write(theta_I_path, theta_contents)
+  svntest.main.file_write(theta_I_path, theta_contents, mode='wb')
   svntest.main.run_svn(None, 'add', theta_I_path)
   svntest.main.run_svn(None, 'propset', 'svn:mime-type',
                        'application/octet-stream', theta_I_path)
@@ -3306,17 +3294,17 @@ def merge_ignore_eolstyle(sbox):
   expected_status.tweak(file_name, status='M ', wc_rev=2)
   expected_skip = wc.State('', { })
 
-  svntest.actions.run_and_verify_merge(sbox.wc_dir, '2', '3',
-                                       sbox.repo_url, None,
-                                       expected_output,
-                                       expected_mergeinfo_output,
-                                       expected_elision_output,
-                                       expected_disk,
-                                       expected_status,
-                                       expected_skip,
-                                       [], False, False,
-                                       '--allow-mixed-revisions',
-                                       '-x', '--ignore-eol-style', wc_dir)
+  svntest.actions.run_and_verify_merge2(sbox.wc_dir, '2', '3',
+                                        sbox.repo_url, None,
+                                        expected_output,
+                                        expected_mergeinfo_output,
+                                        expected_elision_output,
+                                        expected_disk,
+                                        expected_status,
+                                        expected_skip,
+                                        [], False, False, True,
+                                        '--allow-mixed-revisions',
+                                        '-x', '--ignore-eol-style', wc_dir)
 
 #----------------------------------------------------------------------
 # eol-style handling during merge with conflicts, scenario 1:
@@ -3342,6 +3330,9 @@ def merge_conflict_markers_matching_eol(
   else:
     crlf = '\r\n'
 
+  # Strict EOL style matching breaks Windows tests at least with Python 2
+  keep_eol_style = not svntest.main.is_os_windows()
+
   # Checkout a second working copy
   wc_backup = sbox.add_wc_path('backup')
   svntest.actions.run_and_verify_svn(None, [], 'checkout',
@@ -3446,14 +3437,15 @@ def merge_conflict_markers_matching_eol(
       })
     expected_backup_skip = wc.State('', { })
 
-    svntest.actions.run_and_verify_merge(wc_backup, cur_rev - 1, cur_rev,
-                                         sbox.repo_url, None,
-                                         expected_backup_output,
-                                         expected_mergeinfo_output,
-                                         expected_elision_output,
-                                         expected_backup_disk,
-                                         expected_backup_status,
-                                         expected_backup_skip)
+    svntest.actions.run_and_verify_merge2(wc_backup, cur_rev - 1, cur_rev,
+                                          sbox.repo_url, None,
+                                          expected_backup_output,
+                                          expected_mergeinfo_output,
+                                          expected_elision_output,
+                                          expected_backup_disk,
+                                          expected_backup_status,
+                                          expected_backup_skip,
+                                          keep_eol_style=keep_eol_style)
 
     # cleanup for next run
     svntest.main.run_svn(None, 'revert', '-R', wc_backup)
@@ -3483,6 +3475,9 @@ def merge_eolstyle_handling(sbox):
   else:
     crlf = '\r\n'
 
+  # Strict EOL style matching breaks Windows tests at least with Python 2
+  keep_eol_style = not svntest.main.is_os_windows()
+
   # Checkout a second working copy
   wc_backup = sbox.add_wc_path('backup')
   svntest.actions.run_and_verify_svn(None, [], 'checkout',
@@ -3515,13 +3510,15 @@ def merge_eolstyle_handling(sbox):
 
   expected_backup_skip = wc.State('', { })
 
-  svntest.actions.run_and_verify_merge(wc_backup, '1', '2', sbox.repo_url, None,
-                                       expected_backup_output,
-                                       expected_mergeinfo_output,
-                                       expected_elision_output,
-                                       expected_backup_disk,
-                                       expected_backup_status,
-                                       expected_backup_skip)
+  svntest.actions.run_and_verify_merge2(wc_backup, '1', '2', sbox.repo_url,
+                                        None,
+                                        expected_backup_output,
+                                        expected_mergeinfo_output,
+                                        expected_elision_output,
+                                        expected_backup_disk,
+                                        expected_backup_status,
+                                        expected_backup_skip,
+                                        keep_eol_style=keep_eol_style)
 
   # Test 2: now change the eol-style property to another value and commit,
   # merge this revision in the still changed mu in the second working copy;
@@ -3544,13 +3541,15 @@ def merge_eolstyle_handling(sbox):
   expected_backup_status = svntest.actions.get_virginal_state(wc_backup, 1)
   expected_backup_status.tweak('', status=' M')
   expected_backup_status.tweak('A/mu', status='MM')
-  svntest.actions.run_and_verify_merge(wc_backup, '2', '3', sbox.repo_url, None,
-                                       expected_backup_output,
-                                       expected_mergeinfo_output,
-                                       expected_elision_output,
-                                       expected_backup_disk,
-                                       expected_backup_status,
-                                       expected_backup_skip)
+  svntest.actions.run_and_verify_merge2(wc_backup, '2', '3', sbox.repo_url,
+                                        None,
+                                        expected_backup_output,
+                                        expected_mergeinfo_output,
+                                        expected_elision_output,
+                                        expected_backup_disk,
+                                        expected_backup_status,
+                                        expected_backup_skip,
+                                        keep_eol_style=keep_eol_style)
 
   # Test 3: now delete the eol-style property and commit, merge this revision
   # in the still changed mu in the second working copy; there should be no
@@ -3571,13 +3570,15 @@ def merge_eolstyle_handling(sbox):
   expected_backup_status = svntest.actions.get_virginal_state(wc_backup, 1)
   expected_backup_status.tweak('', status=' M')
   expected_backup_status.tweak('A/mu', status='M ')
-  svntest.actions.run_and_verify_merge(wc_backup, '3', '4', sbox.repo_url, None,
-                                       expected_backup_output,
-                                       expected_mergeinfo_output,
-                                       expected_elision_output,
-                                       expected_backup_disk,
-                                       expected_backup_status,
-                                       expected_backup_skip)
+  svntest.actions.run_and_verify_merge2(wc_backup, '3', '4', sbox.repo_url,
+                                        None,
+                                        expected_backup_output,
+                                        expected_mergeinfo_output,
+                                        expected_elision_output,
+                                        expected_backup_disk,
+                                        expected_backup_status,
+                                        expected_backup_skip,
+                                        keep_eol_style=keep_eol_style)
 
 #----------------------------------------------------------------------
 def create_deep_trees(wc_dir):
@@ -15995,7 +15996,7 @@ def dry_run_merge_conflicting_binary(sbo
   expected_disk = svntest.main.greek_state.copy()
   expected_disk.add({
     ''        : Item(props={SVN_PROP_MERGEINFO : '/:3'}),
-    'A/theta' : Item(theta_contents + "some other junk",
+    'A/theta' : Item(theta_contents + b"some other junk",
                      props={'svn:mime-type' : 'application/octet-stream'}),
     })
 
@@ -16007,7 +16008,7 @@ def dry_run_merge_conflicting_binary(sbo
   # verify content of theirs(right) file
   expected_disk.add({
   'A/theta.merge-right.r3' :
-    Item(contents= theta_contents + "some extra junk")
+    Item(contents= theta_contents + b"some extra junk")
   })
 
   expected_status = svntest.actions.get_virginal_state(other_wc, 1)

Modified: subversion/branches/authzperf/subversion/tests/cmdline/mod_authz_svn_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/mod_authz_svn_tests.py?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/mod_authz_svn_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/mod_authz_svn_tests.py Sun Jun  5 15:03:52 2016
@@ -101,8 +101,15 @@ def write_authz_file_groups(sbox):
 
 def verify_get(test_area_url, path, user, pw,
                expected_status, expected_body, headers):
-  import httplib
-  from urlparse import urlparse
+  try:
+    # Python <3.0
+    import httplib
+    from urlparse import urlparse
+  except ImportError:
+    # Python >=3.0
+    import http.client as httplib
+    from urllib.parse import urlparse
+
   import base64
 
   req_url = test_area_url + path
@@ -119,7 +126,8 @@ def verify_get(test_area_url, path, user
 
   if user and pw:
       auth_info = user + ':' + pw
-      headers['Authorization'] = 'Basic ' + base64.b64encode(auth_info)
+      user_pw = base64.b64encode(auth_info.encode()).decode()
+      headers['Authorization'] = 'Basic ' + user_pw
   else:
       auth_info = "anonymous"
 
@@ -138,6 +146,8 @@ def verify_get(test_area_url, path, user
 
   if expected_body:
       actual_body = r.read()
+      if isinstance(expected_body, str) and not isinstance(actual_body, str):
+        actual_body = actual_body.decode()
       if expected_body != actual_body:
         logger.warn("Expected body:")
         logger.warn(expected_body)

Modified: subversion/branches/authzperf/subversion/tests/cmdline/mod_dav_svn_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/mod_dav_svn_tests.py?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/mod_dav_svn_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/mod_dav_svn_tests.py Sun Jun  5 15:03:52 2016
@@ -25,7 +25,14 @@
 ######################################################################
 
 # General modules
-import os, logging, httplib, base64
+import os, logging, base64, functools
+
+try:
+  # Python <3.0
+  import httplib
+except ImportError:
+  # Python >=3.0
+  import http.client as httplib
 
 logger = logging.getLogger()
 
@@ -43,6 +50,25 @@ Wimp = svntest.testcase.Wimp_deco
 ######################################################################
 # Helper routines
 
+def compare(lhs, rhs):
+  """Implements cmp() for Python 2 and 3 alike"""
+  if lhs == None:
+    if rhs == None:
+      return 0
+    else:
+      return -1
+  else:
+    if rhs == None:
+      return 1
+    else:
+      return (lhs > rhs) - (lhs < rhs)
+
+def compare_dict(lhs, rhs):
+  """Implements dictionary comparison for Python 2 and 3 alike"""
+  lhs_sorted = sorted(lhs, key=lambda x:sorted(x.keys()))
+  rhs_sorted = sorted(rhs, key=lambda x:sorted(x.keys()))
+  return (lhs_sorted > rhs_sorted) - (lhs_sorted < rhs_sorted)
+
 def compare_xml_elem(a, b):
   """Recursively compare two xml.etree.ElementTree.Element objects.
   Return a 3-tuple made out of (cmp, elem_a, elem_b), where cmp is
@@ -52,20 +78,20 @@ def compare_xml_elem(a, b):
 
   # Compare tags, attributes, inner text, tail attribute and the
   # number of child elements.
-  res = cmp(a.tag, b.tag)
+  res = compare(a.tag, b.tag)
   if res != 0:
     return res, a, b
   # Don't care about the order of the attributes.
-  res = cmp(a.attrib, b.attrib)
+  res = compare_dict(a.attrib, b.attrib)
   if res != 0:
     return res, a, b
-  res = cmp(a.text, b.text)
+  res = compare(a.text, b.text)
   if res != 0:
     return res, a, b
-  res = cmp(a.tail, b.tail)
+  res = compare(a.tail, b.tail)
   if res != 0:
     return res, a, b
-  res = cmp(len(a), len(b))
+  res = compare(len(a), len(b))
   if res != 0:
     return res, a, b
 
@@ -76,9 +102,9 @@ def compare_xml_elem(a, b):
   # iteration.
   def sortcmp(x, y):
     return compare_xml_elem(x, y)[0]
-
-  a_children = sorted(list(a), cmp=sortcmp)
-  b_children = sorted(list(b), cmp=sortcmp)
+ 
+  a_children = sorted(list(a), key=functools.cmp_to_key(sortcmp))
+  b_children = sorted(list(b), key=functools.cmp_to_key(sortcmp))
 
   for a_child, b_child in zip(a_children, b_children):
     res = compare_xml_elem(a_child, b_child)
@@ -117,7 +143,7 @@ def cache_control_header(sbox):
   sbox.build(create_wc=False, read_only=True)
 
   headers = {
-    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Authorization': 'Basic ' + base64.b64encode(b'jconstant:rayjandom').decode(),
   }
 
   h = svntest.main.create_http_connection(sbox.repo_url)
@@ -220,7 +246,7 @@ def simple_propfind(sbox):
 
   # PROPFIND /repos/!svn/rvr/1, Depth = 0
   headers = {
-    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Authorization': 'Basic ' + base64.b64encode(b'jconstant:rayjandom').decode(),
     'Depth': '0',
   }
   req_body = (
@@ -254,7 +280,7 @@ def simple_propfind(sbox):
 
   # PROPFIND /repos/!svn/rvr/1, Depth = 1
   headers = {
-    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Authorization': 'Basic ' + base64.b64encode(b'jconstant:rayjandom').decode(),
     'Depth': '1',
   }
   req_body = (
@@ -308,7 +334,7 @@ def simple_propfind(sbox):
 
   # PROPFIND /repos/!svn/rvr/1/A/B/F, Depth = 1
   headers = {
-    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Authorization': 'Basic ' + base64.b64encode(b'jconstant:rayjandom').decode(),
     'Depth': '1',
   }
   req_body = (
@@ -342,7 +368,7 @@ def simple_propfind(sbox):
 
   # PROPFIND /repos/!svn/rvr/1/iota, Depth = 0
   headers = {
-    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Authorization': 'Basic ' + base64.b64encode(b'jconstant:rayjandom').decode(),
     'Depth': '0',
   }
   req_body = (
@@ -386,7 +412,7 @@ def propfind_multiple_props(sbox):
 
   # PROPFIND /repos/!svn/rvr/1/iota, Depth = 0
   headers = {
-    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Authorization': 'Basic ' + base64.b64encode(b'jconstant:rayjandom').decode(),
     'Depth': '0',
   }
   req_body = (
@@ -438,7 +464,7 @@ def propfind_404(sbox):
 
   # PROPFIND /repos/!svn/rvr/1, Depth = 0
   headers = {
-    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Authorization': 'Basic ' + base64.b64encode(b'jconstant:rayjandom').decode(),
     'Depth': '0',
   }
   req_body = (
@@ -490,7 +516,7 @@ def propfind_allprop(sbox):
 
   # PROPFIND /repos/!svn/rvr/1, Depth = 0
   headers = {
-    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Authorization': 'Basic ' + base64.b64encode(b'jconstant:rayjandom').decode(),
     'Depth': '0',
   }
   req_body = (
@@ -562,7 +588,7 @@ def propfind_propname(sbox):
 
   # PROPFIND /repos/!svn/rvr/2/iota, Depth = 0
   headers = {
-    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Authorization': 'Basic ' + base64.b64encode(b'jconstant:rayjandom').decode(),
     'Depth': '0',
   }
   req_body = (

Modified: subversion/branches/authzperf/subversion/tests/cmdline/move_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/cmdline/move_tests.py?rev=1746927&r1=1746926&r2=1746927&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/tests/cmdline/move_tests.py (original)
+++ subversion/branches/authzperf/subversion/tests/cmdline/move_tests.py Sun Jun  5 15:03:52 2016
@@ -1250,7 +1250,7 @@ def nested_replaces(sbox):
   svntest.actions.run_and_verify_status(wc_dir, r2_status)
 
   svntest.main.run_svn(None, 'commit', '-m', 'r2: juggle the tree', wc_dir)
-  expected_output = svntest.verify.UnorderedRegexListOutput(map(re.escape, [
+  escaped = svntest.main.ensure_list(map(re.escape, [
     '   R /A (from /X/Y/Z:1)',
     '   A /A/B (from /A/B:1)',
     '   R /A/B/C (from /X:1)',
@@ -1259,9 +1259,9 @@ def nested_replaces(sbox):
     '   R /X/Y/Z (from /A:1)',
     '   D /X/Y/Z/B',
     '   D /A/B/C/Y',
-  ]) + [
-    '^-', '^r2', '^-', '^Changed paths:',
-  ])
+  ]))
+  expected_output = svntest.verify.UnorderedRegexListOutput(escaped
+                    + [ '^-', '^r2', '^-', '^Changed paths:', ])
   svntest.actions.run_and_verify_svn(expected_output, [],
                                      'log', '-qvr2', repo_url)