Modified: subversion/branches/ra-git/tools/dev/svnmover/scanlog.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dev/svnmover/scanlog.c?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dev/svnmover/scanlog.c (original)
+++ subversion/branches/ra-git/tools/dev/svnmover/scanlog.c Tue Oct 11 09:11:50 
2016
@@ -119,7 +119,7 @@ svn_client__format_move_chain_for_displa
   return s;
 }
 
-struct scan_moves_log_receiver_baton {
+typedef struct scan_moves_log_receiver_baton {
   /*const char *anchor_abspath;*/
   svn_client_ctx_t *ctx;
   svn_revnum_t start;
@@ -162,7 +162,7 @@ struct scan_moves_log_receiver_baton {
   apr_hash_t *moves_by_target_path;
 } scan_moves_log_receiver_baton;
 
-struct copy_info {
+typedef struct copy_info {
   const char *copyto_path;
   const char *copyfrom_path;
   svn_revnum_t copyfrom_rev;

Modified: subversion/branches/ra-git/tools/dev/svnmover/svnmover.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dev/svnmover/svnmover.c?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dev/svnmover/svnmover.c (original)
+++ subversion/branches/ra-git/tools/dev/svnmover/svnmover.c Tue Oct 11 
09:11:50 2016
@@ -917,6 +917,7 @@ svn_branch__replay(svn_branch__txn_t *ed
               SVN_ERR(svn_branch__txn_open_branch(edit_txn, &edit_subbranch,
                                                   new_branch_id,
                                                   
svn_branch__root_eid(right_subbranch),
+                                                  NULL /*tree_ref*/,
                                                   scratch_pool, scratch_pool));
             }
 
@@ -1095,6 +1096,7 @@ update_wc_base_r(svnmover_wc_t *wc,
                                                   &base_subbranch,
                                                   new_branch_id,
                                                   
svn_branch__root_eid(work_subbranch),
+                                                  NULL /*tree_ref*/,
                                                   scratch_pool, scratch_pool));
               SVN_ERR(svn_branch__state_get_history(
                         work_subbranch, &history, scratch_pool));
@@ -1743,7 +1745,7 @@ list_branches(svn_branch__txn_t *txn,
 
       SVN_ERR(list_branch(branch, with_elements, scratch_pool));
       if (with_elements) /* separate branches by a blank line */
-        svnmover_notify("");
+        svnmover_notify("%s", "");
     }
 
   for (i = 0; i < branches->nelts; i++)
@@ -1767,7 +1769,7 @@ list_branches(svn_branch__txn_t *txn,
         }
       SVN_ERR(list_branch(branch, with_elements, scratch_pool));
       if (with_elements) /* separate branches by a blank line */
-        svnmover_notify("");
+        svnmover_notify("%s", "");
     }
 
   return SVN_NO_ERROR;
@@ -1794,7 +1796,7 @@ list_all_branches(svn_branch__txn_t *txn
 
       SVN_ERR(list_branch(branch, with_elements, scratch_pool));
       if (with_elements) /* separate branches by a blank line */
-        svnmover_notify("");
+        svnmover_notify("%s", "");
     }
 
   return SVN_NO_ERROR;
@@ -2432,7 +2434,7 @@ do_put_file(svn_branch__txn_t *txn,
       SVN_ERR(svn_stream_open_readonly(&src, local_file_path,
                                        scratch_pool, scratch_pool));
     else
-      SVN_ERR(svn_stream_for_stdin(&src, scratch_pool));
+      SVN_ERR(svn_stream_for_stdin2(&src, FALSE, scratch_pool));
 
     svn_stringbuf_from_stream(&text, src, 0, scratch_pool);
   }
@@ -2634,6 +2636,7 @@ do_mkbranch(const char **new_branch_id_p
                                       scratch_pool);
   SVN_ERR(svn_branch__txn_open_branch(txn, &new_branch,
                                       new_branch_id, new_inner_eid,
+                                      NULL /*tree_ref*/,
                                       scratch_pool, scratch_pool));
   SVN_ERR(svn_branch__state_alter_one(new_branch, new_inner_eid,
                                       -1, "", payload, scratch_pool));
@@ -2683,9 +2686,9 @@ do_branch(svn_branch__state_t **new_bran
 
   new_branch_id = svn_branch__id_nest(to_outer_branch_id, to_outer_eid,
                                       scratch_pool);
-  SVN_ERR(svn_branch__txn_branch(txn, &new_branch,
-                                 from, new_branch_id,
-                                 result_pool, scratch_pool));
+  SVN_ERR(svn_branch__txn_open_branch(txn, &new_branch,
+                                      new_branch_id, from->eid, from,
+                                      result_pool, scratch_pool));
   history = svn_branch__history_create_empty(scratch_pool);
   SVN_ERR(svn_branch__history_add_parent(history, from->rev, from->bid,
                                          scratch_pool));
@@ -2718,9 +2721,9 @@ do_topbranch(svn_branch__state_t **new_b
   SVN_ERR(svn_branch__txn_new_eid(txn, &outer_eid, scratch_pool));
   new_branch_id = svn_branch__id_nest(NULL /*outer_branch*/, outer_eid,
                                       scratch_pool);
-  SVN_ERR(svn_branch__txn_branch(txn, &new_branch,
-                                 from, new_branch_id,
-                                 result_pool, scratch_pool));
+  SVN_ERR(svn_branch__txn_open_branch(txn, &new_branch,
+                                      new_branch_id, from->eid, from,
+                                      result_pool, scratch_pool));
 
   svnmover_notify_v("A+   (branch %s)",
                     new_branch->bid);

Modified: subversion/branches/ra-git/tools/dev/unix-build/Makefile.svn
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dev/unix-build/Makefile.svn?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/ra-git/tools/dev/unix-build/Makefile.svn Tue Oct 11 
09:11:50 2016
@@ -154,7 +154,6 @@ GNU_ICONV_URL       = https://ftp.gnu.org/pub/
 APR_UTIL_URL   = https://svn.apache.org/repos/asf/apr/apr-util
 HTTPD_URL      = https://archive.apache.org/dist/httpd/$(HTTPD_DIST)
 NEON_URL       = http://webdav.org/neon/$(NEON_DIST)
-#SERF_URL      = http://serf.googlecode.com/files/$(SERF_DIST)
 SERF_URL       = https://svn.apache.org/repos/asf/serf/tags/$(SERF_VER)
 SERF_OLD_URL   = https://svn.apache.org/repos/asf/serf/tags/$(SERF_OLD_VER)
 SQLITE_URL     = https://www.sqlite.org/2014/$(SQLITE_DIST)
@@ -807,8 +806,6 @@ serf-clean:
 #$(SERF_OBJDIR)/.retrieved: $(DISTDIR)/$(SERF_DIST)
 #      [ -d $(SERF_OBJDIR) ] || mkdir -p $(SERF_OBJDIR)
 #      tar -C $(SRCDIR) -zxf $(DISTDIR)/$(SERF_DIST)
-#      cd $(SRCDIR)/serf-$(SERF_VER) && \
-#              svn diff -c1394 http://serf.googlecode.com/svn | patch -p2
 #      touch $@
 
 # retrieve serf if not present yet
@@ -1353,6 +1350,7 @@ $(LIBGIT2_OBJDIR)/.installed: $(LIBGIT2_
 
 svn-install-all: svn-install svn-bindings-install
 
+svn-retrieve:  $(SVN_OBJDIR)/.retrieved
 svn-configure: $(SVN_OBJDIR)/.configured
 svn-compile:   $(SVN_OBJDIR)/.compiled
 svn-bindings-compile:  $(SVN_OBJDIR)/.bindings-compiled

Modified: subversion/branches/ra-git/tools/dev/wc-format.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dev/wc-format.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dev/wc-format.py (original)
+++ subversion/branches/ra-git/tools/dev/wc-format.py Tue Oct 11 09:11:50 2016
@@ -53,7 +53,7 @@ def print_format(wc_path):
   #   1.6.x: format 10
   #   1.7.x: format 29
   formatno = get_format(wc_path)
-  print '%s: %s' % (wc_path, formatno)
+  print('%s: %s' % (wc_path, formatno))
 
 
 if __name__ == '__main__':

Modified: subversion/branches/ra-git/tools/dev/wc-ng/bump-to-19.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dev/wc-ng/bump-to-19.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dev/wc-ng/bump-to-19.py (original)
+++ subversion/branches/ra-git/tools/dev/wc-ng/bump-to-19.py Tue Oct 11 
09:11:50 2016
@@ -254,7 +254,7 @@ def migrate_wc_subdirs(wc_root_path):
       dirs.remove(dot_svn)
     except ValueError:
       # a non-WC dir: don't walk into any subdirectories
-      print "skipped: ", NotASubversionWC(dir_path)
+      print("skipped: ", NotASubversionWC(dir_path))
       del dirs[:]
       continue
 
@@ -265,18 +265,18 @@ def migrate_wc_subdirs(wc_root_path):
         wc_subdir_path = wc_subdir_path[2:]
 
       if not select_subdir(wc_subdir_path):
-        print "skipped:", wc_subdir_path
+        print("skipped:", wc_subdir_path)
         dirs.remove(dir)
         continue
 
       try:
         check_wc_format_number(wc_subdir_path)
-        print "migrating '" + wc_subdir_path + "'"
+        print("migrating '" + wc_subdir_path + "'")
         copy_db_rows_to_wcroot(wc_subdir_path)
         move_and_shard_pristine_files(wc_subdir_path, '.')
         migrated_subdirs += [wc_subdir_path]
-      except (WrongFormatException, NotASubversionWC), e:
-        print "skipped:", e
+      except (WrongFormatException, NotASubversionWC) as e:
+        print("skipped:", e)
         # don't walk into it
         dirs.remove(dir)
         continue
@@ -285,22 +285,22 @@ def migrate_wc_subdirs(wc_root_path):
   # Make a note of any problems in deleting.
   failed_delete_subdirs = []
   for wc_subdir_path in migrated_subdirs:
-    print "deleting " + dotsvn_path(wc_subdir_path)
+    print("deleting " + dotsvn_path(wc_subdir_path))
     try:
       os.remove(db_path(wc_subdir_path))
       if os.path.exists(pristine_path(wc_subdir_path)):
         os.rmdir(pristine_path(wc_subdir_path))
       shutil.rmtree(tmp_path(wc_subdir_path))
       os.rmdir(dotsvn_path(wc_subdir_path))
-    except Exception, e:
-      print e
+    except Exception as e:
+      print(e)
       failed_delete_subdirs += [wc_subdir_path]
 
   # Notify any problems in deleting
   if failed_delete_subdirs:
-    print "Failed to delete the following directories. Please delete them 
manually."
+    print("Failed to delete the following directories. Please delete them 
manually.")
     for wc_subdir_path in failed_delete_subdirs:
-      print "  " + dotsvn_path(wc_subdir_path)
+      print("  " + dotsvn_path(wc_subdir_path))
 
   os.chdir(old_cwd)
 
@@ -339,18 +339,18 @@ def bump_wc_format_number(wc_path):
 if __name__ == '__main__':
 
   if len(sys.argv) != 2:
-    print __doc__
+    print(__doc__)
     sys.exit(1)
 
   wc_root_path = sys.argv[1]
 
   try:
     check_wc_format_number(wc_root_path)
-  except (WrongFormatException, NotASubversionWC), e:
-    print "error:", e
+  except (WrongFormatException, NotASubversionWC) as e:
+    print("error:", e)
     sys.exit(1)
 
-  print "merging subdir DBs into single DB '" + wc_root_path + "'"
+  print("merging subdir DBs into single DB '" + wc_root_path + "'")
   move_and_shard_pristine_files(wc_root_path, wc_root_path)
   migrate_wc_subdirs(wc_root_path)
   bump_wc_format_number(wc_root_path)

Modified: subversion/branches/ra-git/tools/dev/wc-ng/populate-pristine.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dev/wc-ng/populate-pristine.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dev/wc-ng/populate-pristine.py (original)
+++ subversion/branches/ra-git/tools/dev/wc-ng/populate-pristine.py Tue Oct 11 
09:11:50 2016
@@ -103,6 +103,6 @@ if __name__ == '__main__':
   for wc_path in paths:
     try:
       populate(wc_path)
-    except UnknownFormat, e:
+    except UnknownFormat as e:
       sys.stderr.write("Don't know how to handle '%s' (format %d)'\n"
                        % (wc_path, e.formatno))

Modified: subversion/branches/ra-git/tools/dev/which-error.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dev/which-error.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dev/which-error.py (original)
+++ subversion/branches/ra-git/tools/dev/which-error.py Tue Oct 11 09:11:50 2016
@@ -36,7 +36,7 @@ import re
 
 try:
   from svn import core
-except ImportError, e:
+except ImportError as e:
   sys.stderr.write("ERROR: Unable to import Subversion's Python bindings: 
'%s'\n" \
                    "Hint: Set your PYTHONPATH environment variable, or adjust 
your " \
                    "PYTHONSTARTUP\nfile to point to your Subversion install " \
@@ -95,6 +95,8 @@ def print_error(code):
   except KeyError:
     if code == -41:
       print("Sit by a lake.")
+    elif code >= 120100 and code < 121000:
+      print('%08d  <error code from libserf; see serf.h>' % (code))
     else:
       print('%08d  *** UNKNOWN ERROR CODE ***' % (code))
 

Propchange: subversion/branches/ra-git/tools/dist/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Oct 11 09:11:50 2016
@@ -1,3 +1,4 @@
+svn-test-work
 prefix
 tempdir
 deploy

Modified: subversion/branches/ra-git/tools/dist/backport.pl
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dist/backport.pl?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dist/backport.pl (original)
+++ subversion/branches/ra-git/tools/dist/backport.pl Tue Oct 11 09:11:50 2016
@@ -9,11 +9,11 @@ use v5.10.0; # needed for $^V
 # experimental and "subject to change" in v5.18 (see perl5180delta).  Every
 # use of it now triggers a warning.
 #
-# As of Perl v5.20.1, the semantics of given/when provided by Perl are
+# As of Perl v5.22.1, the semantics of given/when provided by Perl are
 # compatible with those expected by the script, so disable the warning for
 # those Perls.  But don't try to disable the the warning category on Perls
 # that don't know that category, since that breaks compilation.
-no if (v5.17.0 le $^V and $^V le v5.20.1),
+no if (v5.17.0 le $^V and $^V le v5.22.1),
    warnings => 'experimental::smartmatch';
 
 # Licensed to the Apache Software Foundation (ASF) under one
@@ -41,7 +41,7 @@ use File::Copy qw/copy move/;
 use File::Temp qw/tempfile/;
 use IO::Select ();
 use IPC::Open3 qw/open3/;
-use POSIX qw/ctermid strftime isprint isspace/;
+use POSIX qw/ctermid strftime/;
 use Text::Wrap qw/wrap/;
 use Tie::File ();
 
@@ -51,6 +51,7 @@ use Tie::File ();
 #
 # TODO: document which are interpreted by sh and which should point to binary.
 my $SVN = $ENV{SVN} || 'svn'; # passed unquoted to sh
+$SVN .= " --config-option=config:miscellany:log-encoding=UTF-8";
 my $SHELL = $ENV{SHELL} // '/bin/sh';
 my $VIM = 'vim';
 my $EDITOR = $ENV{SVN_EDITOR} // $ENV{VISUAL} // $ENV{EDITOR} // 'ed';
@@ -113,7 +114,7 @@ my $STATUS = './STATUS';
 my $STATEFILE = './.backports1';
 my $BRANCHES = '^/subversion/branches';
 my $TRUNK = '^/subversion/trunk';
-$ENV{LC_ALL} = "C";  # since we parse 'svn info' output and use isprint()
+$ENV{LC_ALL} = "C";  # since we parse 'svn info' output
 
 # Globals.
 my %ERRORS = ();
@@ -311,11 +312,11 @@ sub prompt {
       ReadMode 'normal';
       die if $@ or not defined $answer;
       # Swallow terminal escape codes (e.g., arrow keys).
-      unless (isprint $answer or isspace $answer) {
+      unless ($answer =~ m/^(?:[[:print:]]+|\s+)$/) {
         $answer = (ReadKey -1) while defined $answer;
         # TODO: provide an indication that the keystroke was sensed and 
ignored.
       }
-    } until defined $answer and (isprint $answer or isspace $answer);
+    } until defined $answer and ($answer =~ m/^(?:[[:print:]]+|\s+)$/);
     print $answer;
     return $answer;
   };

Modified: subversion/branches/ra-git/tools/dist/backport/merger.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dist/backport/merger.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dist/backport/merger.py (original)
+++ subversion/branches/ra-git/tools/dist/backport/merger.py Tue Oct 11 
09:11:50 2016
@@ -23,12 +23,14 @@ backport.merger - library for running ST
 
 import backport.status
 
+import contextlib
 import functools
 import logging
 import os
 import re
 import subprocess
 import sys
+import tempfile
 import time
 import unittest
 
@@ -43,25 +45,26 @@ class UnableToMergeException(Exception):
   pass
 
 
-def invoke_svn(argv, extra_env={}):
+def invoke_svn(argv):
   "Run svn with ARGV as argv[1:].  Return (exit_code, stdout, stderr)."
   # TODO(interactive mode): disable --non-interactive
   child_env = os.environ.copy()
-  child_env.update(extra_env)
-  child = subprocess.Popen([SVN, '--non-interactive'] + argv,
+  child_env.update({'LC_ALL': 'C'})
+  argv = [SVN, '--non-interactive', 
'--config-option=config:miscellany:log-encoding=UTF-8'] + argv
+  child = subprocess.Popen(argv,
                            stdout=subprocess.PIPE,
                            stderr=subprocess.PIPE,
                            env=child_env)
   stdout, stderr = child.communicate()
   return child.returncode, stdout.decode('UTF-8'), stderr.decode('UTF-8')
 
-def run_svn(argv, expected_stderr=None, extra_env={'LC_ALL': 'C'}):
+def run_svn(argv, expected_stderr=None):
   """Run svn with ARGV as argv[1:].  If EXPECTED_STDERR is None, raise if the
   exit code is non-zero or stderr is non-empty.  Else, treat EXPECTED_STDERR as
   a regexp, and ignore an errorful exit or stderr messages if the latter match
   the regexp.  Return exit_code, stdout, stderr."""
 
-  exit_code, stdout, stderr = invoke_svn(argv, extra_env)
+  exit_code, stdout, stderr = invoke_svn(argv)
   if exit_code == 0 and not stderr:
     return exit_code, stdout, stderr
   elif expected_stderr and re.compile(expected_stderr).search(stderr):
@@ -141,6 +144,14 @@ def _includes_only_svn_mergeinfo_changes
   return False
 
 
+@contextlib.contextmanager
+def log_message_file(logmsg):
+  "Context manager that returns a file containing the text LOGMSG."
+  with tempfile.NamedTemporaryFile(mode='w+', encoding="UTF-8") as logmsg_file:
+    logmsg_file.write(logmsg)
+    logmsg_file.flush()
+    yield logmsg_file.name
+  
 def merge(entry, expected_stderr=None, *, commit=False):
   """Merges ENTRY into the working copy at cwd.
 
@@ -209,7 +220,9 @@ def merge(entry, expected_stderr=None, *
       s = s[:-1]
     open('./STATUS', 'w').write(s)
 
-    run_svn_quiet(['commit', '-m', logmsg])
+    # Don't assume we can pass UTF-8 in argv.
+    with log_message_file(logmsg) as logmsg_filename:
+      run_svn_quiet(['commit', '-F', logmsg_filename])
 
   # TODO(interactive mode): add the 'svn status' display
 
@@ -217,9 +230,9 @@ def merge(entry, expected_stderr=None, *
     revnum = last_changed_revision('./STATUS')
     
     if commit:
-      # TODO: disable this for test runs
       # Sleep to avoid out-of-order commit notifications
-      time.sleep(15)
+      if not os.getenv("SVN_BACKPORT_DONT_SLEEP"): # enabled by the test suite
+          time.sleep(15)
       second_logmsg = "Remove the {!r} branch, {} in r{}."\
                           .format(entry.branch, reintegrated_word, revnum)
       run_svn(['rm', '-m', second_logmsg, '--', branch_url])

Modified: subversion/branches/ra-git/tools/dist/backport_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dist/backport_tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dist/backport_tests.py (original)
+++ subversion/branches/ra-git/tools/dist/backport_tests.py Tue Oct 11 09:11:50 
2016
@@ -646,6 +646,22 @@ def backport_STATUS_mods(sbox):
                                 expected_stdout, expected_stderr)
 
 #----------------------------------------------------------------------
+@BackportTest('76cee987-25c9-4d6c-ad40-000000000012')
+def backport_unicode_entry(sbox):
+  "an entry containing literal UTF-8"
+
+  # r6: nominate r4
+  approved_entries = [
+    make_entry([4], notes="Hello 🗺"),
+  ]
+  sbox.simple_append(STATUS, serialize_STATUS(approved_entries))
+  sbox.simple_commit(message='Nominate r4')
+
+  # Run it.
+  run_backport(sbox)
+
+
+#----------------------------------------------------------------------
 
 ########################################################################
 # Run the tests
@@ -663,11 +679,14 @@ test_list = [ None,
               backport_branch_with_original_revision,
               backport_otherproject_change,
               backport_STATUS_mods,
+              backport_unicode_entry,
               # When adding a new test, include the test number in the last
-              # 6 bytes of the UUID.
+              # 6 bytes of the UUID, in decimal.
              ]
 
 if __name__ == '__main__':
+  # Using putenv() here is fine because this file is never run as a module.
+  os.putenv('SVN_BACKPORT_DONT_SLEEP', '1')
   svntest.main.run_tests(test_list)
   # NOTREACHED
 

Modified: subversion/branches/ra-git/tools/dist/collect_sigs.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dist/collect_sigs.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dist/collect_sigs.py (original)
+++ subversion/branches/ra-git/tools/dist/collect_sigs.py Tue Oct 11 09:11:50 
2016
@@ -42,7 +42,7 @@ def make_config():
   'Output a blank config file'
 
   if os.path.exists('config.py'):
-    print "'config.py' already exists!'"
+    print("'config.py' already exists!'")
     sys.exit(1)
 
   conf = open('config.py', 'w')
@@ -51,7 +51,7 @@ def make_config():
   conf.write("filesdir = ''\n")
   conf.close()
 
-  print "'config.py' generated"
+  print("'config.py' generated")
 
 def make_db():
   'Initialize a blank database'
@@ -114,9 +114,9 @@ try:
   sys.path.append(os.path.dirname(sys.argv[0]))
   import config
 except:
-  print 'Content-type: text/plain'
+  print('Content-type: text/plain')
   print
-  print 'Cannot find config file'
+  print('Cannot find config file')
   sys.exit(1)
 
 r = re.compile('^\[GNUPG\:\] GOODSIG (\w*) (.*)')
@@ -310,8 +310,8 @@ def cat_signatures(basename):
     return (open(ascfile, 'r').read())
 
 def print_content_type(mimetype):
-  print "Content-Type: " + mimetype
-  print
+  print("Content-Type: " + mimetype)
+  print("")
 
 def main():
   form = cgi.FieldStorage()
@@ -332,7 +332,7 @@ def main():
     elif basename[:-4] in files():
       # early exit; bypass 'content' entirely
       print_content_type('text/plain')
-      print cat_signatures(basename)
+      print(cat_signatures(basename))
       return
 
   # These are "global" values, not specific to our action.
@@ -344,7 +344,7 @@ def main():
   print_content_type('text/html')
 
   template = string.Template(shell_content)
-  print template.safe_substitute(mapping)
+  print(template.safe_substitute(mapping))
 
 
 if __name__ == '__main__':

Modified: subversion/branches/ra-git/tools/dist/detect-conflicting-backports.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dist/detect-conflicting-backports.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dist/detect-conflicting-backports.py 
(original)
+++ subversion/branches/ra-git/tools/dist/detect-conflicting-backports.py Tue 
Oct 11 09:11:50 2016
@@ -69,7 +69,7 @@ if sys.argv[1:]:
   sys.exit(0)
 
 backport.merger.no_local_mods('./STATUS')
-sf = backport.status.StatusFile(open('./STATUS'))
+sf = backport.status.StatusFile(open('./STATUS', encoding="UTF-8"))
 
 ERRORS = collections.defaultdict(list)
 

Modified: subversion/branches/ra-git/tools/dist/merge-approved-backports.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dist/merge-approved-backports.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/dist/merge-approved-backports.py (original)
+++ subversion/branches/ra-git/tools/dist/merge-approved-backports.py Tue Oct 
11 09:11:50 2016
@@ -40,7 +40,7 @@ if sys.argv[1:]:
   sys.exit(0)
 
 backport.merger.no_local_mods('./STATUS')
-sf = backport.status.StatusFile(open('./STATUS'))
+sf = backport.status.StatusFile(open('./STATUS', encoding="UTF-8"))
 
 # Duplicate sf.paragraphs, since merge() will be removing elements from it.
 entries_paras = list(sf.entries_paras())

Modified: subversion/branches/ra-git/tools/examples/get-location-segments.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/examples/get-location-segments.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/examples/get-location-segments.py 
(original)
+++ subversion/branches/ra-git/tools/examples/get-location-segments.py Tue Oct 
11 09:11:50 2016
@@ -73,14 +73,14 @@ def parse_args(args):
 
 
 def prompt_func_ssl_unknown_cert(realm, failures, cert_info, may_save, pool):
-  print "The certficate details are as follows:"
-  print "--------------------------------------"
-  print "Issuer     : " + str(cert_info.issuer_dname)
-  print "Hostname   : " + str(cert_info.hostname)
-  print "ValidFrom  : " + str(cert_info.valid_from)
-  print "ValidUpto  : " + str(cert_info.valid_until)
-  print "Fingerprint: " + str(cert_info.fingerprint)
-  print ""
+  print( "The certficate details are as follows:")
+  print("--------------------------------------")
+  print("Issuer     : " + str(cert_info.issuer_dname))
+  print("Hostname   : " + str(cert_info.hostname))
+  print("ValidFrom  : " + str(cert_info.valid_from))
+  print("ValidUpto  : " + str(cert_info.valid_until))
+  print("Fingerprint: " + str(cert_info.fingerprint))
+  print("")
   ssl_trust = core.svn_auth_cred_ssl_server_trust_t()
   if may_save:
     choice = raw_input( "accept (t)temporarily   (p)permanently: ")
@@ -111,7 +111,7 @@ def prompt_func_gnome_keyring_prompt(key
 def main():
   try:
     url, peg_revision, start_revision, end_revision = parse_args(sys.argv[1:])
-  except Exception, e:
+  except Exception as e:
     sys.stderr.write("""Usage: %s URL[@PEG-REV] [START-REV[:END-REV]]
 
 Trace the history of URL@PEG-REV, printing the location(s) of its

Modified: subversion/branches/ra-git/tools/hook-scripts/svn2feed.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/hook-scripts/svn2feed.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/hook-scripts/svn2feed.py (original)
+++ subversion/branches/ra-git/tools/hook-scripts/svn2feed.py Tue Oct 11 
09:11:50 2016
@@ -363,7 +363,7 @@ def main():
                                         "feed-url=",
                                         "format=",
                                         ])
-    except getopt.GetoptError, msg:
+    except getopt.GetoptError as msg:
         usage_and_exit(msg)
 
     # Make sure required arguments are present.
@@ -394,7 +394,7 @@ def main():
         elif opt in ("-m", "--max-items"):
             try:
                max_items = int(arg)
-            except ValueError, msg:
+            except ValueError as msg:
                usage_and_exit("Invalid value '%s' for --max-items." % (arg))
             if max_items < 1:
                usage_and_exit("Value for --max-items must be a positive "
@@ -427,7 +427,7 @@ def main():
         cmd_out = proc.stdout.readlines()
         try:
             revisions = [int(cmd_out[0])]
-        except IndexError, msg:
+        except IndexError as msg:
             usage_and_exit("svn2feed.py: Invalid value '%s' for " \
                            "REPOS-PATH" % (repos_path))
     else:
@@ -447,7 +447,7 @@ def main():
                 revisions = list(range(start, end + 1)[-max_items:])
             else:
                 raise ValueError()
-        except ValueError, msg:
+        except ValueError as msg:
             usage_and_exit("svn2feed.py: Invalid value '%s' for --revision." \
                            % (commit_rev))
 

Modified: subversion/branches/ra-git/tools/hook-scripts/svnperms.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/hook-scripts/svnperms.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/hook-scripts/svnperms.py (original)
+++ subversion/branches/ra-git/tools/hook-scripts/svnperms.py Tue Oct 11 
09:11:50 2016
@@ -296,7 +296,7 @@ class MissingArgumentsException(Exceptio
 def parse_options():
     try:
         opts, args = my_getopt(sys.argv[1:], "f:s:r:t:R:A:h", ["help"])
-    except getopt.GetoptError, e:
+    except getopt.GetoptError as e:
         raise Error(e.msg)
     class Options: pass
     obj = Options()
@@ -349,11 +349,11 @@ def main():
         check_perms(opts.filename, opts.section,
                     opts.repository, opts.transaction, opts.revision,
                     opts.author)
-    except MissingArgumentsException, e:
+    except MissingArgumentsException as e:
         sys.stderr.write("%s\n" % str(e))
         sys.stderr.write(USAGE)
         sys.exit(1)
-    except Error, e:
+    except Error as e:
         sys.stderr.write("error: %s\n" % str(e))
         sys.exit(1)
 

Modified: subversion/branches/ra-git/tools/po/l10n-report.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/po/l10n-report.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/po/l10n-report.py (original)
+++ subversion/branches/ra-git/tools/po/l10n-report.py Tue Oct 11 09:11:50 2016
@@ -159,7 +159,7 @@ def main():
                                        ["help",
                                         "to-email-id=",
                                         ])
-    except getopt.GetoptError, msg:
+    except getopt.GetoptError as msg:
         usage_and_exit(msg)
 
     to_email_id = None

Modified: subversion/branches/ra-git/tools/server-side/fsfs-reshard.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/server-side/fsfs-reshard.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/server-side/fsfs-reshard.py (original)
+++ subversion/branches/ra-git/tools/server-side/fsfs-reshard.py Tue Oct 11 
09:11:50 2016
@@ -277,7 +277,7 @@ def shard(path, max_files_per_shard, sta
   tmp = path + '.reshard'
   try:
     os.mkdir(tmp)
-  except OSError, e:
+  except OSError as e:
     if e.errno != EEXIST:
       raise
 
@@ -335,7 +335,7 @@ def main():
 
   try:
     max_files_per_shard = int(max_files_per_shard)
-  except ValueError, OverflowError:
+  except ValueError as OverflowError:
     sys.stderr.write("error: maximum files per shard ('%s') is not a valid 
number.\n" \
       % max_files_per_shard)
     sys.stderr.flush()

Modified: subversion/branches/ra-git/tools/server-side/svn-backup-dumps.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/server-side/svn-backup-dumps.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/server-side/svn-backup-dumps.py (original)
+++ subversion/branches/ra-git/tools/server-side/svn-backup-dumps.py Tue Oct 11 
09:11:50 2016
@@ -255,8 +255,8 @@ class SvnBackupOutputCommand(SvnBackupOu
         try:
             proc = Popen(cmd, stdin=PIPE, stdout=self.__ofd, shell=False)
         except:
-            print (256, "", "Popen failed (%s ...):\n  %s" % (cmd[0],
-                    str(sys.exc_info()[1])))
+            print((256, "", "Popen failed (%s ...):\n  %s" % (cmd[0],
+                  str(sys.exc_info()[1]))))
             sys.exit(256)
         self.__proc  = proc
         self.__stdin = proc.stdin
@@ -471,7 +471,7 @@ class SvnBackup:
             ftp.quit()
             rc = len(ifd.read(1)) == 0
             ifd.close()
-        except Exception, e:
+        except Exception as e:
             raise SvnBackupException("ftp transfer failed:\n  file:  '%s'\n  
error: %s" % \
                     (absfilename, str(e)))
         return rc
@@ -680,7 +680,7 @@ if __name__ == "__main__":
     try:
         backup = SvnBackup(options, args)
         rc = backup.execute()
-    except SvnBackupException, e:
+    except SvnBackupException as e:
         print("svn-backup-dumps.py: %s" % e)
     if rc:
         print("Everything OK.")

Modified: 
subversion/branches/ra-git/tools/server-side/svn-populate-node-origins-index.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/server-side/svn-populate-node-origins-index.c?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- 
subversion/branches/ra-git/tools/server-side/svn-populate-node-origins-index.c 
(original)
+++ 
subversion/branches/ra-git/tools/server-side/svn-populate-node-origins-index.c 
Tue Oct 11 09:11:50 2016
@@ -71,28 +71,19 @@ index_revision_adds(int *count, svn_fs_t
                     svn_revnum_t revision, apr_pool_t *pool)
 {
   svn_fs_root_t *root;
-  apr_hash_t *changes;
-  apr_hash_index_t *hi;
-  apr_pool_t *subpool;
+  apr_pool_t *subpool = svn_pool_create(pool);
+
+  svn_fs_path_change_iterator_t *iterator;
+  svn_fs_path_change3_t *change;
 
   *count = 0;
   SVN_ERR(svn_fs_revision_root(&root, fs, revision, pool));
-  SVN_ERR(svn_fs_paths_changed2(&changes, root, pool));
-
-  /* No paths changed in this revision?  Nothing to do.  */
-  if (apr_hash_count(changes) == 0)
-    return SVN_NO_ERROR;
+  SVN_ERR(svn_fs_paths_changed3(&iterator, root, pool, subpool));
+  SVN_ERR(svn_fs_path_change_get(&change, iterator));
 
-  subpool = svn_pool_create(pool);
-  for (hi = apr_hash_first(pool, changes); hi; hi = apr_hash_next(hi))
+  while (change)
     {
-      const void *path;
-      void *val;
-      svn_fs_path_change2_t *change;
-
       svn_pool_clear(subpool);
-      apr_hash_this(hi, &path, NULL, &val);
-      change = val;
       if ((change->change_kind == svn_fs_path_change_add)
           || (change->change_kind == svn_fs_path_change_replace))
         {
@@ -100,10 +91,13 @@ index_revision_adds(int *count, svn_fs_t
                             && SVN_IS_VALID_REVNUM(change->copyfrom_rev)))
             {
               svn_revnum_t origin;
-              SVN_ERR(svn_fs_node_origin_rev(&origin, root, path, subpool));
+              SVN_ERR(svn_fs_node_origin_rev(&origin, root,
+                                             change->path.data, subpool));
               (*count)++;
             }
         }
+
+      SVN_ERR(svn_fs_path_change_get(&change, iterator));
     }
   svn_pool_destroy(subpool);
 

Modified: subversion/branches/ra-git/tools/server-side/svnpredumpfilter.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/server-side/svnpredumpfilter.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/server-side/svnpredumpfilter.py (original)
+++ subversion/branches/ra-git/tools/server-side/svnpredumpfilter.py Tue Oct 11 
09:11:50 2016
@@ -243,21 +243,21 @@ def svn_log_stream_get_dependencies(stre
   return dt
 
 def analyze_logs(included_paths):
-  print "Initial include paths:"
+  print("Initial include paths:")
   for path in included_paths:
-    print " + /%s" % (path)
+    print(" + /%s" % (path))
 
   dt = svn_log_stream_get_dependencies(sys.stdin, included_paths)
 
   if dt.dependent_paths:
     found_new_deps = True
-    print "Dependent include paths found:"
+    print("Dependent include paths found:")
     for path in dt.dependent_paths:
-      print " + /%s" % (path)
-    print "You need to also include them (or one of their parents)."
+      print(" + /%s" % (path))
+    print("You need to also include them (or one of their parents).")
   else:
     found_new_deps = False
-    print "No new dependencies found!"
+    print("No new dependencies found!")
     parents = {}
     for path in dt.include_paths:
       while 1:
@@ -268,11 +268,11 @@ def analyze_logs(included_paths):
         path = parent
     parents = parents.keys()
     if parents:
-      print "You might still need to manually create parent directories " \
-            "for the included paths before loading a filtered dump:"
+      print("You might still need to manually create parent directories " \
+            "for the included paths before loading a filtered dump:")
       parents.sort(compare_paths)
       for parent in parents:
-        print "   /%s" % (parent)
+        print("   /%s" % (parent))
 
   return found_new_deps and EXIT_MOREDEPS or EXIT_SUCCESS
 
@@ -291,7 +291,7 @@ def main():
   try:
     opts, args = getopt.getopt(sys.argv[1:], "hv",
                                ["help", "verbose", "targets="])
-  except getopt.GetoptError, e:
+  except getopt.GetoptError as e:
     usage_and_exit(str(e))
 
   for option, value in opts:
@@ -323,7 +323,7 @@ def main():
       usage_and_exit("Valid subcommands are 'include' and 'exclude'")
   except SystemExit:
     raise
-  except (LogStreamError, EOFError), e:
+  except (LogStreamError, EOFError) as e:
     log("ERROR: " + str(e), 0)
     sys.exit(EXIT_FAILURE)
   except:

Modified: subversion/branches/ra-git/tools/server-side/svnpubsub/daemonize.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/server-side/svnpubsub/daemonize.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/server-side/svnpubsub/daemonize.py 
(original)
+++ subversion/branches/ra-git/tools/server-side/svnpubsub/daemonize.py Tue Oct 
11 09:11:50 2016
@@ -24,6 +24,7 @@ import os
 import signal
 import sys
 import time
+import stat
 import multiprocessing  # requires Python 2.6
 
 
@@ -51,7 +52,7 @@ class Daemon(object):
   def daemonize_exit(self):
     try:
       result = self.daemonize()
-    except (ChildFailed, DaemonFailed), e:
+    except (ChildFailed, DaemonFailed) as e:
       # duplicate the exit code
       sys.exit(e.code)
     except (ChildTerminatedAbnormally, ChildForkFailed,
@@ -122,7 +123,7 @@ class Daemon(object):
     # perform the second fork
     try:
       pid = os.fork()
-    except OSError, e:
+    except OSError as e:
       ### this won't make it to the parent process
       raise DaemonForkFailed(e.errno, e.strerror)
 
@@ -179,7 +180,8 @@ class Daemon(object):
           os.remove(self.pidfile)
         except OSError:
           pass
-        fd = os.open(self.pidfile, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0444)
+        fd = os.open(self.pidfile, os.O_WRONLY | os.O_CREAT | os.O_EXCL,
+                     stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
         os.write(fd, '%d\n' % pid)
         os.close(fd)
 

Modified: subversion/branches/ra-git/tools/server-side/svnpubsub/irkerbridge.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/server-side/svnpubsub/irkerbridge.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/server-side/svnpubsub/irkerbridge.py 
(original)
+++ subversion/branches/ra-git/tools/server-side/svnpubsub/irkerbridge.py Tue 
Oct 11 09:11:50 2016
@@ -86,7 +86,6 @@ import sys
 import posixpath
 import socket
 import json
-import urlparse
 import optparse
 import ConfigParser
 import traceback
@@ -95,6 +94,14 @@ import re
 import fnmatch
 from string import Template
 
+try:
+  # Python >=3.0
+  from urllib.parse import urlparse
+except ImportError:
+  # Python <3.0
+  from urlparse import urlparse
+
+
 # Packages that come with svnpubsub
 import svnpubsub.client
 import daemonize
@@ -110,7 +117,7 @@ class Daemon(daemonize.Daemon):
     pass
 
   def run(self):
-    print 'irkerbridge started, pid=%d' % (os.getpid())
+    print('irkerbridge started, pid=%d' % (os.getpid()))
 
     mc = svnpubsub.client.MultiClient(self.bdec.urls,
                                       self.bdec.commit,
@@ -197,7 +204,7 @@ class BigDoEverythingClass(object):
     json_msg = json.dumps(msg)
     sock.sendto(json_msg, (irker_list[0],int(irker_list[1])))
     if self.options.verbose:
-      print "SENT: %s to %s" % (json_msg, irker)
+      print("SENT: %s to %s" % (json_msg, irker))
 
   def join_all(self):
     # Like self.commit(), but ignores self.config.get(section, "template").
@@ -212,8 +219,8 @@ class BigDoEverythingClass(object):
 
   def commit(self, url, commit):
     if self.options.verbose:
-      print "RECV: from %s" % url
-      print json.dumps(vars(commit), indent=2)
+      print("RECV: from %s" % url)
+      print(json.dumps(vars(commit), indent=2))
 
     try:
       config_sections = self.locate_matching_configs(commit)
@@ -233,14 +240,14 @@ class BigDoEverythingClass(object):
             self._send(irker, msg)
 
     except:
-      print "Unexpected error:"
+      print("Unexpected error:")
       traceback.print_exc()
       sys.stdout.flush()
       raise
 
   def event(self, url, event_name, event_arg):
     if self.options.verbose or event_name != "ping":
-      print 'EVENT: %s from %s' % (event_name, url)
+      print('EVENT: %s from %s' % (event_name, url))
       sys.stdout.flush()
 
 
@@ -258,7 +265,7 @@ class ReloadableConfig(ConfigParser.Safe
     self.reload()
 
   def reload(self):
-    print "RELOAD: config file: %s" % self.fname
+    print("RELOAD: config file: %s" % self.fname)
     sys.stdout.flush()
 
     # Delete everything. Just re-reading would overlay, and would not

Modified: subversion/branches/ra-git/tools/server-side/svnpubsub/svntweet.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/server-side/svnpubsub/svntweet.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/server-side/svnpubsub/svntweet.py 
(original)
+++ subversion/branches/ra-git/tools/server-side/svnpubsub/svntweet.py Tue Oct 
11 09:11:50 2016
@@ -42,7 +42,13 @@ from twisted.internet import defer, reac
 from twisted.python import failure, log
 from twisted.web.client import HTTPClientFactory, HTTPPageDownloader
 
-from urlparse import urlparse
+try:
+  # Python >=3.0
+  from urllib.parse import urlparse
+except ImportError:
+  # Python <3.0
+  from urlparse import urlparse
+
 import time
 import posixpath
 
@@ -50,7 +56,7 @@ sys.path.insert(0, os.path.join(os.path.
 try:
     import twitter
 except:
-    print "Get a copy of twitty-twister from 
<http://github.com/dustin/twitty-twister>"
+    print("Get a copy of twitty-twister from 
<http://github.com/dustin/twitty-twister>")
     sys.exit(-1)
 class Config(object):
     def __init__(self, path):
@@ -231,7 +237,7 @@ def main(config_file):
 
 if __name__ == "__main__":
     if len(sys.argv) != 2:
-        print "invalid args, read source code"
+        print("invalid args, read source code")
         sys.exit(0)
     log.startLogging(sys.stdout)
     main(sys.argv[1])

Modified: subversion/branches/ra-git/tools/server-side/svnpubsub/svnwcsub.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/server-side/svnpubsub/svnwcsub.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/server-side/svnpubsub/svnwcsub.py 
(original)
+++ subversion/branches/ra-git/tools/server-side/svnpubsub/svnwcsub.py Tue Oct 
11 09:11:50 2016
@@ -47,6 +47,7 @@ import errno
 import subprocess
 import threading
 import sys
+import stat
 import os
 import re
 import posixpath
@@ -482,7 +483,7 @@ def handle_options(options):
         except OSError:
             pass
         fd = os.open(options.pidfile, os.O_WRONLY | os.O_CREAT | os.O_EXCL,
-                     0444)
+                     stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
         os.write(fd, '%d\n' % pid)
         os.close(fd)
         logging.info('pid %d written to %s', pid, options.pidfile)

Modified: 
subversion/branches/ra-git/tools/server-side/test_svn_server_log_parse.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/server-side/test_svn_server_log_parse.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/tools/server-side/test_svn_server_log_parse.py 
(original)
+++ subversion/branches/ra-git/tools/server-side/test_svn_server_log_parse.py 
Tue Oct 11 09:11:50 2016
@@ -607,5 +607,5 @@ if __name__ == '__main__':
     finally:
         try:
             os.unlink(tmp)
-        except Exception, e:
+        except Exception as e:
             sys.stderr.write('os.unlink(tmp): %s\n' % (e,))

Modified: subversion/branches/ra-git/win-tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/win-tests.py?rev=1764214&r1=1764213&r2=1764214&view=diff
==============================================================================
--- subversion/branches/ra-git/win-tests.py (original)
+++ subversion/branches/ra-git/win-tests.py Tue Oct 11 09:11:50 2016
@@ -86,6 +86,7 @@ def _usage_exit():
   print("  --ssl-cert             : Path to SSL server certificate to trust.")
   print("  --https                : Run Apache httpd with an https setup.")
   print("  --http2                : Enable http2 in Apache Httpd (>= 2.4.17).")
+  print("  --mod-deflate          : Enable mod_deflate in Apache Httpd.")
   print("  --global-scheduler     : Enable global scheduler.")
   print("  --exclusive-wc-locks   : Enable exclusive working copy locks")
   print("  --memcached-dir=DIR    : Run memcached from dir")
@@ -138,7 +139,7 @@ opts, args = my_getopt(sys.argv[1:], 'hr
                         'disable-http-v2', 'disable-bulk-updates', 'help',
                         'fsfs-packing', 'fsfs-sharding=', 'javahl', 'swig=',
                         'list', 'enable-sasl', 'bin=', 'parallel', 'http2',
-                        'global-scheduler',
+                        'mod-deflate', 'global-scheduler',
                         'config-file=', 'server-minor-version=', 'log-level=',
                         'log-to-stdout', 'mode-filter=', 'milestone-filter=',
                         'ssl-cert=', 'exclusive-wc-locks', 'memcached-server=',
@@ -162,6 +163,7 @@ httpd_service = None
 httpd_no_log = None
 use_ssl = False
 use_http2 = False
+use_mod_deflate = False
 http_short_circuit = False
 advertise_httpv2 = True
 http_bulk_updates = True
@@ -226,6 +228,8 @@ for opt, val in opts:
     use_ssl = 1
   elif opt == '--http2':
     use_http2 = 1
+  elif opt == '--mod-deflate':
+    use_mod_deflate = 1
   elif opt == '--http-short-circuit':
     http_short_circuit = True
   elif opt == '--disable-http-v2':
@@ -471,8 +475,8 @@ class Svnserve:
 class Httpd:
   "Run httpd for DAV tests"
   def __init__(self, abs_httpd_dir, abs_objdir, abs_builddir, abs_srcdir,
-               httpd_port, service, use_ssl, use_http2, no_log, httpv2,
-               short_circuit, bulk_updates):
+               httpd_port, service, use_ssl, use_http2, use_mod_deflate,
+               no_log, httpv2, short_circuit, bulk_updates):
     self.name = 'apache.exe'
     self.httpd_port = httpd_port
     self.httpd_dir = abs_httpd_dir
@@ -574,6 +578,8 @@ class Httpd:
       fp.write(self._sys_module('ssl_module', 'mod_ssl.so'))
     if use_http2:
       fp.write(self._sys_module('http2_module', 'mod_http2.so'))
+    if use_mod_deflate:
+      fp.write(self._sys_module('deflate_module', 'mod_deflate.so'))
     fp.write(self._sys_module('dav_module', 'mod_dav.so'))
     if self.httpd_ver >= 2.3:
       fp.write(self._sys_module('access_compat_module', 
'mod_access_compat.so'))
@@ -610,6 +616,9 @@ class Httpd:
       fp.write('Protocols h2c http/1.1\n')
       fp.write('H2Direct on\n')
 
+    if use_mod_deflate:
+      fp.write('SetOutputFilter DEFLATE\n')
+
     # Don't handle .htaccess, symlinks, etc.
     fp.write('<Directory />\n')
     fp.write('AllowOverride None\n')
@@ -1019,8 +1028,8 @@ if not list_tests:
   if run_httpd:
     daemon = Httpd(abs_httpd_dir, abs_objdir, abs_builddir, abs_srcdir,
                    httpd_port, httpd_service, use_ssl, use_http2,
-                   httpd_no_log, advertise_httpv2, http_short_circuit,
-                   http_bulk_updates)
+                   use_mod_deflate, httpd_no_log, advertise_httpv2,
+                   http_short_circuit, http_bulk_updates)
 
     if use_ssl and not ssl_cert:
       ssl_cert = daemon.certfile


Reply via email to