Author: svn-role
Date: Wed May 29 04:00:11 2013
New Revision: 1487225
URL: http://svn.apache.org/r1487225
Log:
Merge the r1480344 group from trunk:
* r1480344, r1480412, r1480442, r1480738, r1480765, r1482479, r1482524,
r1482528, r1482536, r1486931
Fix Ruby binding tests on Windows and support Ruby 1.9[1].
Justification:
Running the test suite is important for, you know, testing.
Notes:
Bindings changes, so can go into 1.8.0. [1] Ruby 1.9 doesn't quite
yet work on Windows, but this gets us part way there, so there is no
compelling reason not to include with this bunch.
Votes:
+1: pburba
+0: danielsh
Modified:
subversion/branches/1.8.x/ (props changed)
subversion/branches/1.8.x/STATUS
subversion/branches/1.8.x/build/generator/gen_win.py
subversion/branches/1.8.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
subversion/branches/1.8.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h
subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/greek_tree.rb
subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/test_client.rb
subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/util.rb
subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/windows_util.rb
Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
Merged
/subversion/trunk:r1480344,1480412,1480442,1480738,1480765,1482479,1482524,1482528,1482536,1486931
Modified: subversion/branches/1.8.x/STATUS
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1487225&r1=1487224&r2=1487225&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Wed May 29 04:00:11 2013
@@ -102,19 +102,6 @@ Approved changes:
# blocking issues. If in doubt see this link for details:
#
http://subversion.apache.org/docs/community-guide/releasing.html#release-stabilization
- * r1480344, r1480412, r1480442, r1480738, r1480765, r1482479, r1482524,
- r1482528, r1482536, r1486931
- Fix Ruby binding tests on Windows and support Ruby 1.9[1].
- Justification:
- Running the test suite is important for, you know, testing.
- Notes:
- Bindings changes, so can go into 1.8.0. [1] Ruby 1.9 doesn't quite
- yet work on Windows, but this gets us part way there, so there is no
- compelling reason not to include with this bunch.
- Votes:
- +1: pburba
- +0: danielsh
-
* r1486915
Provide APR_BUFFERED flag when opening file in svn patch.
Justification:
Modified: subversion/branches/1.8.x/build/generator/gen_win.py
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/build/generator/gen_win.py?rev=1487225&r1=1487224&r2=1487225&view=diff
==============================================================================
--- subversion/branches/1.8.x/build/generator/gen_win.py (original)
+++ subversion/branches/1.8.x/build/generator/gen_win.py Wed May 29 04:00:11
2013
@@ -1254,7 +1254,9 @@ class WinGeneratorBase(GeneratorBase):
self.ruby_version = None
self.ruby_major_version = None
self.ruby_minor_version = None
- proc = os.popen('ruby -rrbconfig -e ' + escape_shell_arg(
+ # Pass -W0 to stifle the "-e:1: Use RbConfig instead of obsolete
+ # and deprecated Config." warning if we are using Ruby 1.9.
+ proc = os.popen('ruby -rrbconfig -W0 -e ' + escape_shell_arg(
"puts Config::CONFIG['ruby_version'];"
"puts Config::CONFIG['LIBRUBY'];"
"puts Config::CONFIG['archdir'];"
Modified:
subversion/branches/1.8.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c?rev=1487225&r1=1487224&r2=1487225&view=diff
==============================================================================
---
subversion/branches/1.8.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
(original)
+++
subversion/branches/1.8.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
Wed May 29 04:00:11 2013
@@ -735,7 +735,9 @@ svn_swig_rb_get_pool(int argc, VALUE *ar
static svn_boolean_t
rb_set_pool_if_swig_type_object(VALUE target, VALUE pool)
{
- VALUE targets[1] = {target};
+ VALUE targets[1];
+
+ targets[0] = target;
if (!NIL_P(find_swig_type_object(1, targets))) {
rb_set_pool(target, pool);
@@ -1530,15 +1532,14 @@ r2c_hash(VALUE hash, r2c_func func, void
return NULL;
} else {
apr_hash_t *apr_hash;
- hash_to_apr_hash_data_t data = {
- NULL,
- func,
- ctx,
- pool
- };
+ hash_to_apr_hash_data_t data;
apr_hash = apr_hash_make(pool);
data.apr_hash = apr_hash;
+ data.ctx = ctx;
+ data.func = func;
+ data.pool = pool;
+
rb_hash_foreach(hash, r2c_hash_i, (VALUE)&data);
return apr_hash;
@@ -1637,8 +1638,9 @@ invoke_callback(VALUE baton, VALUE pool)
{
callback_baton_t *cbb = (callback_baton_t *)baton;
VALUE sub_pool;
- VALUE argv[] = {pool};
+ VALUE argv[1];
+ argv[0] = pool;
svn_swig_rb_get_pool(1, argv, Qnil, &sub_pool, NULL);
cbb->pool = sub_pool;
return rb_ensure(callback, baton, callback_ensure, sub_pool);
Modified:
subversion/branches/1.8.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h?rev=1487225&r1=1487224&r2=1487225&view=diff
==============================================================================
---
subversion/branches/1.8.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h
(original)
+++
subversion/branches/1.8.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h
Wed May 29 04:00:11 2013
@@ -74,7 +74,12 @@
extern "C" {
#endif /* __cplusplus */
+/* Ruby 1.9 changed the file name of this header */
+#ifdef HAVE_RUBY_IO_H
+#include <ruby/io.h>
+#else
#include <rubyio.h>
+#endif
typedef struct apr_pool_wrapper_t
{
Modified:
subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/greek_tree.rb
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/greek_tree.rb?rev=1487225&r1=1487224&r2=1487225&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/greek_tree.rb
(original)
+++ subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/greek_tree.rb
Wed May 29 04:00:11 2013
@@ -47,15 +47,16 @@ module SvnTestUtil
const_set(path.split("/").last.upcase, path)
end
- def initialize(tmp_path, wc_path, repos_uri)
+ def initialize(tmp_path, import_path, wc_path, repos_uri)
@tmp_path = tmp_path
+ @import_path = import_path
@wc_path = wc_path
@repos_uri = repos_uri
end
def setup(context)
TREE.each do |path, contents|
- entry = File.expand_path(File.join(@tmp_path, path))
+ entry = File.expand_path(File.join(@import_path, path))
if contents
File.open(entry, 'w') {|f| f.print(contents)}
else
@@ -63,7 +64,7 @@ module SvnTestUtil
end
end
- context.import(@tmp_path, @repos_uri)
+ context.import(@import_path, @repos_uri)
context.update(@wc_path)
end
Modified:
subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/test_client.rb
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/test_client.rb?rev=1487225&r1=1487224&r2=1487225&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/test_client.rb
(original)
+++ subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/test_client.rb
Wed May 29 04:00:11 2013
@@ -334,7 +334,7 @@ class SvnClientTest < Test::Unit::TestCa
file = "sample.txt"
deep_dir_path = File.join(@wc_path, deep_dir)
path = File.join(deep_dir_path, file)
- tmp_deep_dir_path = File.join(@tmp_path, deep_dir)
+ tmp_deep_dir_path = File.join(@import_path, deep_dir)
tmp_path = File.join(tmp_deep_dir_path, file)
make_context(log) do |ctx|
@@ -342,7 +342,7 @@ class SvnClientTest < Test::Unit::TestCa
FileUtils.mkdir_p(tmp_deep_dir_path)
File.open(tmp_path, "w") {|f| f.print(src)}
- ctx.import(@tmp_path, @repos_uri)
+ ctx.import(@import_path, @repos_uri)
ctx.up(@wc_path)
assert_equal(src, File.open(path){|f| f.read})
@@ -356,7 +356,7 @@ class SvnClientTest < Test::Unit::TestCa
file = "sample.txt"
deep_dir_path = File.join(@wc_path, deep_dir)
path = File.join(deep_dir_path, file)
- tmp_deep_dir_path = File.join(@tmp_path, deep_dir)
+ tmp_deep_dir_path = File.join(@import_path, deep_dir)
tmp_path = File.join(tmp_deep_dir_path, file)
make_context(log) do |ctx|
@@ -364,7 +364,7 @@ class SvnClientTest < Test::Unit::TestCa
FileUtils.mkdir_p(tmp_deep_dir_path)
File.open(tmp_path, "w") {|f| f.print(src)}
- new_rev = ctx.import(@tmp_path, @repos_uri, true, false,
+ new_rev = ctx.import(@import_path, @repos_uri, true, false,
{"custom-prop" => "some-value"}).revision
assert_equal(["some-value", new_rev],
ctx.revprop_get("custom-prop", @repos_uri, new_rev))
Modified: subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/util.rb
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/util.rb?rev=1487225&r1=1487224&r2=1487225&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/util.rb
(original)
+++ subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/util.rb Wed
May 29 04:00:11 2013
@@ -1,4 +1,4 @@
-# ====================================================================
+# ====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
@@ -19,7 +19,7 @@
require "fileutils"
require "pathname"
-require "svn/util"
+require "./svn/util"
require "tmpdir"
require "my-assertions"
@@ -43,19 +43,20 @@ module SvnTestUtil
@tmp_path = Dir.mktmpdir
@wc_path = File.join(@tmp_path, "wc")
- @full_wc_path = File.expand_path(@wc_path)
+ @import_path = File.join(@tmp_path, "import")
@repos_path = File.join(@tmp_path, "repos")
@full_repos_path = File.expand_path(@repos_path)
@repos_uri = "file://#{@full_repos_path.sub(/^\/?/, '/')}"
@config_path = "config"
- @greek = Greek.new(@tmp_path, @wc_path, @repos_uri)
+ @greek = Greek.new(@tmp_path, @import_path, @wc_path, @repos_uri)
end
def setup_basic(need_svnserve=false)
@need_svnserve = need_svnserve
setup_default_variables
setup_tmp
+ setup_tmp(@import_path)
setup_repository
add_hooks
setup_svnserve if @need_svnserve
Modified:
subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/windows_util.rb
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/windows_util.rb?rev=1487225&r1=1487224&r2=1487225&view=diff
==============================================================================
---
subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/windows_util.rb
(original)
+++
subversion/branches/1.8.x/subversion/bindings/swig/ruby/test/windows_util.rb
Wed May 29 04:00:11 2013
@@ -93,27 +93,62 @@ module SvnTestUtil
%r'^\s*#define\s+APR_MAJOR_VERSION\s+(\d+)' =~
apr_version_include.read
apr_major_version = $1 == '0' ? '' : "-#{$1}"
+ cwd = Dir.getwd
targets = %W(svnserve.exe libsvn_subr-1.dll libsvn_repos-1.dll
libsvn_fs-1.dll libsvn_delta-1.dll
libaprutil#{apr_major_version}.dll
libapr#{apr_major_version}.dll
libapriconv#{apr_major_version}.dll
- libdb44.dll libdb44d.dll)
+ libdb??.dll libdb??d.dll)
ENV["PATH"].split(";").each do |path|
+
+ # Change the cwd to path, but ignore non-existent paths.
+ begin
+ Dir.chdir(path)
+ rescue Errno::ENOENT
+ next
+ end
+
found_targets = []
targets.each do |target|
- target_path = "#{path}\\#{target}"
- if File.exists?(target_path)
- found_targets << target
- FileUtils.cp(target_path, svnserve_dir)
+ matching_paths = Dir.glob(target)
+ matching_paths.each do |target_path|
+ target_path = File.join(path.tr('\\', '/'), target_path)
+ if File.exists?(target_path)
+ found_targets << target
+ retried = 0
+ begin
+ FileUtils.cp(target_path, svnserve_dir)
+ rescue Errno::EACCES
+ # On Windows the tests frequently fail spuriously with a
+ # 'Errno::EACCES: Permission denied - svnserve.exe' error.
+ # Sleeping for a few seconds avoids this.
+ if retried > 5
+ # Give up!
+ raise
+ else
+ # Wait a sec...
+ sleep(1)
+ retried += 1
+ retry
+ end
+ end
+ end
end
end
targets -= found_targets
break if targets.empty?
end
+ Dir.chdir(cwd)
# Remove optional targets instead of raising below. If they are
really
# needed, svnserve won't start anyway.
targets -= %W[libapriconv#{apr_major_version}.dll]
+ # Ditto these four, since svnserve.exe might be a static build.
+ targets -= %W[libsvn_subr-1.dll]
+ targets -= %W[libsvn_repos-1.dll]
+ targets -= %W[libsvn_fs-1.dll]
+ targets -= %W[libsvn_delta-1.dll]
+
unless targets.empty?
raise "can't find libraries to work svnserve: #{targets.join(' ')}"
end
@@ -194,7 +229,8 @@ exit 1
@gen_make_opts ||= begin
lines = []
gen_make_opts = File.join(@@top_dir, "gen-make.opts")
- lines = File.read(gen_make_opts).to_a if File.exists?(gen_make_opts)
+ lines =
+ File.read(gen_make_opts).lines.to_a if File.exists?(gen_make_opts)
config = Hash.new do |hash, key|
if /^--with-(.*)$/ =~ key
hash[key] = File.join(@@top_dir, $1)