Modified: subversion/branches/ra-git/subversion/svnserve/cyrus_auth.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svnserve/cyrus_auth.c?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/svnserve/cyrus_auth.c (original)
+++ subversion/branches/ra-git/subversion/svnserve/cyrus_auth.c Tue Oct 11 
09:11:50 2016
@@ -74,6 +74,8 @@ static int canonicalize_username(sasl_co
     {
       /* The only valid realm is user_realm (i.e. the repository's realm).
          If the user gave us another realm, complain. */
+      if (realm_len != inlen-(pos-in+1))
+        return SASL_BADPROT;
       if (strncmp(pos+1, user_realm, inlen-(pos-in+1)) != 0)
         return SASL_BADPROT;
     }
@@ -110,11 +112,12 @@ static svn_error_t *initialize(void *bat
 
   /* The second parameter tells SASL to look for a configuration file
      named subversion.conf. */
-  result = sasl_server_init(callbacks, SVN_RA_SVN_SASL_NAME);
+  result = svn_sasl__server_init(callbacks, SVN_RA_SVN_SASL_NAME);
   if (result != SASL_OK)
     {
-      svn_error_t *err = svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
-                                          sasl_errstring(result, NULL, NULL));
+      svn_error_t *err = svn_error_create(
+          SVN_ERR_RA_NOT_AUTHORIZED, NULL,
+          svn_sasl__errstring(result, NULL, NULL));
       return svn_error_quick_wrap(err,
                                   _("Could not initialize the SASL library"));
     }
@@ -133,7 +136,7 @@ svn_error_t *cyrus_init(apr_pool_t *pool
 static svn_error_t *
 fail_auth(svn_ra_svn_conn_t *conn, apr_pool_t *pool, sasl_conn_t *sasl_ctx)
 {
-  const char *msg = sasl_errdetail(sasl_ctx);
+  const char *msg = svn_sasl__errdetail(sasl_ctx);
   SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w(c)", "failure", msg));
   return svn_ra_svn__flush(conn, pool);
 }
@@ -154,7 +157,7 @@ static svn_error_t *
 fail_cmd(svn_ra_svn_conn_t *conn, apr_pool_t *pool, sasl_conn_t *sasl_ctx)
 {
   svn_error_t *err = svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
-                                      sasl_errdetail(sasl_ctx));
+                                      svn_sasl__errdetail(sasl_ctx));
   SVN_ERR(write_failure(conn, pool, &err));
   return svn_ra_svn__flush(conn, pool);
 }
@@ -190,9 +193,10 @@ static svn_error_t *try_auth(svn_ra_svn_
     return svn_error_createf(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
                              _("Initial token is too long"));
 
-  result = sasl_server_start(sasl_ctx, mech,
-                             in ? in->data : NULL,
-                             in ? (unsigned int) in->len : 0, &out, &outlen);
+  result = svn_sasl__server_start(sasl_ctx, mech,
+                                  in ? in->data : NULL,
+                                  in ? (unsigned int) in->len : 0,
+                                  &out, &outlen);
 
   if (result != SASL_OK && result != SASL_CONTINUE)
     return fail_auth(conn, pool, sasl_ctx);
@@ -221,8 +225,9 @@ static svn_error_t *try_auth(svn_ra_svn_
         return svn_error_createf(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
                                  _("Step response is too long"));
 
-      result = sasl_server_step(sasl_ctx, in->data, (unsigned int) in->len,
-                                &out, &outlen);
+      result = svn_sasl__server_step(sasl_ctx, in->data,
+                                     (unsigned int) in->len,
+                                     &out, &outlen);
     }
 
   if (result != SASL_OK)
@@ -244,7 +249,7 @@ static svn_error_t *try_auth(svn_ra_svn_
 static apr_status_t sasl_dispose_cb(void *data)
 {
   sasl_conn_t *sasl_ctx = (sasl_conn_t*) data;
-  sasl_dispose(&sasl_ctx);
+  svn_sasl__dispose(&sasl_ctx);
   return APR_SUCCESS;
 }
 
@@ -276,15 +281,16 @@ svn_error_t *cyrus_auth_request(svn_ra_s
 
   /* Create a SASL context. SASL_SUCCESS_DATA tells SASL that the protocol
      supports sending data along with the final "success" message. */
-  result = sasl_server_new(SVN_RA_SVN_SASL_NAME,
-                           hostname, b->repository->realm,
-                           localaddrport, remoteaddrport,
-                           NULL, SASL_SUCCESS_DATA,
-                           &sasl_ctx);
+  result = svn_sasl__server_new(SVN_RA_SVN_SASL_NAME,
+                                hostname, b->repository->realm,
+                                localaddrport, remoteaddrport,
+                                NULL, SASL_SUCCESS_DATA,
+                                &sasl_ctx);
   if (result != SASL_OK)
     {
-      svn_error_t *err = svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
-                                          sasl_errstring(result, NULL, NULL));
+      svn_error_t *err = svn_error_create(
+          SVN_ERR_RA_NOT_AUTHORIZED, NULL,
+          svn_sasl__errstring(result, NULL, NULL));
       SVN_ERR(write_failure(conn, pool, &err));
       return svn_ra_svn__flush(conn, pool);
     }
@@ -305,20 +311,20 @@ svn_error_t *cyrus_auth_request(svn_ra_s
   secprops.max_ssf = b->repository->max_ssf;
 
   /* Set security properties. */
-  result = sasl_setprop(sasl_ctx, SASL_SEC_PROPS, &secprops);
+  result = svn_sasl__setprop(sasl_ctx, SASL_SEC_PROPS, &secprops);
   if (result != SASL_OK)
     return fail_cmd(conn, pool, sasl_ctx);
 
   /* SASL needs to know if we are externally authenticated. */
   if (b->client_info->tunnel_user)
-    result = sasl_setprop(sasl_ctx, SASL_AUTH_EXTERNAL,
-                          b->client_info->tunnel_user);
+    result = svn_sasl__setprop(sasl_ctx, SASL_AUTH_EXTERNAL,
+                               b->client_info->tunnel_user);
   if (result != SASL_OK)
     return fail_cmd(conn, pool, sasl_ctx);
 
   /* Get the list of mechanisms. */
-  result = sasl_listmech(sasl_ctx, NULL, NULL, " ", NULL,
-                         &mechlist, NULL, &mech_count);
+  result = svn_sasl__listmech(sasl_ctx, NULL, NULL, " ", NULL,
+                              &mechlist, NULL, &mech_count);
 
   if (result != SASL_OK)
     return fail_cmd(conn, pool, sasl_ctx);
@@ -354,7 +360,7 @@ svn_error_t *cyrus_auth_request(svn_ra_s
       const void *user;
 
       /* Get the authenticated username. */
-      result = sasl_getprop(sasl_ctx, SASL_USERNAME, &user);
+      result = svn_sasl__getprop(sasl_ctx, SASL_USERNAME, &user);
 
       if (result != SASL_OK)
         return fail_cmd(conn, pool, sasl_ctx);

Modified: subversion/branches/ra-git/subversion/svnserve/serve.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svnserve/serve.c?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/svnserve/serve.c (original)
+++ subversion/branches/ra-git/subversion/svnserve/serve.c Tue Oct 11 09:11:50 
2016
@@ -87,6 +87,9 @@ typedef struct log_baton_t {
   const char *fs_path;
   svn_ra_svn_conn_t *conn;
   int stack_depth;
+
+  /* Set to TRUE when at least one changed path has been sent. */
+  svn_boolean_t started;
 } log_baton_t;
 
 typedef struct file_revs_baton_t {
@@ -1828,7 +1831,7 @@ get_dir(svn_ra_svn_conn_t *conn,
               entry_kind = fsent->kind;
 
           if (dirent_fields & SVN_DIRENT_SIZE)
-              if (entry_kind != svn_node_dir)
+              if (fsent->kind != svn_node_dir)
                 SVN_CMD_ERR(svn_fs_file_length(&entry_size, root, file_path,
                                                subpool));
 
@@ -2187,14 +2190,58 @@ get_mergeinfo(svn_ra_svn_conn_t *conn,
   return SVN_NO_ERROR;
 }
 
-/* Send a log entry to the client. */
-static svn_error_t *log_receiver(void *baton,
-                                 svn_log_entry_t *log_entry,
-                                 apr_pool_t *pool)
+/* Send a changed paths list entry to the client.
+   This implements svn_repos_path_change_receiver_t. */
+static svn_error_t *
+path_change_receiver(void *baton,
+                     svn_repos_path_change_t *change,
+                     apr_pool_t *scratch_pool)
+{
+  const char symbol[] = "MADR";
+
+  log_baton_t *b = baton;
+  svn_ra_svn_conn_t *conn = b->conn;
+
+  /* Sanitize and convert change kind to ra-svn level action.
+
+     Pushing that conversion down into libsvn_ra_svn would add yet another
+     API dependency there. */
+  char action = (   change->change_kind < svn_fs_path_change_modify
+                 || change->change_kind > svn_fs_path_change_replace)
+              ? 0
+              : symbol[change->change_kind];
+
+  /* Open lists once: LOG_ENTRY and LOG_ENTRY->CHANGED_PATHS. */
+  if (!b->started)
+    {
+      SVN_ERR(svn_ra_svn__start_list(conn, scratch_pool));
+      SVN_ERR(svn_ra_svn__start_list(conn, scratch_pool));
+      b->started = TRUE;
+    }
+
+  /* Serialize CHANGE. */
+  SVN_ERR(svn_ra_svn__write_data_log_changed_path(
+              conn, scratch_pool,
+              &change->path,
+              action,
+              change->copyfrom_path,
+              change->copyfrom_rev,
+              change->node_kind,
+              change->text_mod,
+              change->prop_mod));
+
+  return SVN_NO_ERROR;
+}
+
+/* Send a the meta data and the revpros for LOG_ENTRY to the client.
+   This implements svn_log_entry_receiver_t. */
+static svn_error_t *
+revision_receiver(void *baton,
+                  svn_repos_log_entry_t *log_entry,
+                  apr_pool_t *scratch_pool)
 {
   log_baton_t *b = baton;
   svn_ra_svn_conn_t *conn = b->conn;
-  apr_hash_index_t *h;
   svn_boolean_t invalid_revnum = FALSE;
   const svn_string_t *author, *date, *message;
   unsigned revprop_count;
@@ -2215,55 +2262,52 @@ static svn_error_t *log_receiver(void *b
 
   svn_compat_log_revprops_out_string(&author, &date, &message,
                                      log_entry->revprops);
-  svn_compat_log_revprops_clear(log_entry->revprops);
-  if (log_entry->revprops)
-    revprop_count = apr_hash_count(log_entry->revprops);
-  else
-    revprop_count = 0;
 
-  /* send LOG_ENTRY */
-  SVN_ERR(svn_ra_svn__start_list(conn, pool));
-
-  /* send LOG_ENTRY->CHANGED_PATHS2 */
-  SVN_ERR(svn_ra_svn__start_list(conn, pool));
-  if (log_entry->changed_paths2)
+  /* Revprops list filtering is somewhat expensive.
+     Avoid doing that for the 90% case where only the standard revprops
+     have been requested and delivered. */
+  if (author && date && message && apr_hash_count(log_entry->revprops) == 3)
     {
-      for (h = apr_hash_first(pool, log_entry->changed_paths2); h;
-                                                        h = apr_hash_next(h))
-        {
-          const char *path = apr_hash_this_key(h);
-          svn_log_changed_path2_t *change = apr_hash_this_val(h);
+      revprop_count = 0;
+    }
+  else
+    {
+      svn_compat_log_revprops_clear(log_entry->revprops);
+      if (log_entry->revprops)
+        revprop_count = apr_hash_count(log_entry->revprops);
+      else
+        revprop_count = 0;
+    }
 
-          SVN_ERR(svn_ra_svn__write_data_log_changed_path(
-                      conn, pool,
-                      path,
-                      change->action,
-                      change->copyfrom_path,
-                      change->copyfrom_rev,
-                      change->node_kind,
-                      /* text_modified and props_modified are never unknown */
-                      change->text_modified  == svn_tristate_true,
-                      change->props_modified == svn_tristate_true));
-        }
+  /* Open lists once: LOG_ENTRY and LOG_ENTRY->CHANGED_PATHS. */
+  if (!b->started)
+    {
+      SVN_ERR(svn_ra_svn__start_list(conn, scratch_pool));
+      SVN_ERR(svn_ra_svn__start_list(conn, scratch_pool));
     }
-  SVN_ERR(svn_ra_svn__end_list(conn, pool));
+
+  /* Close LOG_ENTRY->CHANGED_PATHS. */
+  SVN_ERR(svn_ra_svn__end_list(conn, scratch_pool));
+  b->started = FALSE;
 
   /* send LOG_ENTRY main members */
-  SVN_ERR(svn_ra_svn__write_data_log_entry(conn, pool,
+  SVN_ERR(svn_ra_svn__write_data_log_entry(conn, scratch_pool,
                                            log_entry->revision,
                                            author, date, message,
                                            log_entry->has_children,
                                            invalid_revnum, revprop_count));
 
   /* send LOG_ENTRY->REVPROPS */
-  SVN_ERR(svn_ra_svn__start_list(conn, pool));
+  SVN_ERR(svn_ra_svn__start_list(conn, scratch_pool));
   if (revprop_count)
-    SVN_ERR(svn_ra_svn__write_proplist(conn, pool, log_entry->revprops));
-  SVN_ERR(svn_ra_svn__end_list(conn, pool));
+    SVN_ERR(svn_ra_svn__write_proplist(conn, scratch_pool,
+                                       log_entry->revprops));
+  SVN_ERR(svn_ra_svn__end_list(conn, scratch_pool));
 
   /* send LOG_ENTRY members that were added in later SVN releases */
-  SVN_ERR(svn_ra_svn__write_boolean(conn, pool, log_entry->subtractive_merge));
-  SVN_ERR(svn_ra_svn__end_list(conn, pool));
+  SVN_ERR(svn_ra_svn__write_boolean(conn, scratch_pool,
+                                    log_entry->subtractive_merge));
+  SVN_ERR(svn_ra_svn__end_list(conn, scratch_pool));
 
   if (log_entry->has_children)
     b->stack_depth++;
@@ -2361,11 +2405,14 @@ log_cmd(svn_ra_svn_conn_t *conn,
   lb.fs_path = b->repository->fs_path->data;
   lb.conn = conn;
   lb.stack_depth = 0;
-  err = svn_repos_get_logs4(b->repository->repos, full_paths, start_rev,
-                            end_rev, (int) limit, send_changed_paths,
+  lb.started = FALSE;
+  err = svn_repos_get_logs5(b->repository->repos, full_paths, start_rev,
+                            end_rev, (int) limit,
                             strict_node, include_merged_revisions,
                             revprops, authz_check_access_cb_func(b), &ab,
-                            log_receiver, &lb, pool);
+                            send_changed_paths ? path_change_receiver : NULL,
+                            send_changed_paths ? &lb : NULL,
+                            revision_receiver, &lb, pool);
 
   write_err = svn_ra_svn__write_word(conn, pool, "done");
   if (write_err)

Modified: subversion/branches/ra-git/subversion/svnserve/server.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svnserve/server.h?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/svnserve/server.h (original)
+++ subversion/branches/ra-git/subversion/svnserve/server.h Tue Oct 11 09:11:50 
2016
@@ -65,8 +65,10 @@ typedef struct repository_t {
   enum username_case_type username_case; /* Case-normalize the username? */
   svn_boolean_t use_sasl;  /* Use Cyrus SASL for authentication;
                               always false if SVN_HAVE_SASL not defined */
+#ifdef SVN_HAVE_SASL
   unsigned min_ssf;        /* min-encryption SASL parameter */
   unsigned max_ssf;        /* max-encryption SASL parameter */
+#endif
 
   enum access_type auth_access; /* access granted to authenticated users */
   enum access_type anon_access; /* access granted to annonymous users */

Modified: subversion/branches/ra-git/subversion/svnserve/svnserve.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svnserve/svnserve.c?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/svnserve/svnserve.c (original)
+++ subversion/branches/ra-git/subversion/svnserve/svnserve.c Tue Oct 11 
09:11:50 2016
@@ -221,6 +221,7 @@ void winservice_notify_stop(void)
 #define SVNSERVE_OPT_BLOCK_READ      273
 #define SVNSERVE_OPT_MAX_REQUEST     274
 #define SVNSERVE_OPT_MAX_RESPONSE    275
+#define SVNSERVE_OPT_CACHE_NODEPROPS 276
 
 /* Text macro because we can't use #ifdef sections inside a N_("...")
    macro expansion. */
@@ -318,6 +319,12 @@ static const apr_getopt_option_t svnserv
         "Default is no.\n"
         "                             "
         "[used for FSFS and FSX repositories only]")},
+    {"cache-nodeprops", SVNSERVE_OPT_CACHE_NODEPROPS, 1,
+     N_("enable or disable caching of node properties\n"
+        "                             "
+        "Default is yes.\n"
+        "                             "
+        "[used for FSFS repositories only]")},
     {"client-speed", SVNSERVE_OPT_CLIENT_SPEED, 1,
      N_("Optimize network handling based on the assumption\n"
         "                             "
@@ -714,6 +721,7 @@ sub_main(int *exit_code, int argc, const
   svn_boolean_t is_multi_threaded;
   enum connection_handling_mode handling_mode = CONNECTION_DEFAULT;
   svn_boolean_t cache_fulltexts = TRUE;
+  svn_boolean_t cache_nodeprops = TRUE;
   svn_boolean_t cache_txdeltas = TRUE;
   svn_boolean_t cache_revprops = FALSE;
   svn_boolean_t use_block_read = FALSE;
@@ -906,6 +914,10 @@ sub_main(int *exit_code, int argc, const
           cache_revprops = svn_tristate__from_word(arg) == svn_tristate_true;
           break;
 
+        case SVNSERVE_OPT_CACHE_NODEPROPS:
+          cache_nodeprops = svn_tristate__from_word(arg) == svn_tristate_true;
+          break;
+
         case SVNSERVE_OPT_BLOCK_READ:
           use_block_read = svn_tristate__from_word(arg) == svn_tristate_true;
           break;
@@ -1024,6 +1036,8 @@ sub_main(int *exit_code, int argc, const
                 cache_txdeltas ? "1" :"0");
   svn_hash_sets(params.fs_config, SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS,
                 cache_fulltexts ? "1" :"0");
+  svn_hash_sets(params.fs_config, SVN_FS_CONFIG_FSFS_CACHE_NODEPROPS,
+                cache_nodeprops ? "1" :"0");
   svn_hash_sets(params.fs_config, SVN_FS_CONFIG_FSFS_CACHE_REVPROPS,
                 cache_revprops ? "2" :"0");
   svn_hash_sets(params.fs_config, SVN_FS_CONFIG_FSFS_BLOCK_READ,

Modified: subversion/branches/ra-git/subversion/svnsync/svnsync.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svnsync/svnsync.c?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/svnsync/svnsync.c (original)
+++ subversion/branches/ra-git/subversion/svnsync/svnsync.c Tue Oct 11 09:11:50 
2016
@@ -43,7 +43,6 @@
 
 #include "svn_private_config.h"
 
-#include <apr_signal.h>
 #include <apr_uuid.h>
 
 static svn_opt_subcommand_t initialize_cmd,
@@ -324,29 +323,8 @@ typedef struct opt_baton_t {
 /*** Helper functions ***/
 
 
-/* Global record of whether the user has requested cancellation. */
-static volatile sig_atomic_t cancelled = FALSE;
-
-
-/* Callback function for apr_signal(). */
-static void
-signal_handler(int signum)
-{
-  apr_signal(signum, SIG_IGN);
-  cancelled = TRUE;
-}
-
-
 /* Cancellation callback function. */
-static svn_error_t *
-check_cancel(void *baton)
-{
-  if (cancelled)
-    return svn_error_create(SVN_ERR_CANCELLED, NULL, _("Caught signal"));
-  else
-    return SVN_NO_ERROR;
-}
-
+static svn_cancel_func_t check_cancel = 0;
 
 /* Check that the version of libraries in use match what we expect. */
 static svn_error_t *
@@ -1549,7 +1527,7 @@ do_synchronize(svn_ra_session_t *to_sess
   /* Now check to see if there are any revisions to copy. */
   SVN_ERR(svn_ra_get_latest_revnum(from_session, &from_latest, pool));
 
-  if (from_latest < last_merged)
+  if (from_latest <= last_merged)
     return SVN_NO_ERROR;
 
   /* Ok, so there are new revisions, iterate over them copying them
@@ -2363,33 +2341,7 @@ sub_main(int *exit_code, int argc, const
 
   opt_baton.source_prop_encoding = source_prop_encoding;
 
-  apr_signal(SIGINT, signal_handler);
-
-#ifdef SIGBREAK
-  /* SIGBREAK is a Win32 specific signal generated by ctrl-break. */
-  apr_signal(SIGBREAK, signal_handler);
-#endif
-
-#ifdef SIGHUP
-  apr_signal(SIGHUP, signal_handler);
-#endif
-
-#ifdef SIGTERM
-  apr_signal(SIGTERM, signal_handler);
-#endif
-
-#ifdef SIGPIPE
-  /* Disable SIGPIPE generation for the platforms that have it. */
-  apr_signal(SIGPIPE, SIG_IGN);
-#endif
-
-#ifdef SIGXFSZ
-  /* Disable SIGXFSZ generation for the platforms that have it,
-     otherwise working with large files when compiled against an APR
-     that doesn't have large file support will crash the program,
-     which is uncool. */
-  apr_signal(SIGXFSZ, SIG_IGN);
-#endif
+  check_cancel = svn_cmdline__setup_cancellation_handler();
 
   err = svn_cmdline_create_auth_baton2(
           &opt_baton.source_auth_baton,
@@ -2470,5 +2422,8 @@ main(int argc, const char *argv[])
     }
 
   svn_pool_destroy(pool);
+
+  svn_cmdline__cancellation_exit();
+
   return exit_code;
 }

Modified: subversion/branches/ra-git/subversion/tests/cmdline/authz_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/authz_tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/cmdline/authz_tests.py 
(original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/authz_tests.py Tue Oct 
11 09:11:50 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)
 
@@ -1610,6 +1612,57 @@ def authz_log_censor_revprops(sbox):
     args=['--with-revprop', 'svn:author', '--with-revprop', 's',
           '-r1', sbox.repo_url])
 
+@Skip(svntest.main.is_ra_type_file)
+def remove_access_after_commit(sbox):
+  "remove a subdir with authz file"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  svntest.main.write_restrictive_svnserve_conf(sbox.repo_dir)
+  svntest.main.write_authz_file(sbox, { "/"      : "*=rw"})
+
+  # Modification in subtree
+  sbox.simple_append('A/B/E/alpha', 'appended\n')
+  sbox.simple_append('A/D/G/rho', 'appended\n')
+  sbox.simple_commit()
+
+  svntest.main.write_authz_file(sbox, { "/"      : "*=rw",
+                                        "/A/B"   : "*=",
+                                        "/A/D"   : "*="})
+
+  # Local modification
+  sbox.simple_append('A/D/G/pi', 'appended\n')
+
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/B'  : Item(status='D '),
+    'A/D'  : Item(status='  ', treeconflict='C'),
+  })
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.tweak('A/D/G/rho',
+                      contents="This is the file 'rho'.\nappended\n")
+  expected_disk.tweak('A/D/G/pi',
+                      contents="This is the file 'pi'.\nappended\n")
+  expected_disk.remove('A/B', 'A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
+                       'A/B/F', 'A/B/lambda')
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+
+  expected_status.tweak('A/D', status='R ',treeconflict='C', )
+  expected_status.tweak('A/D', 'A/D/G', 'A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau',
+                        'A/D/H', 'A/D/H/omega', 'A/D/H/chi', 'A/D/H/psi',
+                        'A/D/gamma', copied='+', wc_rev='-')
+  expected_status.tweak('A/D/G/pi', status='M ')
+  expected_status.remove('A/B', 'A/B/E', 'A/B/E/alpha', 'A/B/E/beta', 'A/B/F',
+                         'A/B/lambda')
+
+  # And expect a mixed rev copy
+  expected_status.tweak('A/D/G/rho', status='A ', entry_status='  ')
+  svntest.actions.run_and_verify_update(wc_dir,
+                                        expected_output,
+                                        expected_disk,
+                                        expected_status,
+                                        [], True)
+
 
 ########################################################################
 # Run the tests
@@ -1646,6 +1699,7 @@ test_list = [ None,
               log_diff_dontdothat,
               authz_file_external_to_authz,
               authz_log_censor_revprops,
+              remove_access_after_commit,
              ]
 serial_only = True
 

Modified: subversion/branches/ra-git/subversion/tests/cmdline/autoprop_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/autoprop_tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/cmdline/autoprop_tests.py 
(original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/autoprop_tests.py Tue 
Oct 11 09:11:50 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/ra-git/subversion/tests/cmdline/basic_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/basic_tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/cmdline/basic_tests.py 
(original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/basic_tests.py Tue Oct 
11 09:11:50 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/ra-git/subversion/tests/cmdline/copy_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/copy_tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/copy_tests.py Tue Oct 
11 09:11:50 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/ra-git/subversion/tests/cmdline/export_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/export_tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/cmdline/export_tests.py 
(original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/export_tests.py Tue Oct 
11 09:11:50 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/ra-git/subversion/tests/cmdline/externals_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/externals_tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/cmdline/externals_tests.py 
(original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/externals_tests.py Tue 
Oct 11 09:11:50 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 ' \
@@ -3076,6 +3076,7 @@ def list_include_externals(sbox):
     expected_stdout, [], 0, 'ls', '--include-externals', C_url)
 
 @Issue(4293)
+@XFail()
 def move_with_file_externals(sbox):
   "move with file externals"
 
@@ -3243,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')
@@ -3252,18 +3253,28 @@ def file_external_unversioned_obstructio
 
   # Update reports a tree-conflict but status doesn't show any such
   # conflict.  I'm no sure whether this is correct.
-  expected_output = svntest.wc.State(wc_dir, {
-      'A'        : Item(status=' U'),
-      'A/mu-ext' : Item(status='  ', treeconflict='A'),
-      })
   expected_disk = svntest.main.greek_state.copy()
   expected_disk.add({
       'A/mu-ext' : Item('unversioned obstruction'),
       })
   expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+  svntest.actions.run_and_verify_svn(
+                  None,
+                  ".*svn: warning: W155014: The file external '.*mu-ext'"
+                  " can not be created because the node exists.*",
+                  'up', wc_dir)
+  svntest.actions.verify_disk(wc_dir, expected_disk)
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+  os.remove(sbox.ospath('A/mu-ext'))
+
+  expected_output = svntest.wc.State(wc_dir, {
+      'A/mu-ext' : Item(status='A '),
+      })
   expected_status.add({
-      'A/mu-ext' : Item(status='M ', wc_rev='2', switched='X'),
+      'A/mu-ext' : Item(status='  ', wc_rev='2', switched='X'),
       })
+  expected_disk.tweak('A/mu-ext', contents="This is the file 'mu'.\n")
   svntest.actions.run_and_verify_update(wc_dir,
                                         expected_output, expected_disk,
                                         expected_status)

Modified: subversion/branches/ra-git/subversion/tests/cmdline/import_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/import_tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/cmdline/import_tests.py 
(original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/import_tests.py Tue Oct 
11 09:11:50 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/ra-git/subversion/tests/cmdline/lock_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/lock_tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/lock_tests.py Tue Oct 
11 09:11:50 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'
   }
@@ -2337,7 +2345,6 @@ def copy_dir_with_locked_file(sbox):
                                      '-m', '')
 
 @Issue(4557)
-@XFail(svntest.main.is_ra_type_dav)
 def delete_dir_with_lots_of_locked_files(sbox):
   "delete a directory containing lots of locked files"
 
@@ -2366,12 +2373,6 @@ def delete_dir_with_lots_of_locked_files
   #                   always used a special non-standard request)
   sbox.simple_rm("A")
 
-  # But a further replacement never worked
-  sbox.simple_mkdir("A")
-  # And an additional propset didn't work either
-  # (but doesn't require all lock tokens recursively)
-  sbox.simple_propset("k", "v", "A")
-
   # Commit the deletion
   # XFAIL: As of 1.8.10, this commit fails with:
   #  svn: E175002: Unexpected HTTP status 400 'Bad Request' on '<path>'
@@ -2434,7 +2435,49 @@ 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(4634)
+@XFail(svntest.main.is_ra_type_dav)
+def replace_dir_with_lots_of_locked_files(sbox):
+  "replace directory containing lots of locked files"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # A lot of paths.
+  nfiles = 75 # NOTE: test XPASSES with 50 files!!!
+  locked_paths = []
+  for i in range(nfiles):
+      locked_paths.append(sbox.ospath("A/locked_files/file-%i" % i))
 
+  # Create files at these paths
+  os.mkdir(sbox.ospath("A/locked_files"))
+  for file_path in locked_paths:
+    svntest.main.file_write(file_path, "This is '%s'.\n" % (file_path,))
+  sbox.simple_add("A/locked_files")
+  sbox.simple_commit()
+  sbox.simple_update()
+
+  # lock all the files
+  svntest.actions.run_and_verify_svn(None, [], 'lock',
+                                     '-m', 'All locks',
+                                      *locked_paths)
+  # Locally delete A (regression against earlier versions, which
+  #                   always used a special non-standard request)
+  sbox.simple_rm("A")
+
+  # But a further replacement never worked
+  sbox.simple_mkdir("A")
+  # And an additional propset didn't work either
+  # (but doesn't require all lock tokens recursively)
+  sbox.simple_propset("k", "v", "A")
+
+  # Commit the deletion
+  # XFAIL: As of 1.8.10, this commit fails with:
+  #  svn: E175002: Unexpected HTTP status 400 'Bad Request' on '<path>'
+  # and the following error in the httpd error log:
+  #  request failed: error reading the headers
+  # This problem was introduced on the 1.8.x branch in r1606976.
+  sbox.simple_commit()
 
 ########################################################################
 # Run the tests
@@ -2503,6 +2546,7 @@ test_list = [ None,
               copy_dir_with_locked_file,
               delete_dir_with_lots_of_locked_files,
               delete_locks_on_depth_commit,
+              replace_dir_with_lots_of_locked_files,
             ]
 
 if __name__ == '__main__':

Modified: subversion/branches/ra-git/subversion/tests/cmdline/log_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/log_tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/log_tests.py Tue Oct 11 
09:11:50 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
 
@@ -2288,13 +2288,13 @@ def log_search(sbox):
   log_chain = parse_log_output(output)
   check_log_chain(log_chain, [7, 6, 3])
 
-  # search is case-sensitive
+  # search is case-insensitive
   exit_code, output, err = svntest.actions.run_and_verify_svn(
                              None, [], 'log', '--search',
                              'FOR REVISION [367]')
 
   log_chain = parse_log_output(output)
-  check_log_chain(log_chain, [])
+  check_log_chain(log_chain, [7, 6, 3])
 
   # multi-pattern search
   exit_code, output, err = svntest.actions.run_and_verify_svn(

Modified: 
subversion/branches/ra-git/subversion/tests/cmdline/merge_automatic_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/merge_automatic_tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- 
subversion/branches/ra-git/subversion/tests/cmdline/merge_automatic_tests.py 
(original)
+++ 
subversion/branches/ra-git/subversion/tests/cmdline/merge_automatic_tests.py 
Tue Oct 11 09:11:50 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/ra-git/subversion/tests/cmdline/merge_reintegrate_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/merge_reintegrate_tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- 
subversion/branches/ra-git/subversion/tests/cmdline/merge_reintegrate_tests.py 
(original)
+++ 
subversion/branches/ra-git/subversion/tests/cmdline/merge_reintegrate_tests.py 
Tue Oct 11 09:11:50 2016
@@ -2456,65 +2456,98 @@ def no_source_subtree_mergeinfo(sbox):
 
   svntest.main.file_write(sbox.ospath('A/B/E/alpha'),
                           'AAA\n' +
+                          'X\n' +
                           'BBB\n' +
+                          'Y\n' +
                           'CCC\n')
-  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
-  svntest.main.run_svn(None, 'update', wc_dir)
+  sbox.simple_commit()
+  sbox.simple_update()
 
   # Create branch-1
   svntest.main.run_svn(None, 'copy',
                        sbox.ospath('A/B'),
                        sbox.ospath('A/B1'))
-  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+  sbox.simple_commit()
 
   # Create branch-1
   svntest.main.run_svn(None, 'copy',
                        sbox.ospath('A/B'),
                        sbox.ospath('A/B2'))
-  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+  sbox.simple_commit()
 
   # Change on trunk
   svntest.main.file_write(sbox.ospath('A/B/E/alpha'),
                           'AAAxx\n' +
+                          'X\n' +
                           'BBB\n' +
+                          'Y\n' +
                           'CCC\n')
-  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+  sbox.simple_commit()
 
   # Change on branch-1
   svntest.main.file_write(sbox.ospath('A/B1/E/alpha'),
                           'AAA\n' +
+                          'X\n' +
                           'BBBxx\n' +
+                          'Y\n' +
                           'CCC\n')
-  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+  sbox.simple_commit()
 
   # Change on branch-2
   svntest.main.file_write(sbox.ospath('A/B2/E/alpha'),
                           'AAA\n' +
+                          'X\n' +
                           'BBB\n' +
+                          'Y\n' +
                           'CCCxx\n')
-  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
-  svntest.main.run_svn(None, 'update', wc_dir)
+  sbox.simple_commit()
+  sbox.simple_update()
 
   # Merge trunk to branch-1
-  svntest.main.run_svn(None, 'merge', '^/A/B', sbox.ospath('A/B1'))
-  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
-  svntest.main.run_svn(None, 'update', wc_dir)
+  # svntest.main.run_svn(None, 'merge', '^/A/B', sbox.ospath('A/B1'))
+  A_B1 = sbox.ospath('A/B1')
+  expected_output = wc.State(A_B1, {
+    'E/alpha'           : Item(status='U '),
+  })
+  expected_skip = wc.State(A_B1, { })
+  svntest.actions.run_and_verify_merge(A_B1, None, None, '^/A/B', None,
+                                       expected_output, None, None, None, None,
+                                       expected_skip, [])
+  sbox.simple_commit()
+  sbox.simple_update()
 
   # Reintegrate branch-1 subtree to trunk subtree
   run_reintegrate('^/A/B1/E', sbox.ospath('A/B/E'))
-  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
-  svntest.main.run_svn(None, 'update', wc_dir)
+  sbox.simple_commit()
+  sbox.simple_update()
 
   # Merge trunk to branch-2
-  svntest.main.run_svn(None, 'merge', '^/A/B', sbox.ospath('A/B2'))
-  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+  #svntest.main.run_svn(None, 'merge', '^/A/B', sbox.ospath('A/B2'))
+  A_B2 = sbox.ospath('A/B2')
+  expected_output = wc.State(A_B2, {
+    'E'                 : Item(status=' U'),
+    'E/alpha'           : Item(status='U '),
+  })
+  expected_skip = wc.State(A_B1, { })
+  svntest.actions.run_and_verify_merge(A_B2, None, None, '^/A/B', None,
+                                       expected_output, None, None, None, None,
+                                       expected_skip, [])
+  sbox.simple_commit()
   svntest.main.run_svn(None, 'update', wc_dir)
 
   # Reverse merge branch-1 subtree to branch-2 subtree, this removes
   # the subtree mergeinfo from branch 2
-  svntest.main.run_svn(None, 'merge', '-r8:2',
-                       '^/A/B1/E', sbox.ospath('A/B2/E'))
-  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+  #svntest.main.run_svn(None, 'merge', '-r8:2',
+  #                     '^/A/B1/E', sbox.ospath('A/B2/E'))
+  A_B2_E = sbox.ospath('A/B2/E')
+  expected_output = wc.State(A_B2_E, {
+    'alpha'             : Item(status='U '),
+  })
+  expected_skip = wc.State(A_B2_E, { })
+  svntest.actions.run_and_verify_merge(A_B2_E, 8, 2, '^/A/B1/E', None,
+                                       expected_output, None, None, None, None,
+                                       expected_skip, [])
+  sbox.simple_commit()
   svntest.main.run_svn(None, 'update', wc_dir)
 
   # Verify that merge results in no subtree mergeinfo
@@ -2525,8 +2558,8 @@ def no_source_subtree_mergeinfo(sbox):
 
   # Merge trunk to branch-2
   svntest.main.run_svn(None, 'merge', '^/A/B', sbox.ospath('A/B2'))
-  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
-  svntest.main.run_svn(None, 'update', wc_dir)
+  sbox.simple_commit()
+  sbox.simple_update()
 
   # Verify that there is still no subtree mergeinfo
   svntest.actions.run_and_verify_svn([], expected_stderr,
@@ -2550,7 +2583,9 @@ def no_source_subtree_mergeinfo(sbox):
       ''        : Item(props={SVN_PROP_MERGEINFO : '/A/B2:4-12'}),
       'E'       : Item(),
       'E/alpha' : Item("AAA\n" +
+                       "X\n" +
                        "BBB\n" +
+                       "Y\n" +
                        "CCCxx\n"),
       'E/beta'  : Item("This is the file 'beta'.\n"),
       'F'       : Item(),

Modified: subversion/branches/ra-git/subversion/tests/cmdline/merge_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/merge_tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/cmdline/merge_tests.py 
(original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/merge_tests.py Tue Oct 
11 09:11:50 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/ra-git/subversion/tests/cmdline/merge_tree_conflict_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/merge_tree_conflict_tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- 
subversion/branches/ra-git/subversion/tests/cmdline/merge_tree_conflict_tests.py
 (original)
+++ 
subversion/branches/ra-git/subversion/tests/cmdline/merge_tree_conflict_tests.py
 Tue Oct 11 09:11:50 2016
@@ -2192,6 +2192,178 @@ def merge_obstruction_recording(sbox):
 
   # A resolver action could be smarter though...
 
+def added_revision_recording_in_tree_conflict(sbox):
+  "tree conflict stores added revision for victim"
+
+  sbox.build(empty=True)
+  wc_dir = sbox.wc_dir
+
+  sbox.simple_mkdir('trunk')
+  sbox.simple_commit() #r1
+
+  # Create a branch
+  svntest.actions.run_and_verify_svn(None, [],
+                                     'copy', sbox.repo_url + '/trunk',
+                                     sbox.repo_url + '/branch',
+                                     '-mcopy') # r2
+
+  sbox.simple_add_text('The file on trunk\n', 'trunk/foo')
+  sbox.simple_commit() #r3
+
+  sbox.simple_update()
+
+  # Merge ^/trunk into ^/branch
+  expected_output = svntest.wc.State(sbox.ospath('branch'), {
+    'foo'          : Item(status='A '),
+  })
+  expected_mergeinfo_output = wc.State(sbox.ospath('branch'), {
+    ''                  : Item(status=' U')
+  })
+  expected_elision_output = wc.State(wc_dir, {
+  })
+  expected_disk = wc.State('', {
+    'foo'              : Item(contents="The file on trunk\n"),
+    '.'                 : Item(props={u'svn:mergeinfo': u'/trunk:2-3'}),
+  })
+  expected_status = wc.State(sbox.ospath('branch'), {
+    ''                  : Item(status=' M', wc_rev='3'),
+    'foo'              : Item(status='A ', copied='+', wc_rev='-'),
+  })
+  expected_skip = wc.State('', {
+  })
+  svntest.actions.run_and_verify_merge(sbox.ospath('branch'), None, None,
+                                       sbox.repo_url + '/trunk',
+                                       None,
+                                       expected_output,
+                                       expected_mergeinfo_output,
+                                       expected_elision_output,
+                                       expected_disk,
+                                       expected_status,
+                                       expected_skip,
+                                       check_props=True)
+
+  sbox.simple_commit() #r4
+
+  # Edit the file on the branch
+  sbox.simple_append('branch/foo', 'The file on the branch\n')
+  sbox.simple_commit() #r5
+
+  # Replace file with a directory on trunk
+  sbox.simple_rm('trunk/foo')
+  sbox.simple_mkdir('trunk/foo')
+  sbox.simple_commit() #r6
+
+  sbox.simple_update()
+
+  # Merge ^/trunk into ^/branch
+  expected_output = svntest.wc.State(sbox.ospath('branch'), {
+    'foo'               : Item(status='  ', treeconflict='C')
+  })
+  expected_mergeinfo_output = wc.State(sbox.ospath('branch'), {
+    ''                  : Item(status=' U'),
+  })
+  expected_elision_output = wc.State(wc_dir, {
+  })
+  expected_disk = wc.State('', {
+    'foo'     : Item(contents="The file on trunk\nThe file on the branch\n"),
+      '.'     : Item(props={u'svn:mergeinfo': u'/trunk:2-6'}),
+  })
+  expected_status = wc.State(sbox.ospath('branch'), {
+    ''                  : Item(status=' M', wc_rev='6'),
+    'foo'               : Item(status='  ', treeconflict='C', wc_rev='6'),
+  })
+  expected_skip = wc.State('', {
+  })
+  svntest.actions.run_and_verify_merge(sbox.ospath('branch'), None, None,
+                                       sbox.repo_url + '/trunk',
+                                       None,
+                                       expected_output,
+                                       expected_mergeinfo_output,
+                                       expected_elision_output,
+                                       expected_disk,
+                                       expected_status,
+                                       expected_skip,
+                                       check_props=True)
+
+  # Ensure that revisions in tree conflict info match what we expect.
+  # We used to record source left as ^/trunk/foo@1 instead of ^/trunk/foo@3.
+  # Note that foo was first added in r3.
+  expected_info = [
+    {
+      "Path" : re.escape(sbox.ospath('branch/foo')),
+      "Tree conflict": re.escape(
+        'local file edit, incoming replace with dir upon merge' +
+        ' Source  left: (file) ^/trunk/foo@3' +
+        ' Source right: (dir) ^/trunk/foo@6'),
+    },
+  ]
+  svntest.actions.run_and_verify_info(expected_info, sbox.ospath('branch/foo'))
+
+def spurios_tree_conflict_with_added_file(sbox):
+  "spurious tree conflict with unmodified added file"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Create a branch of A, A_copy
+  sbox.simple_copy('A', 'A_branch')
+  sbox.simple_commit()
+
+  # Create a new file on the trunk
+  sbox.simple_append('A/new', 'new\n')
+  sbox.simple_add('A/new')
+  sbox.simple_commit()
+
+  # Sync the branch with the trunk
+  sbox.simple_update()
+  expected_output = wc.State(wc_dir, {
+    "A_branch/new" : Item(status="A "),
+    })
+  expected_skip = wc.State('', { })
+  svntest.actions.run_and_verify_merge(sbox.ospath('A_branch'),
+                                       None, None, '^/A', None,
+                                       expected_output,
+                                       None, None,
+                                       None, None, expected_skip)
+  sbox.simple_commit()
+
+  # Reintegrate the branch (a no-op change, but users are free to do this)
+  sbox.simple_update()
+  expected_output = wc.State(wc_dir, { })
+  svntest.actions.run_and_verify_merge(sbox.ospath('A'),
+                                       None, None, '^/A_branch', None,
+                                       expected_output,
+                                       None, None,
+                                       None, None, expected_skip,
+                                       [], False, True, '--reintegrate',
+                                       sbox.ospath('A'))
+
+  # Delete the new file on the branch
+  sbox.simple_rm('A_branch/new')
+  sbox.simple_commit()
+
+  # Make an unrelated change on the trunk
+  sbox.simple_append('A/mu', 'more text\n')
+  sbox.simple_commit()
+
+  # Merge the trunk to the branch. Forcing a reintegrate merge here since
+  # this is what the automatic merge does, as of the time this test was 
written.
+  # This merge would raise an 'local missing vs incoming edit' tree conflict
+  # on the new file, which is bogus since there are no incoming edits.
+  expected_output = wc.State(wc_dir, {
+    'A_branch/mu' : Item(status='U '),
+  })
+  expected_mergeinfo_output = wc.State(wc_dir, {
+    'A_branch' : Item(status=' U'),
+    })
+  svntest.actions.run_and_verify_merge(sbox.ospath('A_branch'),
+                                       None, None, '^/A', None,
+                                       expected_output,
+                                       expected_mergeinfo_output, None,
+                                       None, None, expected_skip,
+                                       [], False, True, '--reintegrate',
+                                       sbox.ospath('A_branch'))
+
 
 ########################################################################
 # Run the tests
@@ -2225,6 +2397,8 @@ test_list = [ None,
               merge_replace_on_del_fails,
               merge_conflict_details,
               merge_obstruction_recording,
+              added_revision_recording_in_tree_conflict,
+              spurios_tree_conflict_with_added_file,
              ]
 
 if __name__ == '__main__':

Modified: 
subversion/branches/ra-git/subversion/tests/cmdline/mod_authz_svn_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/mod_authz_svn_tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/cmdline/mod_authz_svn_tests.py 
(original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/mod_authz_svn_tests.py 
Tue Oct 11 09:11:50 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)


Reply via email to