You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by vm...@apache.org on 2012/12/27 04:00:08 UTC

svn commit: r1426107 [1/2] - in /subversion/branches/javahl-ra: ./ subversion/bindings/swig/perl/native/ subversion/bindings/swig/ruby/svn/ subversion/bindings/swig/ruby/test/ subversion/bindings/swig/ruby/test/test-unit-ext/ subversion/include/ subver...

Author: vmpn
Date: Thu Dec 27 03:00:07 2012
New Revision: 1426107

URL: http://svn.apache.org/viewvc?rev=1426107&view=rev
Log:
On the javahl-ra branch:

Bring up-to-date with trunk@1407273

Modified:
    subversion/branches/javahl-ra/   (props changed)
    subversion/branches/javahl-ra/Makefile.in
    subversion/branches/javahl-ra/configure.ac
    subversion/branches/javahl-ra/subversion/bindings/swig/perl/native/Makefile.PL.in
    subversion/branches/javahl-ra/subversion/bindings/swig/ruby/svn/info.rb
    subversion/branches/javahl-ra/subversion/bindings/swig/ruby/svn/util.rb
    subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/my-assertions.rb
    subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test-unit-ext.rb
    subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test-unit-ext/priority.rb
    subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_client.rb
    subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_core.rb
    subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_delta.rb
    subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_fs.rb
    subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_repos.rb
    subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_wc.rb
    subversion/branches/javahl-ra/subversion/include/private/svn_client_private.h
    subversion/branches/javahl-ra/subversion/include/svn_client.h
    subversion/branches/javahl-ra/subversion/libsvn_client/merge.c
    subversion/branches/javahl-ra/subversion/libsvn_ra_serf/update.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/copy.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/update_editor.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db.h
    subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_private.h
    subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_update_move.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_wcroot.c
    subversion/branches/javahl-ra/subversion/svn/mergeinfo-cmd.c
    subversion/branches/javahl-ra/subversion/tests/cmdline/copy_tests.py
    subversion/branches/javahl-ra/subversion/tests/cmdline/merge_automatic_tests.py
    subversion/branches/javahl-ra/subversion/tests/cmdline/special_tests.py
    subversion/branches/javahl-ra/subversion/tests/cmdline/svnrdump_tests.py
    subversion/branches/javahl-ra/subversion/tests/cmdline/svnrdump_tests_data/trunk-A-changes.expected.dump
    subversion/branches/javahl-ra/subversion/tests/cmdline/svnrdump_tests_data/trunk-only.expected.dump
    subversion/branches/javahl-ra/subversion/tests/cmdline/svntest/sandbox.py
    subversion/branches/javahl-ra/subversion/tests/cmdline/update_tests.py
    subversion/branches/javahl-ra/subversion/tests/libsvn_wc/op-depth-test.c
    subversion/branches/javahl-ra/tools/server-side/fsfs-reorg.c

Propchange: subversion/branches/javahl-ra/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1405970-1407273

Modified: subversion/branches/javahl-ra/Makefile.in
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/Makefile.in?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/Makefile.in (original)
+++ subversion/branches/javahl-ra/Makefile.in Thu Dec 27 03:00:07 2012
@@ -283,7 +283,7 @@ INSTALL_EXTRA_SWIG_PY=\
 
 # export an env variable so that the tests can run without being installed
 TEST_SHLIB_VAR_SWIG_PY=\
-  if [ "@SVN_APR_SHLIB_PATH_VAR@" == "DYLD_LIBRARY_PATH" ]; then \
+  if [ "@SVN_APR_SHLIB_PATH_VAR@" = "DYLD_LIBRARY_PATH" ]; then \
     for d in $(SWIG_PY_DIR)/libsvn_swig_py $(SWIG_PY_DIR)/../../../libsvn_*; do \
       if [ -n "$$DYLD_LIBRARY_PATH" ]; then \
         @SVN_APR_SHLIB_PATH_VAR@="$$@SVN_APR_SHLIB_PATH_VAR@:$$d/.libs"; \
@@ -326,7 +326,7 @@ INSTALL_EXTRA_SWIG_RB=\
 
 # export an env variable so that the tests can run without being installed
 TEST_SHLIB_VAR_SWIG_RB=\
-  if [ "@SVN_APR_SHLIB_PATH_VAR@" == "DYLD_LIBRARY_PATH" ]; then \
+  if [ "@SVN_APR_SHLIB_PATH_VAR@" = "DYLD_LIBRARY_PATH" ]; then \
     for d in $(SWIG_PY_DIR)/libsvn_swig_rb $(SWIG_PY_DIR)/../../../libsvn_*; do \
       if [ -n "$$DYLD_LIBRARY_PATH" ]; then \
         @SVN_APR_SHLIB_PATH_VAR@="$$@SVN_APR_SHLIB_PATH_VAR@:$$d/.libs"; \
@@ -842,9 +842,14 @@ swig-rb: autogen-swig-rb
 check-swig-rb: swig-rb svnserve
 	$(TEST_SHLIB_VAR_SWIG_RB) \
 	cd $(SWIG_RB_DIR); \
-	  $(RUBY) -I $(SWIG_RB_SRC_DIR) \
-	    $(SWIG_RB_SRC_DIR)/test/run-test.rb \
-	    --verbose=$(SWIG_RB_TEST_VERBOSE)
+          if [ "$(RUBY_MAJOR)" -eq 1 -a "$(RUBY_MINOR)" -lt 9 ] ; then \
+            $(RUBY) -I $(SWIG_RB_SRC_DIR) \
+              $(SWIG_RB_SRC_DIR)/test/run-test.rb \
+	      --verbose=$(SWIG_RB_TEST_VERBOSE); \
+          else \
+	    $(RUBY) -I $(SWIG_RB_SRC_DIR) \
+	      $(SWIG_RB_SRC_DIR)/test/run-test.rb; \
+          fi
 
 EXTRACLEAN_SWIG_RB=rm -f $(SWIG_RB_SRC_DIR)/svn_*.c $(SWIG_RB_SRC_DIR)/core.c
 

Modified: subversion/branches/javahl-ra/configure.ac
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/configure.ac?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/configure.ac (original)
+++ subversion/branches/javahl-ra/configure.ac Thu Dec 27 03:00:07 2012
@@ -1145,7 +1145,7 @@ AC_PATH_PROG(PERL, perl, none)
 if test -n "$RUBY"; then
   AC_PATH_PROG(RUBY, "$RUBY", none)
 else
-  AC_PATH_PROGS(RUBY, ruby ruby1.8 ruby18, none)
+  AC_PATH_PROGS(RUBY, ruby ruby1.8 ruby18 ruby1.9 ruby1 ruby1.9.3 ruby193, none)
 fi
 if test "$RUBY" != "none"; then
   AC_MSG_CHECKING([rb_hash_foreach])
@@ -1154,7 +1154,7 @@ if test "$RUBY" != "none"; then
     if test -n "$RDOC"; then
       AC_PATH_PROG(RDOC, "$RDOC", none)
     else
-      AC_PATH_PROGS(RDOC, rdoc rdoc1.8 rdoc18, none)
+      AC_PATH_PROGS(RDOC, rdoc rdoc1.8 rdoc18 rdoc1.9 rdoc19 rdoc1.9.3 rdoc193, none)
     fi
     AC_CACHE_CHECK([for Ruby major version], [svn_cv_ruby_major],[
     svn_cv_ruby_major="`$RUBY -rrbconfig -e 'print RbConfig::CONFIG.fetch(%q(MAJOR))'`"
@@ -1166,14 +1166,23 @@ if test "$RUBY" != "none"; then
     ])
     RUBY_MINOR="$svn_cv_ruby_minor"
 
+    AC_CACHE_CHECK([for Ruby teeny version], [svn_cv_ruby_teeny],[
+    svn_cv_ruby_teeny="`$RUBY -rrbconfig -e 'major, minor, teeny = RUBY_VERSION.split("."); print teeny;'`"
+    ])
+    RUBY_TEENY="$svn_cv_ruby_teeny"
+    
     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.
+    AC_SUBST(RUBY_TEENY)
+    if test \( "$RUBY_MAJOR" -eq "1" -a "$RUBY_MINOR" -gt "8" -a "$RUBY_TEENY" -lt "3" \); then
+      # Disallow Ruby between 1.8.7 and 1.9.3
       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])
+      AC_MSG_WARN([The detected Ruby is between 1.9 and 1.9.3])
+      AC_MSG_WARN([Only 1.8.x and 1.9.3 releases are supported at this time])
+    elif test \(  "$RUBY_MAJOR" -eq "1" -a "$RUBY_MINOR" -eq "9" -a "$RUBY_TEENY" -eq "3" \); then
+      #Warn about 1.9.3 support
+      AC_MSG_WARN([WARNING: The detected Ruby is 1.9.3])
+      AC_MSG_WARN([WARNING: Only 1.8.x releases are fully supported, 1.9.3 support is new])
     fi
   else
     AC_MSG_RESULT([no])

Modified: subversion/branches/javahl-ra/subversion/bindings/swig/perl/native/Makefile.PL.in
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/swig/perl/native/Makefile.PL.in?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/swig/perl/native/Makefile.PL.in (original)
+++ subversion/branches/javahl-ra/subversion/bindings/swig/perl/native/Makefile.PL.in Thu Dec 27 03:00:07 2012
@@ -53,6 +53,7 @@ my $includes = '@SVN_APR_INCLUDES@ @SVN_
 # https://sourceforge.net/tracker/?func=detail&aid=3571361&group_id=1645&atid=101645
 # SWIG is using C++ style comments in an extern "C" code.
 $cflags =~ s/-ansi\s+//g;
+$cflags =~ s/-std=c89\s+//g;
 
 # According to the log of r7937, the flags guarded by the conditional break
 # the build on FreeBSD if not conditionalized.

Modified: subversion/branches/javahl-ra/subversion/bindings/swig/ruby/svn/info.rb
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/swig/ruby/svn/info.rb?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/swig/ruby/svn/info.rb (original)
+++ subversion/branches/javahl-ra/subversion/bindings/swig/ruby/svn/info.rb Thu Dec 27 03:00:07 2012
@@ -229,7 +229,9 @@ module Svn
 
     def parse_diff_unified(entry)
       in_content = false
-      entry.body.each do |line|
+      # ruby 1.8 and ruby 1.9 compat
+      each_meth = entry.body.respond_to?(:each_line) ? :each_line : :each
+      entry.body.send(each_meth) do |line|
         case line
         when /^@@/
           in_content = true

Modified: subversion/branches/javahl-ra/subversion/bindings/swig/ruby/svn/util.rb
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/swig/ruby/svn/util.rb?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/swig/ruby/svn/util.rb (original)
+++ subversion/branches/javahl-ra/subversion/bindings/swig/ruby/svn/util.rb Thu Dec 27 03:00:07 2012
@@ -36,7 +36,7 @@ module Svn
   module Util #:nodoc:
     module_function
     def to_ruby_class_name(name)
-      name.split("_").collect do |x|
+      name.to_s.split("_").collect do |x|
         "#{x[0,1].upcase}#{x[1..-1].downcase}"
       end.join("")
     end

Modified: subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/my-assertions.rb
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/my-assertions.rb?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/my-assertions.rb (original)
+++ subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/my-assertions.rb Thu Dec 27 03:00:07 2012
@@ -24,20 +24,33 @@ module Test
   module Unit
     module Assertions
 
+      # make an intermediary assertion block handler
+      def _my_assert_block(&block)
+       if RUBY_VERSION > '1.9'
+         assert_block do
+           yield
+         end
+       else
+         _wrap_assertion do
+           yield
+         end
+       end
+      end
+
       def assert_true(boolean, message=nil)
-        _wrap_assertion do
+        _my_assert_block do
           assert_equal(true, boolean, message)
         end
       end
 
       def assert_false(boolean, message=nil)
-        _wrap_assertion do
+        _my_assert_block do
           assert_equal(false, boolean, message)
         end
       end
 
       def assert_nested_sorted_array(expected, actual, message=nil)
-        _wrap_assertion do
+        _my_assert_block do
           assert_equal(expected.collect {|elem| elem.sort},
                        actual.collect {|elem| elem.sort},
                        message)
@@ -45,7 +58,7 @@ module Test
       end
 
       def assert_equal_log_entries(expected, actual, message=nil)
-        _wrap_assertion do
+        _my_assert_block do
           actual = actual.collect do |entry|
             changed_paths = entry.changed_paths
             changed_paths.each_key do |path|

Modified: subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test-unit-ext.rb
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test-unit-ext.rb?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test-unit-ext.rb (original)
+++ subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test-unit-ext.rb Thu Dec 27 03:00:07 2012
@@ -17,7 +17,7 @@
 #    under the License.
 # ====================================================================
 
-require "test-unit-ext/always-show-result"
+require "test-unit-ext/always-show-result" if RUBY_VERSION < '1.9.3'
 require "test-unit-ext/priority"
-require "test-unit-ext/backtrace-filter"
-require "test-unit-ext/long-display-for-emacs"
+require "test-unit-ext/backtrace-filter" if RUBY_VERSION < '1.9.3'
+require "test-unit-ext/long-display-for-emacs" if RUBY_VERSION < '1.9.3'

Modified: subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test-unit-ext/priority.rb
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test-unit-ext/priority.rb?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test-unit-ext/priority.rb (original)
+++ subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test-unit-ext/priority.rb Thu Dec 27 03:00:07 2012
@@ -179,7 +179,7 @@ module Test
         apply_priority
         !@tests.empty?
       end
-    end
+    end if RUBY_VERSION < '1.9.3'
 
     class AutoRunner
       alias_method :original_options, :options

Modified: subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_client.rb
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_client.rb?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_client.rb (original)
+++ subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_client.rb Thu Dec 27 03:00:07 2012
@@ -2203,7 +2203,10 @@ class SvnClientTest < Test::Unit::TestCa
 
     make_context(log) do |ctx|
       items = nil
-      ctx.set_log_msg_func do |items|
+      ctx.set_log_msg_func do |l_items|
+        # ruby 1.8 will carry the assignment of items out of the 
+        # scope of this block, 1.9 will not, so we must assign.
+        items = l_items
         [true, log]
       end
 

Modified: subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_core.rb
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_core.rb?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_core.rb (original)
+++ subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_core.rb Thu Dec 27 03:00:07 2012
@@ -1,3 +1,4 @@
+# encoding = utf-8
 # ====================================================================
 #    Licensed to the Apache Software Foundation (ASF) under one
 #    or more contributor license agreements.  See the NOTICE file
@@ -52,7 +53,13 @@ class SvnCoreTest < Test::Unit::TestCase
     now = Time.now.gmtime
     str = now.strftime("%Y-%m-%dT%H:%M:%S.") + "#{now.usec}Z"
 
-    assert_equal(now, Time.from_svn_format(str))
+    if RUBY_VERSION > '1.9'
+      # ruby 1.9 Time comparison gets into the nano-seconds, strftime
+      # shaves these off. So we can compare epoch time instead
+      assert_equal(now.to_i, Time.from_svn_format(str).gmtime.to_i)
+    else
+      assert_equal(now, Time.from_svn_format(str).gmtime)
+    end
 
     apr_time = now.to_i * 1000000 + now.usec
     assert_equal(apr_time, now.to_apr_time)
@@ -244,7 +251,11 @@ class SvnCoreTest < Test::Unit::TestCase
       config_infos << [section, name, value]
     end
     assert_equal(infos.sort, config_infos.sort)
-    assert_equal(infos.sort, config.collect {|args| args}.sort)
+    if RUBY_VERSION > '1.9'
+      assert_equal(infos.sort, config.collect {|sect,name,val| [sect,name,val]}.sort)
+    else
+      assert_equal(infos.sort, config.collect {|args| args}.sort)
+    end
   end
 
   def test_config_find_group
@@ -532,7 +543,13 @@ EOD
     date_str = now.strftime("%Y-%m-%dT%H:%M:%S")
     date_str << ".#{now.usec}Z"
     info.date = date_str
-    assert_equal(now, info.date)
+    if RUBY_VERSION > '1.9'
+      # ruby 1.9 Time comparison gets into the nano-seconds, strftime
+      # shaves these off. So we can compare epoch time instead
+      assert_equal(now.to_i, info.date.gmtime.to_i)
+    else
+      assert_equal(now, info.date.gmtime)
+    end
   end
 
   def test_svn_prop

Modified: subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_delta.rb
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_delta.rb?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_delta.rb (original)
+++ subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_delta.rb Thu Dec 27 03:00:07 2012
@@ -1,3 +1,4 @@
+# encoding: UTF-8
 # ====================================================================
 #    Licensed to the Apache Software Foundation (ASF) under one
 #    or more contributor license agreements.  See the NOTICE file
@@ -17,9 +18,10 @@
 #    under the License.
 # ====================================================================
 
+require "my-assertions"
 require "util"
 require "stringio"
-require 'md5'
+require 'digest/md5'
 require 'tempfile'
 
 require "svn/info"
@@ -46,8 +48,8 @@ class SvnDeltaTest < Test::Unit::TestCas
     target = StringIO.new(t)
     stream = Svn::Delta::TextDeltaStream.new(source, target)
     assert_nil(stream.md5_digest)
-    _wrap_assertion do
-      stream.each do |window|
+    _my_assert_block do
+      ret = stream.each do |window|
         window.ops.each do |op|
           op_size = op.offset + op.length
           case op.action_code
@@ -62,8 +64,9 @@ class SvnDeltaTest < Test::Unit::TestCas
           end
         end
       end
+      true if RUBY_VERSION > '1.9' # this block returns nil in > ruby '1.9'
     end
-    assert_equal(MD5.new(t).hexdigest, stream.md5_digest)
+    assert_equal(Digest::MD5.hexdigest(t), stream.md5_digest)
   end
 
   def test_txdelta_window_compose
@@ -81,7 +84,7 @@ class SvnDeltaTest < Test::Unit::TestCas
       end
     end
 
-    _wrap_assertion do
+    _my_assert_block do
       composed_window.ops.each do |op|
         op_size = op.offset + op.length
         case op.action_code
@@ -161,21 +164,33 @@ class SvnDeltaTest < Test::Unit::TestCas
     assert_equal(target_text * 3, apply_result.read)
   end
 
+  def get_regex(pattern, encoding='ASCII', options=0)
+    Regexp.new(pattern.encode(encoding),options)
+  end
+
   def test_svndiff
     source_text = "abcde"
     target_text = "abXde"
     source = StringIO.new(source_text)
     target = StringIO.new(target_text)
     stream = Svn::Delta::TextDeltaStream.new(source, target)
-
-    output = StringIO.new("")
+    
+    if RUBY_VERSION > '1.9' 
+      output = StringIO.new("".encode('ASCII-8BIT'))
+    else
+      output = StringIO.new("")
+    end
     handler = Svn::Delta.svndiff_handler(output)
 
     Svn::Delta.send(target_text, handler)
     output.rewind
     result = output.read
-    assert_match(/\ASVN.*#{target_text}\z/, result)
-
+    if RUBY_VERSION > '1.9' 
+      regex = get_regex("\\ASVN.*#{target_text}\\Z".encode('utf-8'),result.encoding,16)
+      assert_match(regex, result)
+    else
+      assert_match(/\ASVN.*#{target_text}\Z/, result)
+    end
     # skip svndiff window
     input = StringIO.new(result[4..-1])
     window = Svn::Delta.read_svndiff_window(input, 0)

Modified: subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_fs.rb
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_fs.rb?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_fs.rb (original)
+++ subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_fs.rb Thu Dec 27 03:00:07 2012
@@ -20,7 +20,7 @@
 require "my-assertions"
 require "util"
 require "time"
-require "md5"
+require "digest/md5"
 
 require "svn/core"
 require "svn/fs"
@@ -49,14 +49,15 @@ class SvnFsTest < Test::Unit::TestCase
 
     assert(!File.exist?(path))
     fs = nil
-    callback = Proc.new do |fs|
+    callback = Proc.new do |t_fs|
       assert(File.exist?(path))
       assert_equal(fs_type, Svn::Fs.type(path))
-      fs.set_warning_func do |err|
+      t_fs.set_warning_func do |err|
         p err
         abort
       end
-      assert_equal(path, fs.path)
+      assert_equal(path, t_fs.path)
+      fs = t_fs
     end
     yield(:create, [path, config], callback)
 
@@ -162,7 +163,7 @@ class SvnFsTest < Test::Unit::TestCase
 
       assert_equal(src, @fs.root.file_contents(path_in_repos){|f| f.read})
       assert_equal(src.length, @fs.root.file_length(path_in_repos))
-      assert_equal(MD5.new(src).hexdigest,
+      assert_equal(Digest::MD5.hexdigest(src),
                    @fs.root.file_md5_checksum(path_in_repos))
 
       assert_equal([path_in_repos], @fs.root.paths_changed.keys)
@@ -364,7 +365,7 @@ class SvnFsTest < Test::Unit::TestCase
 
       File.open(path, "w") {|f| f.print(modified)}
       @fs.transaction do |txn|
-        checksum = MD5.new(normalize_line_break(result)).hexdigest
+        checksum = Digest::MD5.hexdigest(normalize_line_break(result))
         stream = txn.root.apply_text(path_in_repos, checksum)
         stream.write(normalize_line_break(result))
         stream.close
@@ -392,8 +393,8 @@ class SvnFsTest < Test::Unit::TestCase
 
       File.open(path, "w") {|f| f.print(modified)}
       @fs.transaction do |txn|
-        base_checksum = MD5.new(normalize_line_break(src)).hexdigest
-        checksum = MD5.new(normalize_line_break(result)).hexdigest
+        base_checksum = Digest::MD5.hexdigest(normalize_line_break(src))
+        checksum = Digest::MD5.hexdigest(normalize_line_break(result))
         handler = txn.root.apply_textdelta(path_in_repos,
                                            base_checksum, checksum)
         assert_raises(Svn::Error::ChecksumMismatch) do

Modified: subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_repos.rb
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_repos.rb?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_repos.rb (original)
+++ subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_repos.rb Thu Dec 27 03:00:07 2012
@@ -98,11 +98,12 @@ class SvnReposTest < Test::Unit::TestCas
     fs_type = Svn::Fs::TYPE_FSFS
     fs_config = {Svn::Fs::CONFIG_FS_TYPE => fs_type}
     repos = nil
-    Svn::Repos.create(tmp_repos_path, {}, fs_config) do |repos|
+    Svn::Repos.create(tmp_repos_path, {}, fs_config) do |t_repos|
       assert(File.exist?(tmp_repos_path))
-      fs_type_path = File.join(repos.fs.path, Svn::Fs::CONFIG_FS_TYPE)
+      fs_type_path = File.join(t_repos.fs.path, Svn::Fs::CONFIG_FS_TYPE)
       assert_equal(fs_type, File.open(fs_type_path) {|f| f.read.chop})
-      repos.fs.set_warning_func(&warning_func)
+      t_repos.fs.set_warning_func(&warning_func)
+      repos = t_repos
     end
 
     assert(repos.closed?)

Modified: subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_wc.rb
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_wc.rb?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_wc.rb (original)
+++ subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_wc.rb Thu Dec 27 03:00:07 2012
@@ -534,7 +534,7 @@ EOE
       ctx.ci(lf_path)
 
       Svn::Wc::AdmAccess.open(nil, @wc_path, true, 5) do |access|
-        _wrap_assertion do
+        _my_assert_block do
           File.open(src_path, "wb") {|f| f.print(source)}
           args = [method_name, src_path, crlf_path, Svn::Wc::TRANSLATE_FROM_NF]
           result = yield(access.send(*args), source)
@@ -1089,7 +1089,11 @@ EOE
         assert_not_nil context
         assert_kind_of Svn::Wc::Context, context
       end
-      assert_nil result;
+      if RUBY_VERSION > '1.9'
+        assert_equal(result,true)
+      else
+        assert_nil result
+      end
     end
   end
 

Modified: subversion/branches/javahl-ra/subversion/include/private/svn_client_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/include/private/svn_client_private.h?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/private/svn_client_private.h (original)
+++ subversion/branches/javahl-ra/subversion/include/private/svn_client_private.h Thu Dec 27 03:00:07 2012
@@ -226,21 +226,6 @@ svn_client__wc_node_get_origin(svn_clien
                                apr_pool_t *result_pool,
                                apr_pool_t *scratch_pool);
 
-/* Set *YCA, *BASE, *RIGHT, *TARGET to the repository locations of the
- * youngest common ancestor of the branches, the base chosen for 3-way
- * merge, the right-hand side of the source diff, and the target WC.
- *
- * Any of the output pointers may be NULL if not wanted.
- */
-svn_error_t *
-svn_client__automatic_merge_get_locations(
-                                svn_client__pathrev_t **yca,
-                                svn_client__pathrev_t **base,
-                                svn_client__pathrev_t **right,
-                                svn_client__pathrev_t **target,
-                                const svn_client_automatic_merge_t *merge,
-                                apr_pool_t *result_pool);
-
 
 #ifdef __cplusplus
 }

Modified: subversion/branches/javahl-ra/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/include/svn_client.h?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/svn_client.h (original)
+++ subversion/branches/javahl-ra/subversion/include/svn_client.h Thu Dec 27 03:00:07 2012
@@ -3376,19 +3376,42 @@ svn_client_diff_summarize_peg(const char
  * @{
  */
 
-/* Details of an automatic merge. */
+/** Details of an automatic merge.
+ *
+ * The information includes the locations of the youngest common ancestor,
+ * merge base, and such like.  The details are private to the implementation
+ * but some of the information can be retrieved through the public APIs
+ * svn_client_automatic_merge_is_reintegrate_like() and
+ * svn_client_automatic_merge_get_locations().
+ *
+ * @since New in 1.8.
+ */
 typedef struct svn_client_automatic_merge_t svn_client_automatic_merge_t;
 
-/* Find the information needed to merge all unmerged changes from a source
- * branch into a target branch.  The information is the locations of the
- * youngest common ancestor, merge base, and such like.
+/** Find the information needed to merge all unmerged changes from a source
+ * branch into a target branch.
+ *
+ * Set @a *merge_p to the information needed to merge all unmerged changes
+ * (up to @a source_revision) from the source branch @a source_path_or_url
+ * at @a source_revision into the target WC at @a target_wcpath.
+ *
+ * The flags @a allow_mixed_rev, @a allow_local_mods and
+ * @a allow_switched_subtrees enable merging into a WC that is in any or all
+ * of the states described by their names, but only if this function decides
+ * that the merge will be in the same direction as the last automatic merge.
+ * If, on the other hand, the merge turns out to be in the opposite
+ * direction (that is, if svn_client_automatic_merge_is_reintegrate_like()
+ * would return true), then such states of the WC are not allowed regardless
+ * of these flags.  This function merely records these flags in the
+ * @a *merge_p structure; svn_client_do_automatic_merge() checks the WC
+ * state for compliance.
+ *
+ * Allocate the @a *merge_p structure in @a result_pool.
  *
- * Set *MERGE to the information needed to merge all unmerged changes
- * (up to SOURCE_REVISION) from the source branch SOURCE_PATH_OR_URL @
- * SOURCE_REVISION into the target WC at TARGET_WCPATH.
+ * @since New in 1.8.
  */
 svn_error_t *
-svn_client_find_automatic_merge(svn_client_automatic_merge_t **merge,
+svn_client_find_automatic_merge(svn_client_automatic_merge_t **merge_p,
                                 const char *source_path_or_url,
                                 const svn_opt_revision_t *source_revision,
                                 const char *target_wcpath,
@@ -3399,18 +3422,22 @@ svn_client_find_automatic_merge(svn_clie
                                 apr_pool_t *result_pool,
                                 apr_pool_t *scratch_pool);
 
-/* Find out what kind of automatic merge would be needed, when the target
+/** Find out what kind of automatic merge would be needed, when the target
  * is only known as a repository location rather than a WC.
  *
- * Like svn_client_find_automatic_merge() except that SOURCE_PATH_OR_URL @
- * SOURCE_REVISION should refer to a repository location and not a WC.
+ * Like svn_client_find_automatic_merge() except that @a source_path_or_url
+ * at @a source_revision should refer to a repository location and not a WC.
+ *
+ * @note The result, @a *merge_p, is not intended for passing to
+ * svn_client_do_automatic_merge().
+ *   ### We should do something about this.  Perhaps ensure
+ *       svn_client_do_automatic_merge() will work iff given a WC that
+ *       matches the stored repo-location of the target branch and is an
+ *       unmodified single-rev WC.
+ *
+ * Allocate the @a *merge_p structure in @a result_pool.
  *
- * ### The result, *MERGE_P, may not be suitable for passing to
- * svn_client_do_automatic_merge().  The target WC state would not be
- * checked (as in the ALLOW_* flags).  We should resolve this problem:
- * perhaps add the allow_* params here, or provide another way of setting
- * them; and perhaps ensure __do_...() will accept the result iff given a
- * WC that matches the stored target location.
+ * @since New in 1.8.
  */
 svn_error_t *
 svn_client_find_automatic_merge_no_wc(
@@ -3423,19 +3450,15 @@ svn_client_find_automatic_merge_no_wc(
                                  apr_pool_t *result_pool,
                                  apr_pool_t *scratch_pool);
 
-/* Perform an automatic merge.
+/** Perform an automatic merge.
  *
- * Merge according to MERGE into the WC at TARGET_WCPATH.
+ * Perform a merge, according to the information stored in @a merge, into
+ * the WC at @a target_wcpath.  The @a merge structure would typically come
+ * from calling svn_client_find_automatic_merge().
  *
  * The other parameters are as in svn_client_merge4().
  *
- * ### TODO: There's little point in this function being the only way the
- * caller can use the result of svn_client_find_automatic_merge().  The
- * contents of MERGE should be more public, or there should be other ways
- * the caller can use it, or these two functions should be combined into
- * one.  I want to make it more public, and also possibly have more ways
- * to use it in future (for example, do_automatic_merge_with_step_by_-
- * step_confirmation).
+ * @since New in 1.8.
  */
 svn_error_t *
 svn_client_do_automatic_merge(const svn_client_automatic_merge_t *merge,
@@ -3448,17 +3471,49 @@ svn_client_do_automatic_merge(const svn_
                               svn_client_ctx_t *ctx,
                               apr_pool_t *scratch_pool);
 
-/* Return TRUE iff the automatic merge represented by MERGE is going to be
- * a reintegrate-like merge: that is, merging in the opposite direction
- * from the last full merge.
+/** Return TRUE iff the automatic merge represented by @a merge is going to
+ * be a reintegrate-like merge: that is, merging in the opposite direction
+ * from the last automatic merge.
  *
- * This function exists because the merge is NOT really automatic and the
+ * This function exists because the automatic merge is not symmetric and the
  * client can be more friendly if it knows something about the differences.
+ *
+ * @since New in 1.8.
  */
 svn_boolean_t
 svn_client_automatic_merge_is_reintegrate_like(
         const svn_client_automatic_merge_t *merge);
 
+/** Retrieve the repository coordinates involved in an automatic merge.
+ *
+ * Set @a *yca_url, @a *yca_rev, @a *base_url, @a *base_rev, @a *right_url,
+ * @a *right_rev, @a *target_url, @a *target_rev to the repository locations
+ * of, respectively: the youngest common ancestor of the branches, the base
+ * chosen for 3-way merge, the right-hand side of the source diff, and the
+ * target WC.
+ *
+ * Set @a repos_root_url to the URL of the repository root.  The four
+ * locations are necessarily in the same repository.
+ *
+ * Allocate the results in @a result_pool.  Any of the output pointers may
+ * be NULL if not wanted.
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_client_automatic_merge_get_locations(
+                                const char **yca_url,
+                                svn_revnum_t *yca_rev,
+                                const char **base_url,
+                                svn_revnum_t *base_rev,
+                                const char **right_url,
+                                svn_revnum_t *right_rev,
+                                const char **target_url,
+                                svn_revnum_t *target_rev,
+                                const char **repos_root_url,
+                                const svn_client_automatic_merge_t *merge,
+                                apr_pool_t *result_pool);
+
 
 /** Merge changes from @a source1/@a revision1 to @a source2/@a revision2 into
  * the working-copy path @a target_wcpath.

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/merge.c?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/merge.c Thu Dec 27 03:00:07 2012
@@ -11788,21 +11788,37 @@ svn_client_automatic_merge_is_reintegrat
 }
 
 svn_error_t *
-svn_client__automatic_merge_get_locations(
-                                svn_client__pathrev_t **yca,
-                                svn_client__pathrev_t **base,
-                                svn_client__pathrev_t **right,
-                                svn_client__pathrev_t **target,
+svn_client_automatic_merge_get_locations(
+                                const char **yca_url,
+                                svn_revnum_t *yca_rev,
+                                const char **base_url,
+                                svn_revnum_t *base_rev,
+                                const char **right_url,
+                                svn_revnum_t *right_rev,
+                                const char **target_url,
+                                svn_revnum_t *target_rev,
+                                const char **repos_root_url,
                                 const svn_client_automatic_merge_t *merge,
                                 apr_pool_t *result_pool)
 {
-  if (yca)
-    *yca = svn_client__pathrev_dup(merge->yca, result_pool);
-  if (base)
-    *base = svn_client__pathrev_dup(merge->base, result_pool);
-  if (right)
-    *right = svn_client__pathrev_dup(merge->right, result_pool);
-  if (target)
-    *target = svn_client__pathrev_dup(merge->target, result_pool);
+  if (yca_url)
+    *yca_url = apr_pstrdup(result_pool, merge->yca->url);
+  if (yca_rev)
+    *yca_rev = merge->yca->rev;
+  if (base_url)
+    *base_url = apr_pstrdup(result_pool, merge->base->url);
+  if (base_rev)
+    *base_rev = merge->base->rev;
+  if (right_url)
+    *right_url = apr_pstrdup(result_pool, merge->right->url);
+  if (right_rev)
+    *right_rev = merge->right->rev;
+  if (target_url)
+    *target_url = apr_pstrdup(result_pool, merge->target->url);
+  if (target_rev)
+    *target_rev = merge->target->rev;
+  if (repos_root_url)
+    *repos_root_url = apr_pstrdup(result_pool, merge->yca->repos_root_url);
+
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/javahl-ra/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_ra_serf/update.c?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_ra_serf/update.c Thu Dec 27 03:00:07 2012
@@ -352,6 +352,10 @@ struct report_context_t {
 
   /* completed PROPFIND requests (contains svn_ra_serf__handler_t) */
   svn_ra_serf__list_t *done_propfinds;
+  svn_ra_serf__list_t *done_dir_propfinds;
+
+  /* list of outstanding prop changes (contains report_dir_t) */
+  svn_ra_serf__list_t *active_dir_propfinds;
 
   /* list of files that only have prop changes (contains report_info_t) */
   svn_ra_serf__list_t *file_propchanges_only;
@@ -367,6 +371,9 @@ struct report_context_t {
 
   /* The XML parser context for the REPORT response.  */
   svn_ra_serf__xml_parser_t *parser_ctx;
+
+  /* Did we close the root directory? */
+  svn_boolean_t closed_root;
 };
 
 
@@ -1176,6 +1183,44 @@ handle_stream(serf_request_t *request,
   /* not reached */
 }
 
+/* Close the directory represented by DIR -- and any suitable parents
+   thereof -- if we are able to do so.  This is the case whenever:
+
+     - there are no remaining open items within the directory, and
+     - the directory's XML close tag has been processed (so we know
+       there are no more children to worry about in the future), and
+     - either:
+         - we aren't fetching properties for this directory, or
+         - we've already finished fetching those properties.
+*/
+static svn_error_t *
+maybe_close_dir_chain(report_dir_t *dir)
+{
+  report_dir_t *cur_dir = dir;
+
+  while (cur_dir
+         && !cur_dir->ref_count
+         && cur_dir->tag_closed
+         && (!cur_dir->fetch_props || cur_dir->propfind_handler->done))
+    {
+      report_dir_t *parent = cur_dir->parent_dir;
+      report_context_t *report_context = cur_dir->report_context;
+
+      SVN_ERR(close_dir(cur_dir));
+      if (parent)
+        {
+          parent->ref_count--;
+        }
+      else
+        {
+          report_context->closed_root = TRUE;
+        }
+      cur_dir = parent;
+    }
+
+  return SVN_NO_ERROR;
+}
+
 /* Open the file associated with INFO for editing, pass along any
    propchanges we've recorded for it, and then close the file. */
 static svn_error_t *
@@ -1189,6 +1234,7 @@ handle_propchange_only(report_info_t *in
   svn_pool_destroy(info->pool);
 
   info->dir->ref_count--;
+  SVN_ERR(maybe_close_dir_chain(info->dir));
 
   return SVN_NO_ERROR;
 }
@@ -1213,6 +1259,7 @@ handle_local_content(report_info_t *info
   svn_pool_destroy(info->pool);
 
   info->dir->ref_count--;
+  SVN_ERR(maybe_close_dir_chain(info->dir));
 
   return SVN_NO_ERROR;
 }
@@ -1937,8 +1984,7 @@ end_report(svn_ra_serf__xml_parser_t *pa
        */
       if (info->dir->fetch_props)
         {
-          /* Unconditionally set fetch_props now. */
-          info->dir->fetch_props = TRUE;
+          svn_ra_serf__list_t *list_item;
 
           SVN_ERR(svn_ra_serf__deliver_props(&info->dir->propfind_handler,
                                              info->dir->props, ctx->sess,
@@ -1946,7 +1992,7 @@ end_report(svn_ra_serf__xml_parser_t *pa
                                              info->dir->url,
                                              ctx->target_rev, "0",
                                              all_props,
-                                             &ctx->done_propfinds,
+                                             &ctx->done_dir_propfinds,
                                              info->dir->pool));
           SVN_ERR_ASSERT(info->dir->propfind_handler);
 
@@ -1955,6 +2001,11 @@ end_report(svn_ra_serf__xml_parser_t *pa
 
           ctx->active_propfinds++;
 
+          list_item = apr_pcalloc(info->dir->pool, sizeof(*list_item));
+          list_item->data = info->dir;
+          list_item->next = ctx->active_dir_propfinds;
+          ctx->active_dir_propfinds = list_item;
+
           if (ctx->active_fetches + ctx->active_propfinds
               > REQUEST_COUNT_TO_PAUSE)
             ctx->parser_ctx->paused = TRUE;
@@ -2388,7 +2439,6 @@ finish_report(void *report_baton,
   svn_ra_serf__handler_t *handler;
   svn_ra_serf__xml_parser_t *parser_ctx;
   const char *report_target;
-  svn_boolean_t closed_root;
   svn_stringbuf_t *buf = NULL;
   apr_pool_t *iterpool = svn_pool_create(pool);
   svn_error_t *err;
@@ -2451,7 +2501,6 @@ finish_report(void *report_baton,
   SVN_ERR(open_connection_if_needed(sess, 0));
 
   sess->cur_conn = 1;
-  closed_root = FALSE;
 
   /* Note that we may have no active GET or PROPFIND requests, yet the
      processing has not been completed. This could be from a delay on the
@@ -2528,6 +2577,59 @@ finish_report(void *report_baton,
          if (++sess->cur_conn == sess->num_conns)
              sess->cur_conn = 1;
 
+      /* Prune directory propfinds that are finished. */
+      done_list = report->done_dir_propfinds;
+      while (done_list)
+        {
+          report->active_propfinds--;
+
+          if (report->active_dir_propfinds)
+            {
+              svn_ra_serf__list_t *cur, *prev;
+
+              prev = NULL;
+              cur = report->active_dir_propfinds;
+
+              while (cur)
+                {
+                  report_dir_t *item = cur->data;
+
+                  if (item->propfind_handler == done_list->data)
+                    {
+                      break;
+                    }
+
+                  prev = cur;
+                  cur = cur->next;
+                }
+
+              /* If we found a match, set the new props and remove this
+               * propchange from our list.
+               */
+              if (cur)
+                {
+                  report_dir_t *cur_dir = cur->data;
+
+                  if (!prev)
+                    {
+                      report->active_dir_propfinds = cur->next;
+                    }
+                  else
+                    {
+                      prev->next = cur->next;
+                    }
+
+                  /* See if this directory (and perhaps even parents of that)
+                     can be closed now. */
+                  SVN_ERR(open_dir(cur_dir));
+                  SVN_ERR(maybe_close_dir_chain(cur_dir));
+                }
+            }
+
+          done_list = done_list->next;
+        }
+      report->done_dir_propfinds = NULL;
+
       /* prune our propfind list if they are done. */
       done_list = report->done_propfinds;
       while (done_list)
@@ -2594,14 +2696,15 @@ finish_report(void *report_baton,
         }
       report->done_propfinds = NULL;
 
-      /* prune our fetches list if they are done. */
+      /* Prune completely fetches from our list. */
       done_list = report->done_fetches;
       while (done_list)
         {
           report_fetch_t *done_fetch = done_list->data;
           report_dir_t *cur_dir;
 
-          /* decrease our parent's directory refcount. */
+          /* Decrease the refcount in the parent directory of the file
+             whose fetch has completed. */
           cur_dir = done_fetch->info->dir;
           cur_dir->ref_count--;
 
@@ -2610,31 +2713,9 @@ finish_report(void *report_baton,
 
           done_list = done_list->next;
 
-          /* If we have a valid directory and
-           * we have no open items in this dir and
-           * we've closed the directory tag (no more children can be added)
-           * and either:
-           *   we know we won't be fetching props or
-           *   we've already completed the propfind
-           * then, we know it's time for us to close this directory.
-           */
-          while (cur_dir && !cur_dir->ref_count && cur_dir->tag_closed
-                 && (!cur_dir->fetch_props
-                     || cur_dir->propfind_handler->done))
-            {
-              report_dir_t *parent = cur_dir->parent_dir;
-
-              SVN_ERR(close_dir(cur_dir));
-              if (parent)
-                {
-                  parent->ref_count--;
-                }
-              else
-                {
-                  closed_root = TRUE;
-                }
-              cur_dir = parent;
-            }
+          /* See if the parent directory of this fetched item (and
+             perhaps even parents of that) can be closed now. */
+          SVN_ERR(maybe_close_dir_chain(cur_dir));
         }
       report->done_fetches = NULL;
 
@@ -2654,13 +2735,13 @@ finish_report(void *report_baton,
       /* Debugging purposes only! */
       for (i = 0; i < sess->num_conns; i++)
         {
-         serf_debug__closed_conn(sess->conns[i]->bkt_alloc);
+          serf_debug__closed_conn(sess->conns[i]->bkt_alloc);
         }
     }
 
   /* Ensure that we opened and closed our root dir and that we closed
    * all of our children. */
-  if (closed_root == FALSE && report->root_dir != NULL)
+  if (report->closed_root == FALSE && report->root_dir != NULL)
     {
       SVN_ERR(close_all_dirs(report->root_dir));
     }

Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/copy.c?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/copy.c Thu Dec 27 03:00:07 2012
@@ -618,14 +618,26 @@ copy_or_move(svn_wc_context_t *wc_ctx,
           break;
       }
 
-    SVN_ERR(svn_wc__db_read_info(&dstdir_status, NULL, NULL, NULL,
-                                 &dst_repos_root_url, &dst_repos_uuid, NULL,
-                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                                 NULL, NULL, NULL, NULL, NULL, NULL,
-                                 NULL, NULL, NULL, NULL,
-                                 NULL, NULL, NULL,
-                                 db, dstdir_abspath,
-                                 scratch_pool, scratch_pool));
+    err = svn_wc__db_read_info(&dstdir_status, NULL, NULL, NULL,
+                               &dst_repos_root_url, &dst_repos_uuid, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL,
+                               db, dstdir_abspath,
+                               scratch_pool, scratch_pool);
+
+    if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+      {
+        /* An unversioned destination directory exists on disk. */
+        svn_error_clear(err);
+        return svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, NULL,
+                                 _("'%s' is not under version control"),
+                                 svn_dirent_local_style(dstdir_abspath,
+                                                        scratch_pool));
+      }
+    else
+      SVN_ERR(err);
 
     /* Do this now, as we know the right data is cached */
     SVN_ERR(svn_wc__db_get_wcroot(&dst_wcroot_abspath, db, dstdir_abspath,

Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/update_editor.c?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/update_editor.c Thu Dec 27 03:00:07 2012
@@ -765,6 +765,10 @@ struct file_baton
      initialized, this is never NULL, but it may have zero elements.  */
   apr_array_header_t *propchanges;
 
+  /* For existing files, whether there are local modifications. FALSE for added
+     files */
+  svn_boolean_t local_prop_mods;
+
   /* Bump information for the directory this file lives in */
   struct bump_dir_info *bump_info;
 
@@ -3283,7 +3287,7 @@ open_file(const char *path,
                                &fb->changed_author, NULL,
                                &fb->original_checksum, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL, NULL,
-                               &conflicted, NULL, NULL, NULL,
+                               &conflicted, NULL, NULL, &fb->local_prop_mods,
                                NULL, NULL, &have_work,
                                eb->db, fb->local_abspath,
                                fb->pool, scratch_pool));
@@ -3512,6 +3516,85 @@ change_file_prop(void *file_baton,
   if (!fb->edited && svn_property_kind2(name) == svn_prop_regular_kind)
     SVN_ERR(mark_file_edited(fb, scratch_pool));
 
+  if (! fb->shadowed
+      && strcmp(name, SVN_PROP_SPECIAL) == 0)
+    {
+      struct edit_baton *eb = fb->edit_baton;
+      svn_boolean_t modified = FALSE;
+      svn_boolean_t becomes_symlink;
+      svn_boolean_t was_symlink;
+
+      /* Let's see if we have a change as in some scenarios servers report
+         non-changes of properties. */
+      becomes_symlink = (value != NULL);
+
+      if (fb->adding_file)
+        was_symlink = becomes_symlink; /* No change */
+      else
+        {
+          apr_hash_t *props;
+
+          /* We read the server-props, not the ACTUAL props here as we just
+             want to see if this is really an incoming prop change. */
+          SVN_ERR(svn_wc__db_base_get_props(&props, eb->db,
+                                            fb->local_abspath,
+                                            scratch_pool, scratch_pool));
+
+          was_symlink = ((props
+                              && apr_hash_get(props, SVN_PROP_SPECIAL,
+                                              APR_HASH_KEY_STRING) != NULL)
+                              ? svn_tristate_true
+                              : svn_tristate_false);
+        }
+
+      if (was_symlink != becomes_symlink)
+        {
+          /* If the local node was not modified, we continue as usual, if
+             modified we want a tree conflict just like how we would handle
+             it when receiving a delete + add (aka "replace") */
+          if (fb->local_prop_mods)
+            modified = TRUE;
+          else
+            SVN_ERR(svn_wc__internal_file_modified_p(&modified, eb->db,
+                                                     fb->local_abspath,
+                                                     FALSE, scratch_pool));
+        }
+
+      if (modified)
+        {
+          if (!fb->edit_conflict)
+            fb->edit_conflict = svn_wc__conflict_skel_create(fb->pool);
+
+          SVN_ERR(svn_wc__conflict_skel_add_tree_conflict(
+                                     fb->edit_conflict,
+                                     eb->db, fb->local_abspath,
+                                     svn_wc_conflict_reason_edited,
+                                     svn_wc_conflict_action_replace,
+                                     fb->pool, scratch_pool));
+
+          SVN_ERR(complete_conflict(fb->edit_conflict, fb->dir_baton,
+                                    fb->local_abspath, fb->old_repos_relpath,
+                                    fb->old_revision, svn_node_file,
+                                    fb->pool, scratch_pool));
+
+          /* Create a copy of the existing (pre update) BASE node in WORKING,
+             mark a tree conflict and handle the rest of the update as
+             shadowed */
+          SVN_ERR(svn_wc__db_op_make_copy(eb->db, fb->local_abspath,
+                                          fb->edit_conflict, NULL,
+                                          scratch_pool));
+
+          do_notification(eb, fb->local_abspath, svn_node_file,
+                          svn_wc_notify_tree_conflict, scratch_pool);
+
+          /* Ok, we introduced a replacement, so we can now handle the rest
+             as a normal shadowed update */
+          fb->shadowed = TRUE;
+          fb->add_existed = FALSE;
+          fb->already_notified = TRUE;
+      }
+    }
+
   return SVN_NO_ERROR;
 }
 
@@ -4016,64 +4099,6 @@ close_file(void *file_baton,
   if (current_actual_props == NULL)
     current_actual_props = apr_hash_make(scratch_pool);
 
-  /* Catch symlink-ness change.
-   * add_file() doesn't know whether the incoming added node is a file or
-   * a symlink, because symlink-ness is saved in a prop :(
-   * So add_file() cannot notice when update wants to add a symlink where
-   * locally there already is a file scheduled for addition, or vice versa.
-   * It sees incoming symlinks as simple files and may wrongly try to offer
-   * a text conflict. So flag a tree conflict here. */
-  if (!fb->shadowed
-      && (! fb->adding_file || fb->add_existed))
-    {
-      svn_boolean_t local_is_link;
-      svn_boolean_t incoming_is_link;
-      int i;
-
-      local_is_link = apr_hash_get(local_actual_props,
-                                SVN_PROP_SPECIAL,
-                                APR_HASH_KEY_STRING) != NULL;
-
-      incoming_is_link = local_is_link;
-
-      /* Does an incoming propchange affect symlink-ness? */
-      for (i = 0; i < regular_prop_changes->nelts; ++i)
-        {
-          const svn_prop_t *prop = &APR_ARRAY_IDX(regular_prop_changes, i,
-                                                  svn_prop_t);
-
-          if (strcmp(prop->name, SVN_PROP_SPECIAL) == 0)
-            {
-              incoming_is_link = (prop->value != NULL);
-              break;
-            }
-        }
-
-      if (local_is_link != incoming_is_link)
-        {
-          fb->shadowed = TRUE;
-          fb->obstruction_found = TRUE;
-          fb->add_existed = FALSE;
-
-          if (!conflict_skel)
-            conflict_skel = svn_wc__conflict_skel_create(fb->pool);
-
-          SVN_ERR(svn_wc__conflict_skel_add_tree_conflict(
-                                       conflict_skel,
-                                       eb->db, fb->local_abspath,
-                                       svn_wc_conflict_reason_added,
-                                       svn_wc_conflict_action_add,
-                                       scratch_pool, scratch_pool));
-
-          fb->already_notified = TRUE;
-          do_notification(eb, fb->local_abspath, svn_node_unknown,
-                          svn_wc_notify_tree_conflict, scratch_pool);
-
-          /* The update will be applied to PRISTINE, but not to
-             the in-working copy node */
-        }
-    }
-
   prop_state = svn_wc_notify_state_unknown;
 
   if (! fb->shadowed)

Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db.c?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db.c Thu Dec 27 03:00:07 2012
@@ -2074,16 +2074,15 @@ db_base_remove(void *baton,
                                             wcroot, local_relpath,
                                             scratch_pool, scratch_pool));
 
-  /* ### This function should be turned into a helper of this function,
-         as this is the only valid caller */
   if (status == svn_wc__db_status_normal
       && rb->keep_as_working)
     {
-      SVN_ERR(svn_wc__db_temp_op_make_copy(rb->db,
-                                           svn_dirent_join(wcroot->abspath,
-                                                           local_relpath,
-                                                           scratch_pool),
-                                           scratch_pool));
+      SVN_ERR(svn_wc__db_op_make_copy(rb->db,
+                                      svn_dirent_join(wcroot->abspath,
+                                                      local_relpath,
+                                                      scratch_pool),
+                                      NULL, NULL,
+                                      scratch_pool));
       keep_working = TRUE;
     }
   else
@@ -2668,27 +2667,24 @@ svn_wc__db_base_clear_dav_cache_recursiv
 }
 
 
-
-/* Like svn_wc__db_base_get_info(), but taking WCROOT+LOCAL_RELPATH instead of
-   DB+LOCAL_ABSPATH and outputting REPOS_ID instead of URL+UUID. */
-static svn_error_t *
-depth_get_info(svn_wc__db_status_t *status,
-                svn_kind_t *kind,
-                svn_revnum_t *revision,
-                const char **repos_relpath,
-                apr_int64_t *repos_id,
-                svn_revnum_t *changed_rev,
-                apr_time_t *changed_date,
-                const char **changed_author,
-                svn_depth_t *depth,
-                const svn_checksum_t **checksum,
-                const char **target,
-                svn_boolean_t *had_props,
-                svn_wc__db_wcroot_t *wcroot,
-                const char *local_relpath,
-                int op_depth,
-                apr_pool_t *result_pool,
-                apr_pool_t *scratch_pool)
+svn_error_t *
+svn_wc__db_depth_get_info(svn_wc__db_status_t *status,
+                          svn_kind_t *kind,
+                          svn_revnum_t *revision,
+                          const char **repos_relpath,
+                          apr_int64_t *repos_id,
+                          svn_revnum_t *changed_rev,
+                          apr_time_t *changed_date,
+                          const char **changed_author,
+                          svn_depth_t *depth,
+                          const svn_checksum_t **checksum,
+                          const char **target,
+                          svn_boolean_t *had_props,
+                          svn_wc__db_wcroot_t *wcroot,
+                          const char *local_relpath,
+                          int op_depth,
+                          apr_pool_t *result_pool,
+                          apr_pool_t *scratch_pool)
 {
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
@@ -4176,11 +4172,11 @@ db_op_copy_shadowed_layer(svn_wc__db_wcr
 
   {
     svn_error_t *err;
-    err = depth_get_info(&status, &kind, &node_revision, &node_repos_relpath,
-                         &node_repos_id, NULL, NULL, NULL, NULL, NULL,
-                         NULL, NULL,
-                         src_wcroot, src_relpath, src_op_depth,
-                         scratch_pool, scratch_pool);
+    err = svn_wc__db_depth_get_info(&status, &kind, &node_revision,
+                                    &node_repos_relpath, &node_repos_id,
+                                    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                    src_wcroot, src_relpath, src_op_depth,
+                                    scratch_pool, scratch_pool);
 
     if (err)
       {
@@ -4393,10 +4389,11 @@ op_copy_shadowed_layer_txn(void * baton,
   del_op_depth = relpath_depth(ocb->dst_relpath);
 
   /* Get some information from the parent */
-  SVN_ERR(depth_get_info(NULL, NULL, &revision, &repos_relpath, &repos_id,
-                         NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                         ocb->src_wcroot, src_parent_relpath, src_op_depth,
-                         scratch_pool, scratch_pool));
+  SVN_ERR(svn_wc__db_depth_get_info(NULL, NULL, &revision, &repos_relpath,
+                                    &repos_id, NULL, NULL, NULL, NULL, NULL,
+                                    NULL, NULL, ocb->src_wcroot,
+                                    src_parent_relpath, src_op_depth,
+                                    scratch_pool, scratch_pool));
 
   if (repos_relpath == NULL)
     {
@@ -13087,6 +13084,8 @@ svn_wc__db_temp_op_start_directory_updat
 struct make_copy_baton_t
 {
   int op_depth;
+  const svn_skel_t *conflicts;
+  const svn_skel_t *work_items;
 };
 
 
@@ -13135,6 +13134,7 @@ make_copy_txn(void *baton,
   svn_boolean_t add_working_base_deleted = FALSE;
   svn_boolean_t remove_working = FALSE;
   const apr_array_header_t *children;
+  struct make_copy_baton_t cbt;
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   int i;
 
@@ -13199,18 +13199,20 @@ make_copy_txn(void *baton,
   SVN_ERR(gather_repo_children(&children, wcroot, local_relpath,
                                0, scratch_pool, iterpool));
 
+  cbt.op_depth = mcb->op_depth;
+  cbt.conflicts = NULL;
+  cbt.work_items = NULL;
+
   for (i = 0; i < children->nelts; i++)
     {
       const char *name = APR_ARRAY_IDX(children, i, const char *);
-      struct make_copy_baton_t cbt;
+      
       const char *copy_relpath;
 
       svn_pool_clear(iterpool);
 
       copy_relpath = svn_relpath_join(local_relpath, name, iterpool);
 
-      cbt.op_depth = mcb->op_depth;
-
       SVN_ERR(make_copy_txn(&cbt, wcroot, copy_relpath, iterpool));
     }
 
@@ -13218,6 +13220,11 @@ make_copy_txn(void *baton,
                                                 iterpool),
                                                 svn_depth_empty, iterpool));
 
+  if (mcb->conflicts)
+    SVN_ERR(mark_conflict(wcroot, local_relpath, mcb->conflicts, iterpool));
+
+  SVN_ERR(add_work_items(wcroot->sdb, mcb->work_items, iterpool));
+
   svn_pool_destroy(iterpool);
 
   return SVN_NO_ERROR;
@@ -13225,9 +13232,11 @@ make_copy_txn(void *baton,
 
 
 svn_error_t *
-svn_wc__db_temp_op_make_copy(svn_wc__db_t *db,
-                             const char *local_abspath,
-                             apr_pool_t *scratch_pool)
+svn_wc__db_op_make_copy(svn_wc__db_t *db,
+                        const char *local_abspath,
+                        const svn_skel_t *conflicts,
+                        const svn_skel_t *work_items,
+                        apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
@@ -13260,6 +13269,8 @@ svn_wc__db_temp_op_make_copy(svn_wc__db_
   SVN_ERR(catch_copy_of_server_excluded(wcroot, local_relpath, scratch_pool));
 
   mcb.op_depth = relpath_depth(local_relpath);
+  mcb.conflicts = conflicts;
+  mcb.work_items = work_items;
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, make_copy_txn, &mcb,
                               scratch_pool));

Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db.h?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db.h Thu Dec 27 03:00:07 2012
@@ -3027,9 +3027,11 @@ svn_wc__db_temp_op_end_directory_update(
    leaving any subtree additions and copies as-is.  This allows the
    base node tree to be removed. */
 svn_error_t *
-svn_wc__db_temp_op_make_copy(svn_wc__db_t *db,
-                             const char *local_abspath,
-                             apr_pool_t *scratch_pool);
+svn_wc__db_op_make_copy(svn_wc__db_t *db,
+                        const char *local_abspath,
+                        const svn_skel_t *conflicts,
+                        const svn_skel_t *work_items,
+                        apr_pool_t *scratch_pool);
 
 /* Close the wc root LOCAL_ABSPATH and remove any per-directory
    handles associated with it. */

Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_private.h?rev=1426107&r1=1426106&r2=1426107&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_private.h Thu Dec 27 03:00:07 2012
@@ -260,6 +260,27 @@ svn_wc__db_base_get_info_internal(svn_wc
                                   apr_pool_t *result_pool,
                                   apr_pool_t *scratch_pool);
 
+/* Similar to svn_wc__db_base_get_info(), but taking WCROOT+LOCAL_RELPATH 
+ * instead of DB+LOCAL_ABSPATH, an explicit op-depth of the node to get
+ * information about, and outputting REPOS_ID instead of URL+UUID. */
+svn_error_t *
+svn_wc__db_depth_get_info(svn_wc__db_status_t *status,
+                          svn_kind_t *kind,
+                          svn_revnum_t *revision,
+                          const char **repos_relpath,
+                          apr_int64_t *repos_id,
+                          svn_revnum_t *changed_rev,
+                          apr_time_t *changed_date,
+                          const char **changed_author,
+                          svn_depth_t *depth,
+                          const svn_checksum_t **checksum,
+                          const char **target,
+                          svn_boolean_t *had_props,
+                          svn_wc__db_wcroot_t *wcroot,
+                          const char *local_relpath,
+                          int op_depth,
+                          apr_pool_t *result_pool,
+                          apr_pool_t *scratch_pool);
 
 /* Like svn_wc__db_read_conflict(), but with WCROOT+LOCAL_RELPATH instead of
    DB+LOCAL_ABSPATH, and outputting relpaths instead of abspaths. */