You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/10/11 21:52:46 UTC

svn commit: r1182053 [2/30] - in /subversion/branches/svn_mutex: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ contrib/client-side/ contrib/hook-scripts/enforcer/ contrib/server-side/ notes/ notes/merge-tr...

Modified: subversion/branches/svn_mutex/build/generator/gen_win.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/build/generator/gen_win.py?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/build/generator/gen_win.py (original)
+++ subversion/branches/svn_mutex/build/generator/gen_win.py Tue Oct 11 19:52:34 2011
@@ -1021,8 +1021,8 @@ class WinGeneratorBase(GeneratorBase):
       neonlib = self.neon_lib+(cfg == 'Debug' and 'd.lib' or '.lib')
 
     if self.serf_lib:
-      if self.serf_ver_maj == 1:
-        serflib = 'serf-1.lib'
+      if self.serf_ver_maj != 0:
+        serflib = 'serf-%d.lib' % self.serf_ver_maj
       else:
         serflib = 'serf.lib'
 
@@ -1181,8 +1181,8 @@ class WinGeneratorBase(GeneratorBase):
       return
 
     serf_path = os.path.abspath(self.serf_path)
-    if self.serf_ver_maj == 1:
-      serflib = 'serf-1.lib'
+    if self.serf_ver_maj != 0:
+      serflib = 'serf-%d.lib' % self.serf_ver_maj
     else:
       serflib = 'serf.lib'
 

Modified: subversion/branches/svn_mutex/build/generator/swig/__init__.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/build/generator/swig/__init__.py?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/build/generator/swig/__init__.py (original)
+++ subversion/branches/svn_mutex/build/generator/swig/__init__.py Tue Oct 11 19:52:34 2011
@@ -59,19 +59,12 @@ class Generator:
 
     # Calculate SWIG paths
     self.swig_path = swig_path
-    try:
-      self.swig_libdir = _exec.output([self.swig_path, "-swiglib"], strip=1)
-    except AssertionError:
-      pass
+    self.swig_libdir = _exec.output([self.swig_path, "-swiglib"], strip=1)
 
   def version(self):
     """Get the version number of SWIG"""
-    try:
-      swig_version = _exec.output([self.swig_path, "-version"])
-      m = re.search("Version (\d+).(\d+).(\d+)", swig_version)
-      if m:
-        return (m.group(1), m.group(2), m.group(3))
-    except AssertionError:
-      pass
+    swig_version = _exec.output([self.swig_path, "-version"])
+    m = re.search("Version (\d+).(\d+).(\d+)", swig_version)
+    if m:
+      return (m.group(1), m.group(2), m.group(3))
     return (0, 0, 0)
-

Modified: subversion/branches/svn_mutex/build/generator/swig/header_wrappers.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/build/generator/swig/header_wrappers.py?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/build/generator/swig/header_wrappers.py (original)
+++ subversion/branches/svn_mutex/build/generator/swig/header_wrappers.py Tue Oct 11 19:52:34 2011
@@ -65,7 +65,13 @@ class Generator(generator.swig.Generator
       )
     makefile.write('SWIG_WRAPPERS = %s\n\n' % ' '.join(wrapper_fnames))
     for short_name in self.short.values():
-      makefile.write('autogen-swig-%s: $(SWIG_WRAPPERS)\n' % short_name)
+      # swig-pl needs the '.swig_checked' target here; swig-rb and swig-py
+      # already reach it via a different dependency chain:
+      #
+      #    In build-outputs.mk, swig-py and swig-rb targets depend on *.la
+      #    targets, which depend on *.lo targets, which depend on *.c targets,
+      #    which depend on .swig_checked target.
+      makefile.write('autogen-swig-%s: .swig_checked $(SWIG_WRAPPERS)\n' % short_name)
     makefile.write('\n\n')
 
   def proxy_filename(self, include_filename):

Modified: subversion/branches/svn_mutex/build/generator/templates/neon.vcxproj.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/build/generator/templates/neon.vcxproj.ezt?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/build/generator/templates/neon.vcxproj.ezt (original)
+++ subversion/branches/svn_mutex/build/generator/templates/neon.vcxproj.ezt Tue Oct 11 19:52:34 2011
@@ -33,6 +33,7 @@
 [for platforms][for configs]  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='[configs]|[platforms]'" Label="Configuration">
     <ConfigurationType>Makefile</ConfigurationType>
     <UseDebugLibraries>[is configs "Debug"]true[else]false[end]</UseDebugLibraries>
+    <PlatformToolset>v100</PlatformToolset>
   </PropertyGroup>
 [end][end]  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">

Modified: subversion/branches/svn_mutex/build/generator/templates/serf.vcxproj.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/build/generator/templates/serf.vcxproj.ezt?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/build/generator/templates/serf.vcxproj.ezt (original)
+++ subversion/branches/svn_mutex/build/generator/templates/serf.vcxproj.ezt Tue Oct 11 19:52:34 2011
@@ -34,6 +34,7 @@
 [for platforms][for configs]  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='[configs]|[platforms]'" Label="Configuration">
     <ConfigurationType>Makefile</ConfigurationType>
     <UseDebugLibraries>[is configs "Debug"]true[else]false[end]</UseDebugLibraries>
+    <PlatformToolset>v100</PlatformToolset>
   </PropertyGroup>
 [end][end]  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">

Modified: subversion/branches/svn_mutex/build/generator/templates/zlib.vcxproj.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/build/generator/templates/zlib.vcxproj.ezt?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/build/generator/templates/zlib.vcxproj.ezt (original)
+++ subversion/branches/svn_mutex/build/generator/templates/zlib.vcxproj.ezt Tue Oct 11 19:52:34 2011
@@ -33,6 +33,7 @@
 [for platforms][for configs]  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='[configs]|[platforms]'" Label="Configuration">
     <ConfigurationType>Makefile</ConfigurationType>
     <UseDebugLibraries>[is configs "Debug"]true[else]false[end]</UseDebugLibraries>
+    <PlatformToolset>v100</PlatformToolset>
   </PropertyGroup>
 [end][end]  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">

Modified: subversion/branches/svn_mutex/build/run_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/build/run_tests.py?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/build/run_tests.py (original)
+++ subversion/branches/svn_mutex/build/run_tests.py Tue Oct 11 19:52:34 2011
@@ -44,6 +44,7 @@ separated list of test numbers; the defa
 
 # A few useful constants
 LINE_LENGTH = 45
+SVN_VER_MINOR = 8
 
 import os, re, subprocess, sys, imp
 from datetime import datetime
@@ -108,6 +109,13 @@ class TestHarness:
     self.fs_type = fs_type
     self.http_library = http_library
     self.server_minor_version = server_minor_version
+    # If you change the below condition then change in
+    # ../subversion/tests/cmdline/svntest/main.py too.
+    if server_minor_version is not None:
+      if int(server_minor_version) not in range(3, 1+SVN_VER_MINOR):
+        sys.stderr.write("Test harness only supports server minor versions 3-%d\n"
+                         % SVN_VER_MINOR)
+        sys.exit(1)
     self.verbose = verbose
     self.cleanup = cleanup
     self.enable_sasl = enable_sasl
@@ -293,7 +301,6 @@ class TestHarness:
                  '--srcdir=' + os.path.join(self.srcdir, progdir)]
       if self.config_file is not None:
         cmdline.append('--config-file=' + self.config_file)
-      cmdline.append('--trap-assertion-failures')
     else:
       print('Don\'t know what to do about ' + progbase)
       sys.exit(1)
@@ -339,6 +346,10 @@ class TestHarness:
                             stderr=self.log)
     line = prog.stdout.readline()
     while line:
+      if sys.platform == 'win32':
+        # Remove CRs inserted because we parse the output as binary.
+        line = line.replace('\r', '')
+
       # If using --log-to-stdout self.log in None.
       if self.log:
         self.log.write(line)
@@ -441,11 +452,16 @@ class TestHarness:
     else:
       test_selection = []
 
-    failed = svntest.main.execute_tests(prog_mod.test_list,
-                                        serial_only=serial_only,
-                                        test_name=progbase,
-                                        progress_func=prog_f,
-                                        test_selection=test_selection)
+    try:
+      failed = svntest.main.execute_tests(prog_mod.test_list,
+                                          serial_only=serial_only,
+                                          test_name=progbase,
+                                          progress_func=prog_f,
+                                          test_selection=test_selection)
+    except svntest.Failure:
+      if self.log:
+        os.write(old_stdout, '.' * dot_count)
+      failed = True
 
     # restore some values
     sys.path = old_path

Modified: subversion/branches/svn_mutex/build/transform_sql.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/build/transform_sql.py?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/build/transform_sql.py (original)
+++ subversion/branches/svn_mutex/build/transform_sql.py Tue Oct 11 19:52:34 2011
@@ -103,6 +103,11 @@ class Processor(object):
     for line in input.split('\n'):
       line = line.replace('"', '\\"')
 
+      # '/'+1 == '0'
+      line = re.sub(r'IS_STRICT_DESCENDANT_OF[(]([A-Za-z_.]+), ([?][0-9]+)[)]',
+                    r"((\1) > (\2) || '/' AND (\1) < (\2) || '0') ",
+                    line)
+
       if line.strip():
         handled = False
 

Modified: subversion/branches/svn_mutex/configure.ac
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/configure.ac?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/configure.ac (original)
+++ subversion/branches/svn_mutex/configure.ac Tue Oct 11 19:52:34 2011
@@ -105,7 +105,6 @@ if test `expr $apr_version : 2` -ne 0; t
   AC_SUBST(SVN_APRUTIL_INCLUDES)
   AC_SUBST(SVN_APRUTIL_CONFIG, ["$apu_config"])
   AC_SUBST(SVN_APRUTIL_LIBS)
-  AC_SUBST(SVN_APRUTIL_PREFIX)
 else
   SVN_LT_SOVERSION="-version-info 0"
   APU_VER_REGEXES=["0\.9\.[7-9] 0\.9\.1[0-9] 1\."]
@@ -215,15 +214,21 @@ AC_DEFINE_UNQUOTED(SVN_LOCALE_DIR, "${sv
                    [Defined to be the path to the installed locale dirs])
 
 dnl Check for libtool -- we'll definitely need it for all our shared libs!
-AC_ARG_WITH(custom-libtool,
-AS_HELP_STRING([--with-custom-libtool=PATH],
-               [Specify the command to run libtool]),
-               [ AC_MSG_NOTICE([using $withval as libtool])
-                 sh_libtool="$withval" ],
-               [ AC_MSG_NOTICE([using APR's libtool])
-                 sh_libtool="`$apr_config --apr-libtool`" ])
-LIBTOOL="$sh_libtool"
-SVN_LIBTOOL="$sh_libtool"
+AC_MSG_NOTICE([configuring libtool now])
+ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL])
+AC_ARG_ENABLE(experimental-libtool,
+  AS_HELP_STRING([--enable-experimental-libtool],[Use APR's libtool]),
+  [experimental_libtool=$enableval],[experimental_libtool=no])
+
+if test "$experimental_libtool" = "yes"; then
+  echo "using APR's libtool"
+  sh_libtool="`$apr_config --apr-libtool`"
+  LIBTOOL="$sh_libtool"
+  SVN_LIBTOOL="$sh_libtool"
+else
+  sh_libtool="$abs_builddir/libtool"
+  SVN_LIBTOOL="\$(SHELL) $sh_libtool"
+fi
 AC_SUBST(SVN_LIBTOOL)
 
 dnl Determine the libtool version
@@ -562,6 +567,25 @@ int main()
   fi
 fi
 
+dnl GPG Agent -------------------
+
+AC_ARG_WITH(gpg_agent,
+AS_HELP_STRING([--without-gpg-agent], 
+               [Disable support for GPG-Agent]),
+               [with_gpg_agent=no], [with_gpg_agent=yes])
+AC_MSG_CHECKING([whether to support GPG-Agent])
+if test "$svn_enable_shared" != "yes"; then
+  AC_MSG_RESULT([no (shared library support is disabled)])
+elif test "$with_gpg_agent" = "yes"; then
+  AC_MSG_RESULT([yes])
+  AC_DEFINE([SVN_HAVE_GPG_AGENT], [1], 
+            [Is GPG Agent support enabled?])
+else
+  AC_MSG_RESULT([no])
+fi
+
+AC_SUBST(SVN_HAVE_GPG_AGENT)
+
 dnl GNOME Keyring -------------------
 
 AC_ARG_WITH(gnome_keyring,
@@ -713,7 +737,7 @@ AC_ARG_WITH(libmagic,AS_HELP_STRING([--w
       AC_CHECK_LIB(magic, magic_open, [libmagic_found="builtin"])
     ])
     libmagic_prefix="the default locations"
-  else
+  elif test "$withval" != "no"; then
     libmagic_prefix=$withval
     save_cppflags="$CPPFLAGS"
     CPPFLAGS="$CPPFLAGS -I$libmagic_prefix/include"
@@ -1100,12 +1124,20 @@ SVN_CHECK_JDK($JAVA_OLDEST_WORKING_VER)
 
 AC_PATH_PROG(PERL, perl, none)
 
-AC_PATH_PROGS(RUBY, "$RUBY" ruby ruby1.9 ruby19 ruby1.8 ruby18, none)
+if test -n "$RUBY"; then
+  AC_PATH_PROG(RUBY, "$RUBY", none)
+else
+  AC_PATH_PROGS(RUBY, ruby ruby1.8 ruby18, none)
+fi
 if test "$RUBY" != "none"; then
   AC_MSG_CHECKING([rb_hash_foreach])
   if "$RUBY" -r mkmf -e 'exit(have_func("rb_hash_foreach") ? 0 : 1)' >/dev/null; then
     AC_MSG_RESULT([yes])
-    AC_PATH_PROGS(RDOC, "$RDOC" rdoc rdoc1.9 rdoc19 rdoc1.8 rdoc18, none)
+    if test -n "$RDOC"; then
+      AC_PATH_PROG(RDOC, "$RDOC", none)
+    else
+      AC_PATH_PROGS(RDOC, rdoc rdoc1.8 rdoc18, none)
+    fi
     AC_CACHE_CHECK([for Ruby major version], [svn_cv_ruby_major],[
     svn_cv_ruby_major="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(MAJOR))'`"
     ])
@@ -1118,6 +1150,13 @@ if test "$RUBY" != "none"; then
 
     AC_SUBST(RUBY_MAJOR)
     AC_SUBST(RUBY_MINOR)
+    if test ! \( "$RUBY_MAJOR" -eq "1" -a "$RUBY_MINOR" -eq "8" \); then
+      # Disallow Ruby 1.9 or later until the binding tests get fixed
+      # to run with those versions.
+      RUBY="none"
+      AC_MSG_WARN([The detected Ruby is too new for Subversion to use])
+      AC_MSG_WARN([Only 1.8.x releases are supported at this time])
+    fi
   else
     AC_MSG_RESULT([no])
     RUBY="none"

Modified: subversion/branches/svn_mutex/contrib/client-side/svn-clean
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/contrib/client-side/svn-clean?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/contrib/client-side/svn-clean (original)
+++ subversion/branches/svn_mutex/contrib/client-side/svn-clean Tue Oct 11 19:52:34 2011
@@ -35,7 +35,7 @@ my $print        = 0;
 my $help         = 0;
 my $man          = 0;
 my $nonrecursive = 0;
-my $path         = $CWD;
+my @paths        = ($CWD);
 GetOptions(
     "exclude=s"       => \@exclude,
     "force"           => \$force,
@@ -47,7 +47,7 @@ GetOptions(
 ) or pod2usage(2);
 pod2usage(1) if $help;
 pod2usage( -exitstatus => 0, -verbose => 2 ) if $man;
-$path = Cwd::abs_path( $ARGV[0] ) if @ARGV;
+@paths = map { Cwd::abs_path($_) } @ARGV if @ARGV;
 
 # Precompile regexes.
 $_ = qr/$_/ foreach @exclude;
@@ -58,7 +58,8 @@ if ($use_svn_module) {
     my $ctx = new SVN::Client;
 
     # Call handler function with status info for each file.
-    $ctx->status( $path, undef, \&clean, !$nonrecursive, 1, 0, 1 );
+    $ctx->status( $_, undef, \&clean, !$nonrecursive, 1, 0, 1 )
+      for @paths;
 }
 else {
     warn "Warning: Not using SVN Perl modules, this might be slow.\n"
@@ -74,11 +75,11 @@ else {
     if ( $^O eq 'MSWin32' ) {
 
         # Perl on Windows currently doesn't have list pipe opens.
-        open SVN, join( ' ', @command, @ARGV ) . '|'
+        open SVN, join( ' ', @command, @paths ) . '|'
           or die "Can't call program \"svn\": $!\n";
     }
     else {
-        open SVN, "-|", @command, @ARGV
+        open SVN, "-|", @command, @paths
           or die "Can't call program \"svn\": $!\n";
     }
   LINE: while (<SVN>) {

Modified: subversion/branches/svn_mutex/contrib/hook-scripts/enforcer/enforcer
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/contrib/hook-scripts/enforcer/enforcer?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/contrib/hook-scripts/enforcer/enforcer (original)
+++ subversion/branches/svn_mutex/contrib/hook-scripts/enforcer/enforcer Tue Oct 11 19:52:34 2011
@@ -127,7 +127,7 @@ changes to files.
 These example scenarios are implemented in the provided example
 configuration file "enforcer.conf".
 
-When writing hooks, it is usually easier to test the hooks on commited
+When writing hooks, it is usually easier to test the hooks on committed
 transactions already in the repository, rather than installing the
 hook and making commits to test the them.  Enforcer allows you to
 specify either a transaction ID (for use in a hook script) or a

Modified: subversion/branches/svn_mutex/contrib/server-side/fsfsverify.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/contrib/server-side/fsfsverify.py?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/contrib/server-side/fsfsverify.py (original)
+++ subversion/branches/svn_mutex/contrib/server-side/fsfsverify.py Tue Oct 11 19:52:34 2011
@@ -665,7 +665,7 @@ class NodeRev(object):
       currentOffset = f.tell()
       line = f.readline()
       if line == '':
-        raise IOError, "Unexpected end of file"
+        raise IOError, "Unexpected end of file at offset %d" % currentOffset
       if line == '\n':
         break
 
@@ -673,11 +673,17 @@ class NodeRev(object):
       try:
         (field, value) = line.split(':', 1)
       except:
-        print repr(line)
-        print self.nodeOffset
-        print f.tell()
+        print("line: '%s'" % repr(line))
+        print("Node revision offset: %i" % self.nodeOffset)
+        print("Current file position: %i" % f.tell())
         raise
 
+      if field == "":
+        print("line: '%s'" % repr(line))
+        print("Node revision offset: %i" % self.nodeOffset)
+        print("Current file position: %i" % f.tell())
+        raise Exception("Empty field in node revision")
+
       # pull of the leading space and trailing new line
       if len(value) < 2:
           raise FsfsVerifyException("value needs to contain 2 or more bytes (%d)" % currentOffset)
@@ -742,6 +748,10 @@ class NodeRev(object):
         self.copyroot = value
       elif field == 'copyfrom':
         self.copyfrom = value
+      elif field == 'count' or field == 'minfo-cnt' or field == 'minfo-here':
+        pass
+      else:
+        raise Exception("Unrecognized field '%s'\n" % field)
 
     if self.type.type == 'dir':
       if self.text:

Modified: subversion/branches/svn_mutex/get-deps.sh
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/get-deps.sh?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/get-deps.sh (original)
+++ subversion/branches/svn_mutex/get-deps.sh Tue Oct 11 19:52:34 2011
@@ -28,10 +28,10 @@ APR_UTIL=apr-util-1.3.12
 NEON=neon-0.29.6
 SERF=serf-0.7.2
 ZLIB=zlib-1.2.5
-SQLITE_VERSION=3.7.6.3
+SQLITE_VERSION=3.7.8
 SQLITE=sqlite-amalgamation-$(printf %u%02u%02u%02u $(echo $SQLITE_VERSION | sed -e "s/\./ /g"))
 
-HTTPD=httpd-2.2.19
+HTTPD=httpd-2.2.21
 APR_ICONV=apr-iconv-1.2.1
 
 BASEDIR=`pwd`

Modified: subversion/branches/svn_mutex/notes/fsfs-improvements.txt
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/notes/fsfs-improvements.txt?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/notes/fsfs-improvements.txt (original)
+++ subversion/branches/svn_mutex/notes/fsfs-improvements.txt Tue Oct 11 19:52:34 2011
@@ -1,3 +1,8 @@
+[ At the time of writing (1.7-dev), FSFS format 5 was current.  Since then
+format 5 has been retracted; it was never released.  1.7 shipped with f4 and
+1.8 will most likely ship with f6.  Format 5 was current during 1.7-dev and
+packed revprops into an authoritative SQLite database. ]
+
 Introduction
 ------------
 

Modified: subversion/branches/svn_mutex/notes/knobs
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/notes/knobs?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/notes/knobs (original)
+++ subversion/branches/svn_mutex/notes/knobs Tue Oct 11 19:52:34 2011
@@ -52,6 +52,7 @@ SVN_DEBUG
 SVN_CLIENT_COMMIT_DEBUG
 SVN_DEBUG_CACHE_DUMP_STATS
 SVN_DEBUG_CACHE_MEMBUFFER
+SVN_DEBUG_DSO
 SVN_DEBUG_WORK_QUEUE
 PACK_AFTER_EVERY_COMMIT
 DEBUG_DOUBLE_FREE
@@ -262,6 +263,14 @@ SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2
   Default:   not defined
   Suggested: defined, not defined
 
+5.6 SVN_DEBUG_DSO
+
+  Scope:     libsvn_subr (dso)
+  Purpose:   detection of failures of dynamic loading of libraries
+  Range:     definedness
+  Default:   not defined
+  Suggested: defined, not defined
+
 5.7 SVN_DEBUG_WORK_QUEUE
 
   Scope:     libsvn_wc (workqueue)
@@ -278,7 +287,7 @@ SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2
   Default:   not defined
   Suggested: defined, not defined
 
-5.6 DEBUG_DOUBLE_FREE
+5.9 DEBUG_DOUBLE_FREE
 
   Scope:     serf
   Purpose:   detect double-free calls to serf_bucket_mem_free()
@@ -286,7 +295,7 @@ SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2
   Default:   defined
   Suggested: defined, not defined
 
-5.9 SERF_VERBOSE
+5.10 SERF_VERBOSE
 
   Scope:     serf
   Purpose:   write protocol handling debug information to stdout
@@ -294,7 +303,7 @@ SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2
   Default:   not defined
   Suggested: defined, not defined
 
-5.10 SSL_VERBOSE
+5.11 SSL_VERBOSE
 
   Scope:     serf
   Purpose:   write SSL bucket handling debug information to stdout
@@ -302,7 +311,7 @@ SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2
   Default:   not defined
   Suggested: defined, not defined
 
-5.11 SVN_DEPRECATED
+5.12 SVN_DEPRECATED
 
   Scope:     (everywhere)
   Purpose:   disable "deprecated function calls" warnings
@@ -310,7 +319,7 @@ SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2
   Default:   (compiler dependant)
   Suggested: "" (disable deprecation warnings), or compiler-specific decorators
 
-5.12 SVN_FS__TRAIL_DEBUG
+5.13 SVN_FS__TRAIL_DEBUG
 
   Scope:     libsvn_fs_base
   Purpose:   

Modified: subversion/branches/svn_mutex/notes/merge-tracking/func-spec.html
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/notes/merge-tracking/func-spec.html?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/notes/merge-tracking/func-spec.html (original)
+++ subversion/branches/svn_mutex/notes/merge-tracking/func-spec.html Tue Oct 11 19:52:34 2011
@@ -121,7 +121,7 @@ status</code> and <code>svn status -u</c
 
 <p>While some state indicating delayed merge info retrieval and
 handling could instead be stored in WC to preserve offline operation,
-there are complications with this when subsequent uncommited revert
+there are complications with this when subsequent uncommitted revert
 operations should change the merge info (we'd have to store negative
 merge info in the WC).</p>
 

Modified: subversion/branches/svn_mutex/notes/wc-ng/transitions
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/notes/wc-ng/transitions?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/notes/wc-ng/transitions (original)
+++ subversion/branches/svn_mutex/notes/wc-ng/transitions Tue Oct 11 19:52:34 2011
@@ -19,7 +19,7 @@ in addition to <none> when the WORKING_N
 ### A comment in 'wc-metadata.sql' says not all of 6 values are
 allowed in WORKING, but it may be wrong.  A wc-to-wc copy could have
 absent and excluded presence values in the BASE source, does the copy
-put those values into the working tree?  An url-to-wc copy could get
+put those values into the working tree?  A url-to-wc copy could get
 an authz failure part way through, does that result in an absent node?
 There is currently no UI to do a sparse url-to-wc copy, but if there
 was then would that result in an excluded node?

Modified: subversion/branches/svn_mutex/subversion/bindings/ctypes-python/csvn/repos.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/ctypes-python/csvn/repos.py?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/ctypes-python/csvn/repos.py (original)
+++ subversion/branches/svn_mutex/subversion/bindings/ctypes-python/csvn/repos.py Tue Oct 11 19:52:34 2011
@@ -67,6 +67,10 @@ class RepositoryURI(object):
         return self._as_parameter_
 
 class RemoteRepository(object):
+    """This class represents a connection from the client to a remote
+       Subversion repository."""
+    # The interface corresponds roughly to the svn_ra API, and an object of
+    # this type basically represents the C type 'svn_ra_session_t'.
 
     def __init__(self, url, user=None):
         """Open a new session to URL with the specified USER.
@@ -95,6 +99,10 @@ class RemoteRepository(object):
         self.client[0].log_msg_baton2 = c_void_p()
         self._log_func = None
 
+    def close(self):
+        """Close this RemoteRepository object, releasing any resources."""
+        self.pool.clear()
+
     def txn(self):
         """Create a transaction"""
         return Txn(self)
@@ -146,7 +154,12 @@ class RemoteRepository(object):
         svn_ra_get_dir2(self, dirents.byref(), NULL, NULL, path,
                         rev, fields, dirents.pool)
         self.iterpool.clear()
-        return dirents
+        # Create a Python dict of svn_dirent_t objects from this Hash of
+        # pointers to svn_dirent_t.
+        result = {}
+        for path, dirent_p in dirents.items():
+            result[path] = dirent_p[0]
+        return result
 
     def cat(self, buffer, path, rev = SVN_INVALID_REVNUM):
         """Get PATH@REV and save it to BUFFER. BUFFER must be a Python file
@@ -170,7 +183,7 @@ class RemoteRepository(object):
             rev = self.latest_revnum()
         svn_ra_stat(self, path, rev, byref(dirent), dirent.pool)
         self.iterpool.clear()
-        return dirent
+        return dirent[0]
 
     def proplist(self, path, rev = SVN_INVALID_REVNUM):
         """Return a dictionary containing the properties on PATH@REV
@@ -396,6 +409,14 @@ class LocalRepository(object):
             svn_repos_open(byref(self._as_parameter_), path, self.pool)
         self.fs = _fs(self)
 
+    def __del__(self):
+        self.close()
+
+    def close(self):
+        """Close this LocalRepository object, releasing any resources. In
+           particular, this closes the rep-cache DB."""
+        self.pool.clear()
+
     def latest_revnum(self):
         """Get the latest revision in the repository"""
         return self.fs.latest_revnum()
@@ -532,7 +553,6 @@ class _fs(object):
        This class represents an svn_fs_t object"""
 
     def __init__(self, repos):
-        self.repos = repos
         self.iterpool = Pool()
         self._as_parameter_ = svn_repos_fs(repos)
 
@@ -563,13 +583,6 @@ class _fs(object):
            temporary allocations."""
         return _fs_root(self, rev, txn, pool, iterpool)
 
-    def txn(self, message, base_rev=None):
-        """Open a new transaction for commit to the specified
-           repository, assuming that our data is up to date as
-           of base_rev. Setup the author and commit message
-           revprops."""
-        return _fs_txn(self.repos, message, base_rev)
-
 class _fs_root(object):
     """NOTE: This is a private class. Don't use it outside of
        this module. Use the Repos.txn() method instead.

Modified: subversion/branches/svn_mutex/subversion/bindings/ctypes-python/csvn/wc.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/ctypes-python/csvn/wc.py?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/ctypes-python/csvn/wc.py (original)
+++ subversion/branches/svn_mutex/subversion/bindings/ctypes-python/csvn/wc.py Tue Oct 11 19:52:34 2011
@@ -79,6 +79,10 @@ class WC(object):
         self.client[0].log_msg_baton2 = c_void_p()
         self._log_func = None
 
+    def close(self):
+        """Close this WC object, releasing any resources."""
+        self.pool.clear()
+
     def copy(self, src, dest, rev = ""):
         """Copy src to dest.
 

Modified: subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/localrepos.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/localrepos.py?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/localrepos.py (original)
+++ subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/localrepos.py Tue Oct 11 19:52:34 2011
@@ -33,15 +33,21 @@ class LocalRepositoryTestCase(unittest.T
         dumpfile = open(os.path.join(os.path.split(__file__)[0],
                         'test.dumpfile'))
 
-        # Just in case a preivous test instance was not properly cleaned up
-        self.tearDown()
+        # Just in case a previous test instance was not properly cleaned up
+        self.remove_from_disk()
+
         self.repos = LocalRepository(repos_location, create=True)
         self.repos.load(dumpfile)
 
     def tearDown(self):
+        self.repos.close()
+        self.remove_from_disk()
+        self.repos = None
+
+    def remove_from_disk(self):
+        """Remove anything left on disk"""
         if os.path.exists(repos_location):
             svn_repos_delete(repos_location, Pool())
-        self.repos = None
 
     def test_local_latest_revnum(self):
         self.assertEqual(9, self.repos.latest_revnum())

Modified: subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/remoterepos.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/remoterepos.py?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/remoterepos.py (original)
+++ subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/remoterepos.py Tue Oct 11 19:52:34 2011
@@ -27,6 +27,13 @@ from csvn.core import *
 from urllib import pathname2url
 from csvn.repos import LocalRepository, RemoteRepository
 from stat import *
+from sys import version_info # For Python version check
+if version_info[0] >= 3:
+  # Python >=3.0
+  from io import StringIO
+else:
+  # Python <3.0
+  from StringIO import StringIO
 
 repos_location = os.path.join(tempfile.gettempdir(), "svn_test_repos")
 repos_url = pathname2url(repos_location)
@@ -46,17 +53,32 @@ class RemoteRepositoryTestCase(unittest.
         dumpfile = open(os.path.join(os.path.split(__file__)[0],
                         'test.dumpfile'))
 
-        # Just in case a preivous test instance was not properly cleaned up
-        self.tearDown()
+        # Just in case a previous test instance was not properly cleaned up
+        self.remove_from_disk()
+
         self.repos = LocalRepository(repos_location, create=True)
         self.repos.load(dumpfile)
 
         self.repos = RemoteRepository(repos_url)
 
     def tearDown(self):
+        self.repos.close()
+        self.remove_from_disk()
+        self.repos = None
+
+    def remove_from_disk(self):
+        """Remove anything left on disk"""
         if os.path.exists(repos_location):
             svn_repos_delete(repos_location, Pool())
-        self.repos = None
+
+    def svn_dirent_t_assert_equal(self, a, b):
+        """Assert that two svn_dirent_t's are equal, ignoring their 'time'
+           fields."""
+        self.assertEqual(a.kind, b.kind)
+        self.assertEqual(a.size, b.size)
+        self.assertEqual(a.has_props, b.has_props)
+        self.assertEqual(a.created_rev, b.created_rev)
+        self.assertEqual(a.last_author, b.last_author)
 
     def test_remote_latest_revnum(self):
         self.assertEqual(9, self.repos.latest_revnum())
@@ -71,6 +93,50 @@ class RemoteRepositoryTestCase(unittest.
         self.assertEqual(svn_node_none,
             self.repos.check_path("does_not_compute"))
 
+    def test_list(self):
+        expected = {
+            'README.txt':
+                svn_dirent_t(kind=svn_node_file, size=159, has_props=True,
+                             created_rev=9, last_author=String('bruce')),
+            'ANOTHERREADME.txt':
+                svn_dirent_t(kind=svn_node_file, size=66, has_props=False,
+                             created_rev=4, last_author=String('clark')) }
+        found = self.repos.list("trunk")
+        self.assertEqual(sorted(found.keys()), sorted(expected.keys()))
+        for path in found:
+            self.svn_dirent_t_assert_equal(found[path], expected[path])
+
+    def test_info(self):
+        e = svn_dirent_t(kind=svn_node_file, size=159, has_props=True,
+                         created_rev=9, last_author=String('bruce'))
+        f = self.repos.info("trunk/README.txt")
+        self.svn_dirent_t_assert_equal(f, e)
+
+    def test_proplist(self):
+        expected = { 'Awesome': 'Yes',
+            'svn:entry:last-author': 'bruce',
+            'svn:entry:committed-rev': '9' }
+        found = self.repos.proplist("trunk/README.txt")
+        # Check results, ignoring some entry-props
+        del found['svn:entry:committed-date']
+        del found['svn:entry:uuid']
+        self.assertEqual(sorted(found.keys()), sorted(expected.keys()))
+        for pname in found:
+            self.assertEqual(found[pname], expected[pname])
+
+    def test_propget(self):
+        found = self.repos.propget("Awesome", "trunk/README.txt")
+        self.assertEqual(found, "Yes")
+
+    def test_log(self):
+        expected = [ (8, 'clark'),
+                     (9, 'bruce') ]
+        for found in self.repos.log(7, 9, ["trunk/README.txt"]):
+            (e_rev, e_author) = expected[0]
+            self.assertEqual(found.revision, e_rev)
+            self.assertEqual(found.author, e_author)
+            expected = expected[1:]
+
     def test_revprop_list(self):
         # Test argument-free case
         props = self.repos.revprop_list()

Modified: subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/setup_path.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/setup_path.py?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/setup_path.py (original)
+++ subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/setup_path.py Tue Oct 11 19:52:34 2011
@@ -25,8 +25,8 @@
 import sys
 import os
 
-src_swig_python_tests_dir = os.path.dirname(os.path.dirname(__file__))
-sys.path[0:0] = [ src_swig_python_tests_dir ]
+src_ctypes_python_tests_dir = os.path.dirname(os.path.dirname(__file__))
+sys.path[0:0] = [ src_ctypes_python_tests_dir ]
 
 import csvn.core
 csvn.core.svn_cmdline_init("", csvn.core.stderr)

Modified: subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/svntypes.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/svntypes.py?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/svntypes.py (original)
+++ subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/svntypes.py Tue Oct 11 19:52:34 2011
@@ -21,8 +21,24 @@ import setup_path
 import unittest
 from csvn.core import *
 import csvn.types as _types
+from csvn.types import SvnDate, Hash, Array, APRFile, Stream, SvnStringPtr
 
-class TypesTestCase(unittest.TestCase):
+class SvnDateTestCase(unittest.TestCase):
+
+    def test_as_apr_time_t(self):
+        d1 = SvnDate('1999-12-31T23:59:59.000000Z')
+        d2 = SvnDate('2000-01-01T00:00:00.000000Z')
+        t1 = d1.as_apr_time_t().value
+        t2 = d2.as_apr_time_t().value
+        self.assertEqual(t1 + 1000000, t2)
+
+    def test_as_human_string(self):
+        d1 = SvnDate('1999-12-31T23:59:59.000000Z')
+        s1 = d1.as_human_string()
+        self.assertEqual(s1[:27], '1999-12-31 23:59:59 +0000 (')
+
+
+class HashTestCase(unittest.TestCase):
 
     def test_hash(self):
         self.pydict = {"bruce":"batman", "clark":"superman",
@@ -35,6 +51,34 @@ class TypesTestCase(unittest.TestCase):
         self.assertNotEqual(self.svnhash["clark"].value,
             self.pydict["bruce"])
 
+    def test_insert_delete(self):
+        h = Hash(c_char_p)
+        h['foo'] = 'f'
+        h['bar'] = 'b'
+        self.assertEqual(len(h), 2)
+        self.assertEqual(h['foo'].value, 'f')
+        self.assertEqual(h['bar'].value, 'b')
+        h['bar'] = 'b'
+        self.assertEqual(len(h), 2)
+        del h['foo']
+        self.assertEqual(len(h), 1)
+        self.assertEqual(h['bar'].value, 'b')
+
+    def test_iter(self):
+        h = Hash(c_char_p, { 'foo': 'f', 'bar': 'b' })
+        keys = sorted(h.keys())
+        self.assertEqual(keys, ['bar', 'foo'])
+        vals = []
+        for k in h:
+            vals += [ h[k].value ]
+        self.assertEqual(sorted(vals), ['b', 'f'])
+        vals = []
+        for k,v in h.items():
+            vals += [ v.value ]
+        self.assertEqual(sorted(vals), ['b', 'f'])
+
+class ArrayTestCase(unittest.TestCase):
+
     def test_array(self):
         self.pyarray = ["vini", "vidi", "vici"]
         self.svnarray = _types.Array(c_char_p, self.pyarray)
@@ -43,7 +87,11 @@ class TypesTestCase(unittest.TestCase):
         self.assertEqual(self.svnarray[1], "vidi")
 
 def suite():
-    return unittest.makeSuite(TypesTestCase, 'test')
+    suite = unittest.TestSuite()
+    suite.addTest(unittest.makeSuite(SvnDateTestCase, 'test'))
+    suite.addTest(unittest.makeSuite(HashTestCase, 'test'))
+    suite.addTest(unittest.makeSuite(ArrayTestCase, 'test'))
+    return suite
 
 if __name__ == '__main__':
     runner = unittest.TextTestRunner()

Modified: subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/wc.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/wc.py?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/wc.py (original)
+++ subversion/branches/svn_mutex/subversion/bindings/ctypes-python/test/wc.py Tue Oct 11 19:52:34 2011
@@ -59,8 +59,9 @@ class WCTestCase(unittest.TestCase):
         dumpfile = open(os.path.join(os.path.split(__file__)[0],
                         'test.dumpfile'))
 
-        # Just in case a preivous test instance was not properly cleaned up
-        self.tearDown()
+        # Just in case a previous test instance was not properly cleaned up
+        self.remove_from_disk()
+
         self.repos = LocalRepository(repos_location, create=True)
         self.repos.load(dumpfile)
 
@@ -68,12 +69,18 @@ class WCTestCase(unittest.TestCase):
         self.wc.checkout(repo_url)
 
     def tearDown(self):
+        self.repos.close()
+        self.wc.close()
+        self.remove_from_disk()
+        self.wc = None
+
+    def remove_from_disk(self):
+        """Remove anything left on disk"""
         pool = Pool()
         if os.path.exists(wc_location):
             svn_io_remove_dir(wc_location, pool)
         if os.path.exists(repos_location):
             svn_repos_delete(repos_location, pool)
-        self.wc = None
 
     def _info_receiver(self, path, info):
         self.last_info = info
@@ -247,5 +254,5 @@ def suite():
     return unittest.makeSuite(WCTestCase, 'test')
 
 if __name__ == '__main__':
-    runner = unittest.TextTestRunner(verbosity=2)
+    runner = unittest.TextTestRunner()
     runner.run(suite())

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/Array.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/Array.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/Array.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/Array.cpp Tue Oct 11 19:52:34 2011
@@ -33,16 +33,13 @@
 
 Array::~Array()
 {
-  if (m_objectArray != NULL)
-    {
-      for (std::vector<jobject>::iterator it = m_objects.begin();
-            it < m_objects.end(); ++it)
-        {
-          JNIUtil::getEnv()->DeleteLocalRef(*it);
-        }
-
-      JNIUtil::getEnv()->DeleteLocalRef(m_objectArray);
-    }
+  /* We don't clean up our Java object here, because this destructor may run
+     *after* a call to PopLocalFrame().  If so, we would be deleting references
+     twice, which leads to all kinds of problems.
+
+     Instead, we intentionally "leak" these references, knowing that a call
+     to PopLocalFrame() will clean them up, or, in the worse case, the JVM
+     will clean them up when it returns from the JNI code. */
 }
 
 const std::vector<jobject> &Array::vector(void) const

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/ClientContext.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/ClientContext.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/ClientContext.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/ClientContext.cpp Tue Oct 11 19:52:34 2011
@@ -38,12 +38,11 @@
 #include "CommitMessage.h"
 
 
-ClientContext::ClientContext(jobject jsvnclient)
+ClientContext::ClientContext(jobject jsvnclient, SVN::Pool &pool)
     : m_prompter(NULL),
       m_cancelOperation(false)
 {
     JNIEnv *env = JNIUtil::getEnv();
-    JNICriticalSection criticalSection(*JNIUtil::getGlobalPoolMutex());
 
     /* Grab a global reference to the Java object embedded in the parent Java
        object. */
@@ -72,23 +71,32 @@ ClientContext::ClientContext(jobject jsv
 
     env->DeleteLocalRef(jctx);
 
-    /* Create a long-lived client context object in the global pool. */
-    SVN_JNI_ERR(svn_client_create_context(&persistentCtx, JNIUtil::getPool()),
+    SVN_JNI_ERR(svn_client_create_context(&m_context, pool.getPool()),
                 );
 
+    /* Clear the wc_ctx as we don't want to maintain this unconditionally
+       for compatibility reasons */
+    SVN_JNI_ERR(svn_wc_context_destroy(m_context->wc_ctx),
+                );
+    m_context->wc_ctx = NULL;
+
     /* None of the following members change during the lifetime of
        this object. */
-    persistentCtx->notify_func = NULL;
-    persistentCtx->notify_baton = NULL;
-    persistentCtx->log_msg_func3 = CommitMessage::callback;
-    persistentCtx->cancel_func = checkCancel;
-    persistentCtx->cancel_baton = this;
-    persistentCtx->notify_func2= notify;
-    persistentCtx->notify_baton2 = m_jctx;
-    persistentCtx->progress_func = progress;
-    persistentCtx->progress_baton = m_jctx;
-    persistentCtx->conflict_func2 = resolve;
-    persistentCtx->conflict_baton2 = m_jctx;
+    m_context->notify_func = NULL;
+    m_context->notify_baton = NULL;
+    m_context->log_msg_func3 = CommitMessage::callback;
+    m_context->log_msg_baton3 = NULL;
+    m_context->cancel_func = checkCancel;
+    m_context->cancel_baton = this;
+    m_context->notify_func2= notify;
+    m_context->notify_baton2 = m_jctx;
+    m_context->progress_func = progress;
+    m_context->progress_baton = m_jctx;
+    m_context->conflict_func2 = resolve;
+    m_context->conflict_baton2 = m_jctx;
+
+    m_context->client_name = "javahl";
+    m_pool = &pool;
 }
 
 ClientContext::~ClientContext()
@@ -99,23 +107,70 @@ ClientContext::~ClientContext()
     env->DeleteGlobalRef(m_jctx);
 }
 
+
+/* Helper function to make sure that we don't keep dangling pointers in ctx.
+   Note that this function might be called multiple times if getContext()
+   is called on the same pool.
+   
+   The use of this function assumes a proper subpool behavior by its user,
+   (read: SVNClient) usually per request.
+ */
+extern "C" {
+
+struct clearctx_baton_t
+{
+  svn_client_ctx_t *ctx;
+  svn_client_ctx_t *backup;
+};
+
+static apr_status_t clear_ctx_ptrs(void *ptr)
+{
+    clearctx_baton_t *bt = (clearctx_baton_t*)ptr;
+
+    /* Reset all values to those before overwriting by getContext. */
+    *bt->ctx = *bt->backup;
+
+    return APR_SUCCESS;
+}
+
+};
+
 svn_client_ctx_t *
-ClientContext::getContext(CommitMessage *message)
+ClientContext::getContext(CommitMessage *message, SVN::Pool &in_pool)
 {
-    SVN::Pool *requestPool = JNIUtil::getRequestPool();
-    apr_pool_t *pool = requestPool->pool();
+    apr_pool_t *pool = in_pool.getPool();
     svn_auth_baton_t *ab;
-    svn_client_ctx_t *ctx = persistentCtx;
-    //SVN_JNI_ERR(svn_client_create_context(&ctx, pool), NULL);
+    svn_client_ctx_t *ctx = m_context;
+
+    /* Make a temporary copy of ctx to restore at pool cleanup to avoid
+       leaving references to dangling pointers.
 
-    const char *configDir = m_configDir.c_str();
-    if (m_configDir.length() == 0)
-        configDir = NULL;
-    SVN_JNI_ERR(svn_config_get_config(&(ctx->config), configDir, pool), NULL);
+       Note that this allows creating a stack of context changes if
+       the function is invoked multiple times with different pools.
+     */
+    clearctx_baton_t *bt = (clearctx_baton_t *)apr_pcalloc(pool, sizeof(*bt));
+    bt->ctx = ctx;
+    bt->backup = (svn_client_ctx_t*)apr_pmemdup(pool, ctx, sizeof(*ctx));
+    apr_pool_cleanup_register(in_pool.getPool(), bt, clear_ctx_ptrs,
+                              clear_ctx_ptrs);
+
+
+    if (!ctx->config)
+      {
+        const char *configDir = m_configDir.c_str();
+        if (m_configDir.empty())
+            configDir = NULL;
+        SVN_JNI_ERR(svn_config_get_config(&(ctx->config), configDir,
+                                          m_pool->getPool()),
+                    NULL);
+
+        bt->backup->config = ctx->config;
+      }
     svn_config_t *config = (svn_config_t *) apr_hash_get(ctx->config,
                                                          SVN_CONFIG_CATEGORY_CONFIG,
                                                          APR_HASH_KEY_STRING);
 
+
     /* The whole list of registered providers */
     apr_array_header_t *providers;
 
@@ -173,22 +228,22 @@ ClientContext::getContext(CommitMessage 
     if (m_prompter != NULL)
     {
         /* Two basic prompt providers: username/password, and just username.*/
-        provider = m_prompter->getProviderSimple();
+        provider = m_prompter->getProviderSimple(in_pool);
 
         APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
 
-        provider = m_prompter->getProviderUsername();
+        provider = m_prompter->getProviderUsername(in_pool);
         APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
 
         /* Three ssl prompt providers, for server-certs, client-certs,
          * and client-cert-passphrases.  */
-        provider = m_prompter->getProviderServerSSLTrust();
+        provider = m_prompter->getProviderServerSSLTrust(in_pool);
         APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
 
-        provider = m_prompter->getProviderClientSSL();
+        provider = m_prompter->getProviderClientSSL(in_pool);
         APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
 
-        provider = m_prompter->getProviderClientSSLPassword();
+        provider = m_prompter->getProviderClientSSLPassword(in_pool);
         APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
     }
 
@@ -199,15 +254,26 @@ ClientContext::getContext(CommitMessage 
      * auth_baton's run-time parameter hash.  ### Same with --no-auth-cache? */
     if (!m_userName.empty())
         svn_auth_set_parameter(ab, SVN_AUTH_PARAM_DEFAULT_USERNAME,
-                               m_userName.c_str());
+                               apr_pstrdup(in_pool.getPool(),
+                                           m_userName.c_str()));
     if (!m_passWord.empty())
         svn_auth_set_parameter(ab, SVN_AUTH_PARAM_DEFAULT_PASSWORD,
-                               m_passWord.c_str());
+                               apr_pstrdup(in_pool.getPool(),
+                                           m_passWord.c_str()));
+    /* Store where to retrieve authentication data? */
+    if (!m_configDir.empty())
+        svn_auth_set_parameter(ab, SVN_AUTH_PARAM_CONFIG_DIR,
+                               apr_pstrdup(in_pool.getPool(),
+                                           m_configDir.c_str()));
 
     ctx->auth_baton = ab;
     ctx->log_msg_baton3 = message;
     m_cancelOperation = false;
 
+    SVN_JNI_ERR(svn_wc_context_create(&ctx->wc_ctx, NULL,
+                                      in_pool.getPool(), in_pool.getPool()),
+                NULL);
+
     return ctx;
 }
 
@@ -236,9 +302,10 @@ ClientContext::setConfigDirectory(const 
     // A change to the config directory may necessitate creation of
     // the config templates.
     SVN::Pool requestPool;
-    SVN_JNI_ERR(svn_config_ensure(configDir, requestPool.pool()), );
+    SVN_JNI_ERR(svn_config_ensure(configDir, requestPool.getPool()), );
 
     m_configDir = (configDir == NULL ? "" : configDir);
+    m_context->config = NULL;
 }
 
 const char *
@@ -386,7 +453,8 @@ ClientContext::resolve(svn_wc_conflict_r
     {
       // If an exception is thrown by our conflict resolver, remove it
       // from the JNI env, and convert it into a Subversion error.
-      const char *msg = JNIUtil::thrownExceptionToCString();
+      SVN::Pool tmpPool(scratch_pool);
+      const char *msg = JNIUtil::thrownExceptionToCString(tmpPool);
       svn_error_t *err = svn_error_create(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE,
                                           NULL, msg);
       env->PopLocalFrame(NULL);

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/ClientContext.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/ClientContext.h?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/ClientContext.h (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/ClientContext.h Tue Oct 11 19:52:34 2011
@@ -42,11 +42,13 @@ class CommitMessage;
 /**
  * This class contains a Java objects implementing the interface ClientContext
  * and implements the functions read & close of svn_stream_t.
+ *
  */
 class ClientContext
 {
  private:
-  svn_client_ctx_t *persistentCtx;
+  svn_client_ctx_t *m_context;
+  const SVN::Pool *m_pool;
   jobject m_jctx;
 
   std::string m_userName;
@@ -70,12 +72,12 @@ class ClientContext
                                                  apr_pool_t *pool);
 
  public:
-  ClientContext(jobject jsvnclient);
+  ClientContext(jobject jsvnclient, SVN::Pool &pool);
   ~ClientContext();
 
   static svn_error_t *checkCancel(void *cancelBaton);
 
-  svn_client_ctx_t *getContext(CommitMessage *message);
+  svn_client_ctx_t *getContext(CommitMessage *message, SVN::Pool &in_pool);
 
   void username(const char *pi_username);
   void password(const char *pi_password);

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/CopySources.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/CopySources.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/CopySources.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/CopySources.cpp Tue Oct 11 19:52:34 2011
@@ -85,7 +85,7 @@ CopySources::makeJCopySource(const char 
 apr_array_header_t *
 CopySources::array(SVN::Pool &pool)
 {
-  apr_pool_t *p = pool.pool();
+  apr_pool_t *p = pool.getPool();
 
   JNIEnv *env = JNIUtil::getEnv();
   jclass clazz = env->FindClass(JAVA_PACKAGE "/types/CopySource");
@@ -122,7 +122,7 @@ CopySources::array(SVN::Pool &pool)
 
       src->path = apr_pstrdup(p, path);
       env->ReleaseStringUTFChars(jpath, path);
-      SVN_JNI_ERR(JNIUtil::preprocessPath(src->path, pool.pool()),
+      SVN_JNI_ERR(JNIUtil::preprocessPath(src->path, pool.getPool()),
                   NULL);
       env->DeleteLocalRef(jpath);
 

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/CopySources.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/CopySources.h?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/CopySources.h (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/CopySources.h Tue Oct 11 19:52:34 2011
@@ -71,6 +71,9 @@ class CopySources
    * A local reference to the Java CopySources peer.
    */
   Array &m_copySources;
+
+  CopySources(const CopySources &from);
+  CopySources & operator=(const CopySources &);
 };
 
 #endif  /* COPY_SOURCES_H */

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/CreateJ.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/CreateJ.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/CreateJ.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/CreateJ.cpp Tue Oct 11 19:52:34 2011
@@ -871,7 +871,8 @@ CreateJ::CommitInfo(const svn_commit_inf
   if (midCT == 0)
     {
       midCT = env->GetMethodID(clazz, "<init>",
-                               "(JLjava/lang/String;Ljava/lang/String;)V");
+                               "(JLjava/lang/String;Ljava/lang/String;"
+                               "Ljava/lang/String;Ljava/lang/String;)V");
       if (JNIUtil::isJavaExceptionThrown() || midCT == 0)
         POP_AND_RETURN_NULL;
     }
@@ -886,8 +887,18 @@ CreateJ::CommitInfo(const svn_commit_inf
 
   jlong jRevision = commit_info->revision;
 
+  jstring jPostCommitError = JNIUtil::makeJString(
+                                            commit_info->post_commit_err);
+  if (JNIUtil::isJavaExceptionThrown())
+    POP_AND_RETURN_NULL;
+
+  jstring jReposRoot = JNIUtil::makeJString(commit_info->repos_root);
+  if (JNIUtil::isJavaExceptionThrown())
+    POP_AND_RETURN_NULL;
+
   // call the Java method
-  jobject jInfo = env->NewObject(clazz, midCT, jRevision, jDate, jAuthor);
+  jobject jInfo = env->NewObject(clazz, midCT, jRevision, jDate, jAuthor,
+                                 jPostCommitError, jReposRoot);
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/File.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/File.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/File.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/File.cpp Tue Oct 11 19:52:34 2011
@@ -79,8 +79,13 @@ const char *File::getAbsPath()
 
       stringHolder = new JNIStringHolder(jabsolutePath);
 
+      /* We don't remove the local ref for jabsolutePath here, because
+         JNIStringHolder expects that ref to be valid for the life of
+         the object, which in this case is allocated on the stack.
+         
+         So we just "leak" the reference, and it will get cleaned up when
+         we eventually exit back to Java-land. */
       env->DeleteLocalRef(clazz);
-      env->DeleteLocalRef(jabsolutePath);
     }
 
   return static_cast<const char *>(*stringHolder);
@@ -90,7 +95,7 @@ const char *File::getInternalStyle(const
 {
   const char *path = getAbsPath();
   if (path)
-    return svn_dirent_internal_style(path, requestPool.pool());
+    return svn_dirent_internal_style(path, requestPool.getPool());
   else
     return NULL;
 }

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/InputStream.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/InputStream.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/InputStream.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/InputStream.cpp Tue Oct 11 19:52:34 2011
@@ -53,7 +53,7 @@ svn_stream_t *InputStream::getStream(con
 {
   // Create a stream with this as the baton and set the read and
   // close functions.
-  svn_stream_t *ret = svn_stream_create(this, pool.pool());
+  svn_stream_t *ret = svn_stream_create(this, pool.getPool());
   svn_stream_set_read(ret, InputStream::read);
   svn_stream_set_close(ret, InputStream::close);
   return ret;

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIThreadData.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIThreadData.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIThreadData.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIThreadData.cpp Tue Oct 11 19:52:34 2011
@@ -41,7 +41,6 @@ JNIThreadData::JNIThreadData()
 {
   m_env = NULL;
   m_exceptionThrown = false;
-  m_requestPool = NULL;
   m_previous = NULL;
 }
 

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIThreadData.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIThreadData.h?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIThreadData.h (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIThreadData.h Tue Oct 11 19:52:34 2011
@@ -61,10 +61,6 @@ class JNIThreadData
    */
   char m_formatBuffer[JNIUtil::formatBufferSize];
 
-  /**
-   * The pool for the current request (call).
-   */
-  SVN::Pool *m_requestPool;
  private:
   /**
    * Pointer to previous thread information to enable reentrent

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIUtil.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIUtil.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIUtil.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIUtil.cpp Tue Oct 11 19:52:34 2011
@@ -64,7 +64,6 @@ apr_pool_t *JNIUtil::g_pool = NULL;
 std::list<SVNBase*> JNIUtil::g_finalizedObjects;
 JNIMutex *JNIUtil::g_finalizedObjectsMutex = NULL;
 JNIMutex *JNIUtil::g_logMutex = NULL;
-JNIMutex *JNIUtil::g_globalPoolMutext = NULL;
 bool JNIUtil::g_initException;
 bool JNIUtil::g_inInit;
 JNIEnv *JNIUtil::g_initEnv;
@@ -127,39 +126,7 @@ bool JNIUtil::JNIGlobalInit(JNIEnv *env)
 
   apr_status_t status;
 
-  /* C programs default to the "C" locale. But because svn is supposed
-     to be i18n-aware, it should inherit the default locale of its
-     environment.  */
-  if (!setlocale(LC_ALL, ""))
-    {
-      if (stderr)
-        {
-          const char *env_vars[] = { "LC_ALL", "LC_CTYPE", "LANG", NULL };
-          const char **env_var = &env_vars[0], *env_val = NULL;
-          while (*env_var)
-            {
-              env_val = getenv(*env_var);
-              if (env_val && env_val[0])
-                break;
-              ++env_var;
-            }
 
-          if (!*env_var)
-            {
-              /* Unlikely. Can setlocale fail if no env vars are set? */
-              --env_var;
-              env_val = "not set";
-            }
-
-          fprintf(stderr,
-                  "%s: error: cannot set LC_ALL locale\n"
-                  "%s: error: environment variable %s is %s\n"
-                  "%s: error: please check that your locale name is "
-                  "correct\n",
-                  "svnjavahl", "svnjavahl", *env_var, env_val, "svnjavahl");
-        }
-      return FALSE;
-    }
 
   /* Initialize the APR subsystem, and register an atexit() function
    * to Uninitialize that subsystem at program exit. */
@@ -196,6 +163,19 @@ bool JNIUtil::JNIGlobalInit(JNIEnv *env)
       return FALSE;
     }
 
+  /* Create our top-level pool. */
+  g_pool = svn_pool_create(NULL);
+
+  apr_allocator_t* allocator = apr_pool_allocator_get(g_pool);
+
+  if (allocator)
+    {
+      /* Keep a maximum of 1 free block, to release memory back to the JVM
+         (and other modules). */
+      apr_allocator_max_free_set(allocator, 1);
+    }
+
+
 #ifdef ENABLE_NLS
 #ifdef WIN32
   {
@@ -207,7 +187,7 @@ bool JNIUtil::JNIGlobalInit(JNIEnv *env)
     apr_size_t inwords, outbytes;
     unsigned int outlength;
 
-    apr_pool_create(&pool, 0);
+    pool = svn_pool_create(g_pool);
     /* get dll name - our locale info will be in '../share/locale' */
     inwords = sizeof(ucs2_path) / sizeof(ucs2_path[0]);
     HINSTANCE moduleHandle = GetModuleHandle("libsvnjavahl-1");
@@ -232,16 +212,13 @@ bool JNIUtil::JNIGlobalInit(JNIEnv *env)
     internal_path = svn_dirent_join(internal_path, SVN_LOCALE_RELATIVE_PATH,
                                   pool);
     bindtextdomain(PACKAGE_NAME, internal_path);
-    apr_pool_destroy(pool);
+    svn_pool_destroy(pool);
   }
 #else
   bindtextdomain(PACKAGE_NAME, SVN_LOCALE_DIR);
 #endif
 #endif
 
-  /* Create our top-level pool. */
-  g_pool = svn_pool_create(NULL);
-
 #if defined(WIN32) || defined(__CYGWIN__)
   /* See http://svn.apache.org/repos/asf/subversion/trunk/notes/asp-dot-net-hack.txt */
   /* ### This code really only needs to be invoked by consumers of
@@ -272,10 +249,6 @@ bool JNIUtil::JNIGlobalInit(JNIEnv *env)
   if (isExceptionThrown())
     return false;
 
-  g_globalPoolMutext = new JNIMutex(g_pool);
-  if (isExceptionThrown())
-    return false;
-
   // initialized the thread local storage
   if (!JNIThreadData::initThreadData())
     return false;
@@ -298,15 +271,6 @@ apr_pool_t *JNIUtil::getPool()
   return g_pool;
 }
 
-/**
- * Return the mutex securing the global pool.
- * @return the mutex for the global pool
- */
-JNIMutex *JNIUtil::getGlobalPoolMutex()
-{
-  return g_globalPoolMutext;
-}
-
 void JNIUtil::raiseThrowable(const char *name, const char *message)
 {
   if (getLogLevel() >= errorLog)
@@ -655,7 +619,7 @@ bool JNIUtil::isJavaExceptionThrown()
 }
 
 const char *
-JNIUtil::thrownExceptionToCString()
+JNIUtil::thrownExceptionToCString(SVN::Pool &in_pool)
 {
   const char *msg;
   JNIEnv *env = getEnv();
@@ -672,7 +636,7 @@ JNIUtil::thrownExceptionToCString()
         }
       jstring jmsg = (jstring) env->CallObjectMethod(t, getMessage);
       JNIStringHolder tmp(jmsg);
-      msg = tmp.pstrdup(getRequestPool()->pool());
+      msg = tmp.pstrdup(in_pool.getPool());
       // ### Conditionally add t.printStackTrace() to msg?
     }
   else
@@ -808,25 +772,6 @@ jobject JNIUtil::createDate(apr_time_t t
 }
 
 /**
- * Return the request pool. The request pool will be destroyed after each
- * request (call).
- * @return the pool to be used for this request
- */
-SVN::Pool *JNIUtil::getRequestPool()
-{
-  return JNIThreadData::getThreadData()->m_requestPool;
-}
-
-/**
- * Set the request pool in thread local storage.
- * @param pool  the request pool
- */
-void JNIUtil::setRequestPool(SVN::Pool *pool)
-{
-  JNIThreadData::getThreadData()->m_requestPool = pool;
-}
-
-/**
  * Create a Java byte array from an array of characters.
  * @param data      the character array
  * @param length    the number of characters in the array

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIUtil.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIUtil.h?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIUtil.h (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/JNIUtil.h Tue Oct 11 19:52:34 2011
@@ -63,8 +63,6 @@ class JNIUtil
 
   static void throwNullPointerException(const char *message);
   static jbyteArray makeJByteArray(const signed char *data, int length);
-  static void setRequestPool(SVN::Pool *pool);
-  static SVN::Pool *getRequestPool();
   static jobject createDate(apr_time_t time);
   static void logMessage(const char *message);
   static int getLogLevel();
@@ -103,7 +101,7 @@ class JNIUtil
    * occurred. Useful for converting Java @c Exceptions into @c
    * svn_error_t's.
    */
-  static const char *thrownExceptionToCString();
+  static const char *thrownExceptionToCString(SVN::Pool &in_pool);
 
   /**
    * Throw a Java exception corresponding to err, and run
@@ -135,7 +133,7 @@ class JNIUtil
   static apr_pool_t *getPool();
   static bool JNIGlobalInit(JNIEnv *env);
   static bool JNIInit(JNIEnv *env);
-  static JNIMutex *getGlobalPoolMutex();
+  static bool initializeJNIRuntime();
   enum { formatBufferSize = 2048 };
   enum { noLog, errorLog, exceptionLog, entryLog } LogLevel;
 
@@ -202,11 +200,6 @@ class JNIUtil
    * The stream to write log messages to.
    */
   static std::ofstream g_logStream;
-
-  /**
-   * Flag to secure our global pool.
-   */
-  static JNIMutex *g_globalPoolMutext;
 };
 
 /**

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/OutputStream.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/OutputStream.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/OutputStream.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/OutputStream.cpp Tue Oct 11 19:52:34 2011
@@ -56,7 +56,7 @@ svn_stream_t *OutputStream::getStream(co
 {
   // Create a stream with this as the baton and set the write and
   // close functions.
-  svn_stream_t *ret = svn_stream_create(this, pool.pool());
+  svn_stream_t *ret = svn_stream_create(this, pool.getPool());
   svn_stream_set_write(ret, OutputStream::write);
   svn_stream_set_close(ret, OutputStream::close);
   return ret;

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/Path.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/Path.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/Path.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/Path.cpp Tue Oct 11 19:52:34 2011
@@ -36,9 +36,9 @@
  * @see Path::Path(const std::string &)
  * @param path Path string
  */
-Path::Path(const char *pi_path)
+Path::Path(const char *pi_path, SVN::Pool &in_pool)
 {
-  init(pi_path);
+  init(pi_path, in_pool);
 }
 
 /**
@@ -48,9 +48,9 @@ Path::Path(const char *pi_path)
  *
  * @param path Path string
  */
-Path::Path(const std::string &pi_path)
+Path::Path(const std::string &pi_path, SVN::Pool &in_pool)
 {
-  init(pi_path.c_str());
+  init(pi_path.c_str(), in_pool);
 }
 
 /**
@@ -58,9 +58,9 @@ Path::Path(const std::string &pi_path)
  *
  * @param path Path to be copied
  */
-Path::Path(const Path &pi_path)
+Path::Path(const Path &pi_path, SVN::Pool &in_pool)
 {
-  init(pi_path.c_str());
+  init(pi_path.c_str(), in_pool);
 }
 
 /**
@@ -69,7 +69,7 @@ Path::Path(const Path &pi_path)
  * @param path Path string
  */
 void
-Path::init(const char *pi_path)
+Path::init(const char *pi_path, SVN::Pool &in_pool)
 {
   if (*pi_path == 0)
     {
@@ -78,9 +78,7 @@ Path::init(const char *pi_path)
     }
   else
     {
-      m_error_occured =
-        JNIUtil::preprocessPath(pi_path,
-                                JNIUtil::getRequestPool()->pool() );
+      m_error_occured = JNIUtil::preprocessPath(pi_path, in_pool.getPool());
 
       m_path = pi_path;
     }
@@ -110,7 +108,9 @@ Path::c_str() const
 Path&
 Path::operator=(const Path &pi_path)
 {
-  init(pi_path.c_str());
+  m_error_occured = NULL;
+  m_path = pi_path.m_path;
+
   return *this;
 }
 
@@ -125,7 +125,7 @@ jboolean Path::isValid(const char *p)
     return JNI_FALSE;
 
   SVN::Pool requestPool;
-  svn_error_t *err = svn_path_check_valid(p, requestPool.pool());
+  svn_error_t *err = svn_path_check_valid(p, requestPool.getPool());
   if (err == SVN_NO_ERROR)
     {
       return JNI_TRUE;

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/Path.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/Path.h?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/Path.h (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/Path.h Tue Oct 11 19:52:34 2011
@@ -29,6 +29,7 @@
 
 #include <string>
 #include <jni.h>
+#include "Pool.h"
 struct svn_error_t;
 
 /**
@@ -47,7 +48,7 @@ class Path
    *
    * @param pi_path Path string
    */
-  void init(const char *pi_path);
+  void init(const char *pi_path, SVN::Pool &in_pool);
 
  public:
   /**
@@ -57,7 +58,7 @@ class Path
    *
    * @param pi_path Path string
    */
-  Path(const std::string &pi_path = "");
+  Path(const std::string &pi_path, SVN::Pool &in_pool);
 
   /**
    * Constructor
@@ -65,14 +66,14 @@ class Path
    * @see Path::Path (const std::string &)
    * @param pi_path Path string
    */
-  Path(const char *pi_path);
+  Path(const char *pi_path, SVN::Pool &in_pool);
 
   /**
    * Copy constructor
    *
    * @param pi_path Path to be copied
    */
-  Path(const Path &pi_path);
+  Path(const Path &pi_path, SVN::Pool &in_pool);
 
   /**
    * Assignment operator

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/Pool.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/Pool.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/Pool.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/Pool.cpp Tue Oct 11 19:52:34 2011
@@ -31,14 +31,27 @@
 #include "svn_pools.h"
 
 /**
- * Constructor to create one apr pool as the subpool of the global pool
- * store this pool as the request pool.
+ * Constructor to create one apr pool as the subpool of the global pool.
  */
 SVN::Pool::Pool()
 {
-  JNICriticalSection criticalSection(*JNIUtil::getGlobalPoolMutex());
   m_pool = svn_pool_create(JNIUtil::getPool());
-  JNIUtil::setRequestPool(this);
+}
+
+/**
+ * Constructor to create one apr pool as a subpool of the passed pool.
+ */
+SVN::Pool::Pool(const Pool &parent_pool)
+{
+  m_pool = svn_pool_create(parent_pool.m_pool);
+}
+
+/**
+ * Constructor to create one apr pool as a subpool of the passed pool.
+ */
+SVN::Pool::Pool(apr_pool_t *parent_pool)
+{
+  m_pool = svn_pool_create(parent_pool);
 }
 
 /**
@@ -47,8 +60,10 @@ SVN::Pool::Pool()
  */
 SVN::Pool::~Pool()
 {
-  JNICriticalSection criticalSection(*JNIUtil::getGlobalPoolMutex());
-  JNIUtil::setRequestPool(NULL);
   if (m_pool)
-    svn_pool_destroy(m_pool);
+    {
+      svn_pool_destroy(m_pool);
+      m_pool = NULL;
+    }
 }
+

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/Pool.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/Pool.h?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/Pool.h (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/Pool.h Tue Oct 11 19:52:34 2011
@@ -39,8 +39,10 @@ namespace SVN {
   {
   public:
     Pool();
+    Pool(const Pool &parent_pool);
+    Pool(apr_pool_t *parent_pool);
     ~Pool();
-    apr_pool_t *pool() const;
+    apr_pool_t *getPool() const;
     void clear() const;
 
   private:
@@ -50,14 +52,14 @@ namespace SVN {
     apr_pool_t *m_pool;
 
     /**
-     * We declare the copy constructor and assignment operator private
-     * here, so that the compiler won't inadvertently use them for us.
-     * The default copy constructor just copies all the data members,
-     * which would create two pointers to the same pool, one of which
-     * would get destroyed while the other thought it was still
-     * valid...and BOOM!  Hence the private declaration.
+     * We declare the assignment operator private here, so that the compiler
+     * won't inadvertently use them for us.
+     * The default code just copies all the data members, which would create
+     * two pointers to the same pool, one of which would get destroyed while
+     * the other thought it was still valid...and BOOM!
+     *
+     * Hence the private declaration.
      */
-    Pool(Pool &that);
     Pool &operator=(Pool &that);
   };
 
@@ -65,7 +67,7 @@ namespace SVN {
   // need to be implemented in the header file for that to happen.
 
   inline
-  apr_pool_t *Pool::pool() const
+  apr_pool_t *Pool::getPool() const
   {
     return m_pool;
   }

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/Prompter.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/Prompter.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/Prompter.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/Prompter.cpp Tue Oct 11 19:52:34 2011
@@ -361,9 +361,9 @@ bool Prompter::prompt(const char *realm,
   return ret ? true:false;
 }
 
-svn_auth_provider_object_t *Prompter::getProviderSimple()
+svn_auth_provider_object_t *Prompter::getProviderSimple(SVN::Pool &in_pool)
 {
-  apr_pool_t *pool = JNIUtil::getRequestPool()->pool();
+  apr_pool_t *pool = in_pool.getPool();
   svn_auth_provider_object_t *provider;
   svn_auth_get_simple_prompt_provider(&provider,
                                       simple_prompt,
@@ -374,9 +374,9 @@ svn_auth_provider_object_t *Prompter::ge
   return provider;
 }
 
-svn_auth_provider_object_t *Prompter::getProviderUsername()
+svn_auth_provider_object_t *Prompter::getProviderUsername(SVN::Pool &in_pool)
 {
-  apr_pool_t *pool = JNIUtil::getRequestPool()->pool();
+  apr_pool_t *pool = in_pool.getPool();
   svn_auth_provider_object_t *provider;
   svn_auth_get_username_prompt_provider(&provider,
                                         username_prompt,
@@ -387,9 +387,9 @@ svn_auth_provider_object_t *Prompter::ge
   return provider;
 }
 
-svn_auth_provider_object_t *Prompter::getProviderServerSSLTrust()
+svn_auth_provider_object_t *Prompter::getProviderServerSSLTrust(SVN::Pool &in_pool)
 {
-  apr_pool_t *pool = JNIUtil::getRequestPool()->pool();
+  apr_pool_t *pool = in_pool.getPool();
   svn_auth_provider_object_t *provider;
   svn_auth_get_ssl_server_trust_prompt_provider
     (&provider, ssl_server_trust_prompt, this, pool);
@@ -397,9 +397,9 @@ svn_auth_provider_object_t *Prompter::ge
   return provider;
 }
 
-svn_auth_provider_object_t *Prompter::getProviderClientSSL()
+svn_auth_provider_object_t *Prompter::getProviderClientSSL(SVN::Pool &in_pool)
 {
-  apr_pool_t *pool = JNIUtil::getRequestPool()->pool();
+  apr_pool_t *pool = in_pool.getPool();
   svn_auth_provider_object_t *provider;
   svn_auth_get_ssl_client_cert_prompt_provider(&provider,
                                                ssl_client_cert_prompt,
@@ -410,9 +410,9 @@ svn_auth_provider_object_t *Prompter::ge
   return provider;
 }
 
-svn_auth_provider_object_t *Prompter::getProviderClientSSLPassword()
+svn_auth_provider_object_t *Prompter::getProviderClientSSLPassword(SVN::Pool &in_pool)
 {
-  apr_pool_t *pool = JNIUtil::getRequestPool()->pool();
+  apr_pool_t *pool = in_pool.getPool();
   svn_auth_provider_object_t *provider;
   svn_auth_get_ssl_client_cert_pw_prompt_provider
     (&provider, ssl_client_cert_pw_prompt, this, 2 /* retry limit */,

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/Prompter.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/Prompter.h?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/Prompter.h (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/Prompter.h Tue Oct 11 19:52:34 2011
@@ -30,7 +30,7 @@
 #include <jni.h>
 #include "svn_auth.h"
 #include <string>
-
+#include "Pool.h"
 /**
  * This class requests username/password and informations about
  * ssl-certificates from the user.
@@ -96,11 +96,11 @@ class Prompter
  public:
   static Prompter *makeCPrompter(jobject jprompter);
   ~Prompter();
-  svn_auth_provider_object_t *getProviderUsername();
-  svn_auth_provider_object_t *getProviderSimple();
-  svn_auth_provider_object_t *getProviderServerSSLTrust();
-  svn_auth_provider_object_t *getProviderClientSSL();
-  svn_auth_provider_object_t *getProviderClientSSLPassword();
+  svn_auth_provider_object_t *getProviderUsername(SVN::Pool &in_pool);
+  svn_auth_provider_object_t *getProviderSimple(SVN::Pool &in_pool);
+  svn_auth_provider_object_t *getProviderServerSSLTrust(SVN::Pool &in_pool);
+  svn_auth_provider_object_t *getProviderClientSSL(SVN::Pool &in_pool);
+  svn_auth_provider_object_t *getProviderClientSSLPassword(SVN::Pool &in_pool);
 
   static svn_error_t *plaintext_prompt(svn_boolean_t *may_save_plaintext,
                                        const char *realmstring,

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/RevisionRange.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/RevisionRange.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/RevisionRange.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/RevisionRange.cpp Tue Oct 11 19:52:34 2011
@@ -87,7 +87,7 @@ const svn_opt_revision_range_t *Revision
     return NULL;
 
   svn_opt_revision_range_t *range =
-    (svn_opt_revision_range_t *) apr_palloc(pool.pool(), sizeof(*range));
+    (svn_opt_revision_range_t *) apr_palloc(pool.getPool(), sizeof(*range));
 
   range->start = *startRevision.revision();
   if (JNIUtil::isExceptionThrown())

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/RevpropTable.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/RevpropTable.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/RevpropTable.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/RevpropTable.cpp Tue Oct 11 19:52:34 2011
@@ -46,15 +46,15 @@ const apr_hash_t *RevpropTable::hash(con
   if (m_revprops.size() == 0)
     return NULL;
 
-  apr_hash_t *revprop_table = apr_hash_make(pool.pool());
+  apr_hash_t *revprop_table = apr_hash_make(pool.getPool());
 
   std::map<std::string, std::string>::const_iterator it;
   for (it = m_revprops.begin(); it != m_revprops.end(); ++it)
     {
-      const char *propname = apr_pstrdup(pool.pool(), it->first.c_str());
+      const char *propname = apr_pstrdup(pool.getPool(), it->first.c_str());
       if (!svn_prop_name_is_valid(propname))
         {
-          const char *msg = apr_psprintf(pool.pool(),
+          const char *msg = apr_psprintf(pool.getPool(),
                                          "Invalid property name: '%s'",
                                          propname);
           JNIUtil::throwNativeException(JAVA_PACKAGE "/ClientException", msg,
@@ -63,7 +63,7 @@ const apr_hash_t *RevpropTable::hash(con
         }
 
       svn_string_t *propval = svn_string_create(it->second.c_str(),
-                                                pool.pool());
+                                                pool.getPool());
 
       apr_hash_set(revprop_table, propname, APR_HASH_KEY_STRING, propval);
     }

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNBase.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNBase.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNBase.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNBase.cpp Tue Oct 11 19:52:34 2011
@@ -28,6 +28,7 @@
 #include "JNIUtil.h"
 
 SVNBase::SVNBase()
+    : pool(JNIUtil::getPool())
 {
   jthis = NULL;
 }
@@ -57,14 +58,17 @@ jlong SVNBase::findCppAddrForJObject(job
       if (JNIUtil::isJavaExceptionThrown())
         return 0;
 
-      /* jthis is not guaranteed to be the same between JNI invocations, so
-         we do a little dance here and store the updated version in our
-         object for this invocation.
-
-         findCppAddrForJObject() is, by necessity, called before any other
-         methods on the C++ object, so by doing this we can guarantee a valid
-         jthis pointer for subsequent uses. */
-      (reinterpret_cast<SVNBase *> (cppAddr))->jthis = jthis;
+      if (cppAddr)
+        {
+          /* jthis is not guaranteed to be the same between JNI invocations, so
+             we do a little dance here and store the updated version in our
+             object for this invocation.
+
+             findCppAddrForJObject() is, by necessity, called before any other
+             methods on the C++ object, so by doing this we can guarantee a
+             valid jthis pointer for subsequent uses. */
+          (reinterpret_cast<SVNBase *> (cppAddr))->jthis = jthis;
+        }
       return cppAddr;
     }
 }

Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNBase.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNBase.h?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNBase.h (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNBase.h Tue Oct 11 19:52:34 2011
@@ -28,6 +28,7 @@
 #define SVNBASE_H
 
 #include <jni.h>
+#include "Pool.h"
 
 class SVNBase
 {
@@ -96,6 +97,9 @@ class SVNBase
    */
   static void findCppAddrFieldID(jfieldID *fid, const char *className,
                                  JNIEnv *env);
+
+protected:
+    SVN::Pool pool;
 };
 
 #endif // SVNBASE_H