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 2013/10/15 10:52:18 UTC
svn commit: r1532250 [8/37] - in /subversion/branches/cache-server: ./
build/ build/ac-macros/ build/generator/ build/generator/swig/
build/generator/templates/ contrib/client-side/emacs/ contrib/hook-scripts/
contrib/server-side/fsfsfixer/ contrib/ser...
Modified: subversion/branches/cache-server/subversion/bindings/swig/perl/native/t/3client.t
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/bindings/swig/perl/native/t/3client.t?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/bindings/swig/perl/native/t/3client.t (original)
+++ subversion/branches/cache-server/subversion/bindings/swig/perl/native/t/3client.t Tue Oct 15 08:52:06 2013
@@ -20,7 +20,7 @@
#
#
-use Test::More tests => 262;
+use Test::More tests => 297;
use strict;
# shut up about variables that are only used once.
@@ -382,7 +382,7 @@ sub test_log_message_receiver {
isa_ok($pool,'_p_apr_pool_t',
'pool param is _p_apr_pool_t');
}
-
+
# TEST log range $current_rev:$current_rev
is($ctx->log("$reposurl/dir1/new",$current_rev,$current_rev,1,0,
\&test_log_message_receiver),
@@ -410,35 +410,56 @@ $ctx->log3([ $reposurl, @new_paths ],
});
sub get_full_log {
- my ($rev) = @_;
+ my ($start, $end) = @_;
my @log;
- $ctx->log($reposurl, $rev, 0, 0, 0, sub {
- my (undef, $revision, $author, $date, $msg, undef) = @_;
- push @log, [ $revision, $author, $date, $msg ];
+ $ctx->log($reposurl, $start, $end, 1, 0, sub {
+ my ($changed_paths, $revision, $author, $date, $msg, undef) = @_;
+ # "unpack" the values of the $changed_paths hash
+ # (_p_svn_log_changed_path_t objects) so that
+ # we can use is_deeply() to compare results
+ my %hash;
+ while (my ($path, $changed) = each %$changed_paths) {
+ foreach (qw( action copyfrom_path copyfrom_rev )) {
+ $hash{$path}{$_} = $changed->$_()
+ }
+ }
+ push @log, [ \%hash, $revision, $author, $date, $msg ];
});
return \@log;
}
# TEST
+my $full_log = get_full_log('HEAD',1);
+is(scalar @$full_log, $current_rev, "history up to 'HEAD'");
+
+# TEST
my $opt_revision_head = SVN::_Core::new_svn_opt_revision_t();
$opt_revision_head->kind($SVN::Core::opt_revision_head);
-is_deeply(get_full_log($opt_revision_head), # got
- get_full_log('HEAD')); # expected
+is_deeply(get_full_log($opt_revision_head,1), # got
+ $full_log, # expected
+ "history up to svn_opt_revision_t of kind head");
+
+# TEST
+is_deeply(get_full_log($current_rev,1), # got
+ $full_log, # expected
+ "history up to number $current_rev");
+
# TEST
my $opt_revision_number = SVN::_Core::new_svn_opt_revision_t();
$opt_revision_number->kind($SVN::Core::opt_revision_number);
$opt_revision_number->value->number($current_rev);
-is_deeply(get_full_log($opt_revision_number), # got
- get_full_log($current_rev)); # expected
+is_deeply(get_full_log($opt_revision_number,1), # got
+ $full_log, # expected
+ "history up to svn_opt_revision_t of kind number and value $current_rev");
sub test_log_entry_receiver {
my ($log_entry,$pool) = @_;
# TEST
isa_ok($log_entry, '_p_svn_log_entry_t',
- 'log_entry param is a _p_svn_log_entry_t');
+ 'log_entry param');
# TEST
isa_ok($pool,'_p_apr_pool_t',
- 'pool param is _p_apr_pool_t');
+ 'pool param');
# TEST
is($log_entry->revision,$current_rev,
'log_entry->revision matches current rev');
@@ -446,7 +467,7 @@ sub test_log_entry_receiver {
my $revprops = $log_entry->revprops;
# TEST
isa_ok($revprops,'HASH',
- 'log_entry->revprops is a HASH');
+ 'log_entry->revprops');
# TEST
is($revprops->{"svn:author"},$username,
'svn:author revprop matches expected username');
@@ -459,11 +480,11 @@ sub test_log_entry_receiver {
my $changed_paths = $log_entry->changed_paths2;
# TEST
isa_ok($changed_paths,'HASH',
- 'log_entry->changed_paths2 is a HASH');
+ 'log_entry->changed_paths2');
# TEST
isa_ok($changed_paths->{'/dir1/new'},
'_p_svn_log_changed_path2_t',
- 'Hash value is a _p_svn_log_changed_path2_t');
+ 'log_entry->changed_paths2 value');
# TEST
is($changed_paths->{'/dir1/new'}->action(),'A',
'action returns A for add');
@@ -495,6 +516,86 @@ is($ctx->log4("$reposurl/dir1/new",
'log4 returns undef');
# TEST
+is($ctx->log5("$reposurl/dir1/new",
+ 'HEAD',[$current_rev,0],1, # peg rev, rev ranges, limit
+ 1,1,0, # discover_changed_paths, strict_node_history, include_merged_revisions
+ undef, # revprops
+ \&test_log_entry_receiver),
+ undef,
+ 'log5 returns undef');
+
+# test the different forms to specify revision ranges
+sub get_revs {
+ my ($rev_ranges) = @_;
+ my @revs;
+ $ctx->log5($reposurl, 'HEAD', $rev_ranges, 0, 0, 0, 0, undef, sub {
+ my ($log_entry,$pool) = @_;
+ push @revs, $log_entry->revision;
+ });
+ return \@revs;
+}
+
+my $top = SVN::_Core::new_svn_opt_revision_range_t();
+$top->start('HEAD');
+$top->end('HEAD');
+my $bottom = SVN::_Core::new_svn_opt_revision_range_t();
+$bottom->start(1);
+$bottom->end($current_rev-1);
+
+# TEST
+is_deeply(get_revs($top),
+ [ $current_rev ], 'single svn_opt_revision_range_t');
+# TEST
+is_deeply(get_revs([$top]),
+ [ $current_rev ], 'list of svn_opt_revision_range_t');
+# TEST
+is_deeply(get_revs(['HEAD', 'HEAD']),
+ [ $current_rev ], 'single [start, end]');
+# TEST
+is_deeply(get_revs([['HEAD', 'HEAD']]),
+ [ $current_rev ], 'list of [start, end]');
+# TEST
+is_deeply(get_revs([$current_rev, $current_rev]),
+ [ $current_rev ], 'single [start, end]');
+# TEST
+is_deeply(get_revs([[$current_rev, $current_rev]]),
+ [ $current_rev ], 'list of [start, end]');
+# TEST
+is_deeply(get_revs([1, 'HEAD']),
+ [ 1..$current_rev ], 'single [start, end]');
+# TEST
+is_deeply(get_revs([[1, 'HEAD']]),
+ [ 1..$current_rev ], 'list of [start, end]');
+# TEST
+is_deeply(get_revs([1, $opt_revision_head]),
+ [ 1..$current_rev ], 'single [start, end]');
+# TEST
+is_deeply(get_revs([[1, $opt_revision_head]]),
+ [ 1..$current_rev ], 'list of [start, end]');
+# TEST
+is_deeply(get_revs($bottom),
+ [ 1..$current_rev-1 ], 'single svn_opt_revision_range_t');
+# TEST
+is_deeply(get_revs([$bottom]),
+ [ 1..$current_rev-1 ], 'list of svn_opt_revision_range_t');
+# TEST
+is_deeply(get_revs([1, $current_rev-1]),
+ [ 1..$current_rev-1 ], 'single [start, end]');
+# TEST
+is_deeply(get_revs([[1, $current_rev-1]]),
+ [ 1..$current_rev-1 ], 'list of [start, end]');
+# TEST
+is_deeply(get_revs([[1, $current_rev-1], $top]),
+ [ 1..$current_rev ], 'mixed list of ranges');
+# TEST
+is_deeply(get_revs([$bottom, ['HEAD', 'HEAD']]),
+ [ 1..$current_rev ], 'mixed list of ranges');
+# TEST
+is_deeply(get_revs([$bottom, $top]),
+ [ 1..$current_rev ], 'mixed list of ranges');
+
+
+# TEST
is($ctx->update($wcpath,'HEAD',1),$current_rev,
'Return from update is the current rev');
@@ -546,8 +647,7 @@ is($ctx->status($wcpath, undef, sub {
' the correct path.');
# TEST
isa_ok($wc_status,'_p_svn_wc_status_t',
- 'wc_stats param is a' .
- ' _p_svn_wc_status_t');
+ 'wc_stats param');
# TEST
is($wc_status->text_status(),
$SVN::Wc::Status::normal,
@@ -868,7 +968,7 @@ my($pl) = $ctx->proplist($reposurl,$curr
isa_ok($pl,'ARRAY','proplist returns an ARRAY');
# TEST
isa_ok($pl->[0], '_p_svn_client_proplist_item_t',
- 'array element is a _p_svn_client_proplist_item_t');
+ 'proplist array element');
# TEST
is($pl->[0]->node_name(),"$reposurl/dir1",
'node_name is the expected value');
@@ -959,8 +1059,7 @@ is($ctx->blame("$reposurl/foo",'HEAD','H
}
# TEST
isa_ok($pool,'_p_apr_pool_t',
- 'pool param is ' .
- '_p_apr_pool_t');
+ 'pool param');
}),
undef,
'blame returns undef');
@@ -987,7 +1086,7 @@ my ($dirents) = $ctx->ls($reposurl,"$cur
isa_ok($dirents, 'HASH','ls returns a HASH');
# TEST
isa_ok($dirents->{'dir1'},'_p_svn_dirent_t',
- 'hash value is a _p_svn_dirent_t');
+ 'dirents hash value');
# TEST
is($dirents->{'dir1'}->kind(),$SVN::Core::node_dir,
'kind() returns a dir node');
Modified: subversion/branches/cache-server/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c (original)
+++ subversion/branches/cache-server/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c Tue Oct 15 08:52:06 2013
@@ -35,6 +35,7 @@
#include <apr_portable.h>
#include <apr_thread_proc.h>
+#include "svn_private_config.h"
#include "svn_hash.h"
#include "svn_client.h"
#include "svn_string.h"
@@ -46,8 +47,6 @@
#include "svn_mergeinfo.h"
#include "svn_types.h"
-#include "svn_private_config.h" /* for SVN_APR_INT64_T_PYCFMT */
-
#include "swig_python_external_runtime.swg"
#include "swigutil_py.h"
@@ -93,7 +92,7 @@ void svn_swig_py_release_py_lock(void)
if (_saved_thread_key == NULL)
{
/* Obviously, creating a top-level pool for this is pretty stupid. */
- apr_pool_create(&_saved_thread_pool, NULL);
+ _saved_thread_pool = svn_pool_create(NULL);
apr_threadkey_private_create(&_saved_thread_key, NULL,
_saved_thread_pool);
}
@@ -152,7 +151,7 @@ int svn_swig_py_get_pool_arg(PyObject *a
PyObject *input = PyTuple_GET_ITEM(args, argnum);
if (input != Py_None && PyObject_HasAttrString(input, markValid))
{
- *pool = svn_swig_MustGetPtr(input, type, argnum+1);
+ *pool = svn_swig_py_must_get_ptr(input, type, argnum+1);
if (*pool == NULL)
return 1;
*py_pool = input;
@@ -163,7 +162,7 @@ int svn_swig_py_get_pool_arg(PyObject *a
/* We couldn't find a pool argument, so we'll create a subpool */
*pool = svn_pool_create(application_pool);
- *py_pool = svn_swig_NewPointerObj(*pool, type, application_py_pool,
+ *py_pool = svn_swig_py_new_pointer_obj(*pool, type, application_py_pool,
NULL);
if (*py_pool == NULL)
return 1;
@@ -190,7 +189,7 @@ int svn_swig_py_get_parent_pool(PyObject
Py_DECREF(*py_pool);
- *pool = svn_swig_MustGetPtr(*py_pool, type, 1);
+ *pool = svn_swig_py_must_get_ptr(*py_pool, type, 1);
if (*pool == NULL)
return 1;
@@ -245,8 +244,8 @@ static int proxy_set_pool(PyObject **pro
#define svn_swig_TypeQuery(x) SWIG_TypeQuery(x)
/** Wrapper for SWIG_NewPointerObj */
-PyObject *svn_swig_NewPointerObj(void *obj, swig_type_info *type,
- PyObject *pool, PyObject *args)
+PyObject *svn_swig_py_new_pointer_obj(void *obj, swig_type_info *type,
+ PyObject *pool, PyObject *args)
{
PyObject *proxy = SWIG_NewPointerObj(obj, type, 0);
@@ -270,7 +269,7 @@ PyObject *svn_swig_NewPointerObj(void *o
return proxy;
}
-/** svn_swig_NewPointerObj, except a string is used to describe the type */
+/** svn_swig_py_new_pointer_obj, except a string is used to describe the type */
static PyObject *svn_swig_NewPointerObjString(void *ptr, const char *type,
PyObject *py_pool)
{
@@ -282,11 +281,11 @@ static PyObject *svn_swig_NewPointerObjS
}
/* ### cache the swig_type_info at some point? */
- return svn_swig_NewPointerObj(ptr, typeinfo, py_pool, NULL);
+ return svn_swig_py_new_pointer_obj(ptr, typeinfo, py_pool, NULL);
}
/** Wrapper for SWIG_ConvertPtr */
-int svn_swig_ConvertPtr(PyObject *input, void **obj, swig_type_info *type)
+int svn_swig_py_convert_ptr(PyObject *input, void **obj, swig_type_info *type)
{
if (PyObject_HasAttrString(input, assertValid))
{
@@ -310,11 +309,11 @@ int svn_swig_ConvertPtr(PyObject *input,
static int svn_swig_ConvertPtrString(PyObject *input,
void **obj, const char *type)
{
- return svn_swig_ConvertPtr(input, obj, svn_swig_TypeQuery(type));
+ return svn_swig_py_convert_ptr(input, obj, svn_swig_TypeQuery(type));
}
/** Wrapper for SWIG_MustGetPtr */
-void *svn_swig_MustGetPtr(void *input, swig_type_info *type, int argnum)
+void *svn_swig_py_must_get_ptr(void *input, swig_type_info *type, int argnum)
{
if (PyObject_HasAttrString(input, assertValid))
{
@@ -443,7 +442,7 @@ static PyObject *make_ob_pool(void *pool
* normally used for anything. It's just here for compatibility
* with Subversion 1.2. */
apr_pool_t *new_pool = svn_pool_create(application_pool);
- PyObject *new_py_pool = svn_swig_NewPointerObj(new_pool,
+ PyObject *new_py_pool = svn_swig_py_new_pointer_obj(new_pool,
svn_swig_TypeQuery("apr_pool_t *"), application_py_pool, NULL);
(void) pool; /* Silence compiler warnings about unused parameter. */
return new_py_pool;
@@ -534,7 +533,7 @@ static PyObject *convert_hash(apr_hash_t
static PyObject *convert_to_swigtype(void *value, void *ctx, PyObject *py_pool)
{
/* ctx is a 'swig_type_info *' */
- return svn_swig_NewPointerObj(value, ctx, py_pool, NULL);
+ return svn_swig_py_new_pointer_obj(value, ctx, py_pool, NULL);
}
static PyObject *convert_svn_string_t(void *value, void *ctx,
@@ -853,7 +852,7 @@ PyObject *svn_swig_py_convert_hash(apr_h
static PyObject *make_ob_##type(void *value) \
{ \
apr_pool_t *new_pool = svn_pool_create(application_pool); \
- PyObject *new_py_pool = svn_swig_NewPointerObj(new_pool, \
+ PyObject *new_py_pool = svn_swig_py_new_pointer_obj(new_pool, \
svn_swig_TypeQuery("apr_pool_t *"), application_py_pool, NULL); \
svn_##type##_t *new_value = dup(value, new_pool); \
PyObject *obj = svn_swig_NewPointerObjString(new_value, "svn_" #type "_t *", \
@@ -1224,7 +1223,7 @@ apr_hash_t *svn_swig_py_struct_ptr_hash_
Py_DECREF(keys);
return NULL;
}
- status = svn_swig_ConvertPtr(value, &struct_ptr, type);
+ status = svn_swig_py_convert_ptr(value, &struct_ptr, type);
if (status != 0)
{
PyErr_SetString(PyExc_TypeError,
@@ -1284,7 +1283,7 @@ svn_swig_py_unwrap_struct_ptr(PyObject *
void **ptr_dest = destination;
swig_type_info *type_descriptor = baton;
- int status = svn_swig_ConvertPtr(source, ptr_dest, type_descriptor);
+ int status = svn_swig_py_convert_ptr(source, ptr_dest, type_descriptor);
if (status != 0)
{
@@ -2223,7 +2222,7 @@ svn_swig_py_convert_txdelta_op_c_array(i
for (i = 0; i < num_ops; ++i)
PyList_SET_ITEM(result, i,
- svn_swig_NewPointerObj(ops + i, op_type_info,
+ svn_swig_py_new_pointer_obj(ops + i, op_type_info,
parent_pool, NULL));
return result;
@@ -4068,7 +4067,7 @@ static svn_error_t *reporter_abort_repor
return err;
}
-const svn_ra_reporter2_t swig_py_ra_reporter2 = {
+static const svn_ra_reporter2_t swig_py_ra_reporter2 = {
reporter_set_path,
reporter_delete_path,
reporter_link_path,
@@ -4076,6 +4075,11 @@ const svn_ra_reporter2_t swig_py_ra_repo
reporter_abort_report
};
+const svn_ra_reporter2_t *svn_swig_py_get_ra_reporter2()
+{
+ return &swig_py_ra_reporter2;
+}
+
/* svn_wc_diff_callbacks2_t */
static svn_error_t *
wc_diff_callbacks2_file_changed_or_added(const char *callback,
Modified: subversion/branches/cache-server/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h (original)
+++ subversion/branches/cache-server/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h Tue Oct 15 08:52:06 2013
@@ -40,16 +40,6 @@
#include "svn_repos.h"
/* Define DLL export magic on Windows. */
-#ifdef WIN32
-# ifdef SVN_SWIG_SWIGUTIL_PY_C
-# define SVN_SWIG_SWIGUTIL_EXPORT __declspec(dllexport)
-# else
-# define SVN_SWIG_SWIGUTIL_EXPORT __declspec(dllimport)
-# endif
-#else
-# define SVN_SWIG_SWIGUTIL_EXPORT
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -57,27 +47,22 @@ extern "C" {
/* Initialize the libsvn_swig_py library. */
-SVN_SWIG_SWIGUTIL_EXPORT
apr_status_t svn_swig_py_initialize(void);
/* Functions to manage python's global interpreter lock */
-SVN_SWIG_SWIGUTIL_EXPORT
void svn_swig_py_release_py_lock(void);
-SVN_SWIG_SWIGUTIL_EXPORT
void svn_swig_py_acquire_py_lock(void);
/*** Automatic Pool Management Functions ***/
/* Set the application pool */
-SVN_SWIG_SWIGUTIL_EXPORT
void svn_swig_py_set_application_pool(PyObject *py_pool, apr_pool_t *pool);
/* Clear the application pool */
-SVN_SWIG_SWIGUTIL_EXPORT
void svn_swig_py_clear_application_pool(void);
/* Get the pool argument from the last element of tuple args.
@@ -85,7 +70,6 @@ void svn_swig_py_clear_application_pool(
* subpool. Return 0 if successful. Return 1 if an error
* occurs.
*/
-SVN_SWIG_SWIGUTIL_EXPORT
int svn_swig_py_get_pool_arg(PyObject *args, swig_type_info *type,
PyObject **py_pool, apr_pool_t **pool);
@@ -93,7 +77,6 @@ int svn_swig_py_get_pool_arg(PyObject *a
* argument list. Return 0 if successful. Return 1 if an error
* occurs.
*/
-SVN_SWIG_SWIGUTIL_EXPORT
int svn_swig_py_get_parent_pool(PyObject *args, swig_type_info *type,
PyObject **py_pool, apr_pool_t **pool);
@@ -101,54 +84,45 @@ int svn_swig_py_get_parent_pool(PyObject
/*** SWIG Wrappers ***/
/* Wrapper for SWIG_NewPointerObj */
-SVN_SWIG_SWIGUTIL_EXPORT
-PyObject *svn_swig_NewPointerObj(void *obj, swig_type_info *type,
+PyObject *svn_swig_py_new_pointer_obj(void *obj, swig_type_info *type,
PyObject *pool, PyObject *args);
/* Wrapper for SWIG_ConvertPtr */
-SVN_SWIG_SWIGUTIL_EXPORT
-int svn_swig_ConvertPtr(PyObject *input, void **obj, swig_type_info *type);
+int svn_swig_py_convert_ptr(PyObject *input, void **obj, swig_type_info *type);
/* Wrapper for SWIG_MustGetPtr */
-SVN_SWIG_SWIGUTIL_EXPORT
-void *svn_swig_MustGetPtr(void *input, swig_type_info *type, int argnum);
+void *svn_swig_py_must_get_ptr(void *input, swig_type_info *type, int argnum);
/*** Functions to expose a custom SubversionException ***/
/* raise a subversion exception, created from a normal subversion
error. consume the error. */
-SVN_SWIG_SWIGUTIL_EXPORT
void svn_swig_py_svn_exception(svn_error_t *err);
/* helper function to convert an apr_hash_t* (char* -> svnstring_t*) to
a Python dict */
-SVN_SWIG_SWIGUTIL_EXPORT
PyObject *svn_swig_py_prophash_to_dict(apr_hash_t *hash);
/* helper function to convert an apr_hash_t* (svn_revnum_t* -> const
char *) to a Python dict */
-SVN_SWIG_SWIGUTIL_EXPORT
PyObject *svn_swig_py_locationhash_to_dict(apr_hash_t *hash);
/* helper function to convert an apr_array_header_t* (of
svn_merge_range_t *) to a Python list */
-SVN_SWIG_SWIGUTIL_EXPORT
PyObject *svn_swig_py_pointerlist_to_list(apr_array_header_t *list,
swig_type_info *type,
PyObject *py_pool);
/* helper function to convert an apr_hash_t* (const char *->array of
svn_merge_range_t *) to a Python dict */
-SVN_SWIG_SWIGUTIL_EXPORT
PyObject *svn_swig_py_mergeinfo_to_dict(apr_hash_t *hash,
swig_type_info *type,
PyObject *py_pool);
/* helper function to convert an apr_hash_t* (const char *->hash of
mergeinfo hashes) to a Python dict */
-SVN_SWIG_SWIGUTIL_EXPORT
PyObject *svn_swig_py_mergeinfo_catalog_to_dict(apr_hash_t *hash,
swig_type_info *type,
PyObject *py_pool);
@@ -156,90 +130,75 @@ PyObject *svn_swig_py_mergeinfo_catalog_
/* helper function to convert an apr_hash_t *(const char *->const char
*) to a Python dict */
-SVN_SWIG_SWIGUTIL_EXPORT
PyObject *svn_swig_py_stringhash_to_dict(apr_hash_t *hash);
/* convert a hash of 'const char *' -> TYPE into a Python dict */
-SVN_SWIG_SWIGUTIL_EXPORT
PyObject *svn_swig_py_convert_hash(apr_hash_t *hash, swig_type_info *type,
PyObject *py_pool);
/* helper function to convert a 'char **' into a Python list of string
objects */
-SVN_SWIG_SWIGUTIL_EXPORT
PyObject *svn_swig_py_c_strings_to_list(char **strings);
/* helper function to convert an array of 'const char *' to a Python list
of string objects */
-SVN_SWIG_SWIGUTIL_EXPORT
PyObject *svn_swig_py_array_to_list(const apr_array_header_t *strings);
/* helper function to convert a hash mapping char * to
* svn_log_changed_path_t * to a Python dict mapping str to str. */
-SVN_SWIG_SWIGUTIL_EXPORT
PyObject *svn_swig_py_changed_path_hash_to_dict(apr_hash_t *hash);
/* helper function to convert a hash mapping char * to
* svn_log_changed_path2_t * to a Python dict mapping str to str. */
-SVN_SWIG_SWIGUTIL_EXPORT
PyObject *svn_swig_py_changed_path2_hash_to_dict(apr_hash_t *hash);
/* helper function to convert an array of 'svn_revnum_t' to a Python list
of int objects */
-SVN_SWIG_SWIGUTIL_EXPORT
PyObject *svn_swig_py_revarray_to_list(const apr_array_header_t *revs);
/* helper function to convert a Python dictionary mapping strings to
strings into an apr_hash_t mapping const char *'s to const char *'s,
allocated in POOL. */
-SVN_SWIG_SWIGUTIL_EXPORT
apr_hash_t *svn_swig_py_stringhash_from_dict(PyObject *dict,
apr_pool_t *pool);
/* helper function to convert a Python dictionary mapping strings to
rangelists into an apr_hash_t mapping const char *'s to rangelists,
allocated in POOL. */
-SVN_SWIG_SWIGUTIL_EXPORT
apr_hash_t *svn_swig_py_mergeinfo_from_dict(PyObject *dict,
apr_pool_t *pool);
/* helper function to convert a Python dictionary mapping strings to
strings into an 'apr_array_header_t *' of svn_prop_t *
allocated in POOL. */
-SVN_SWIG_SWIGUTIL_EXPORT
apr_array_header_t *svn_swig_py_proparray_from_dict(PyObject *dict,
apr_pool_t *pool);
/* helper function to convert a 'apr_array_header_t *' of 'svn_prop_t
to a Python dictionary mapping strings to strings. */
-SVN_SWIG_SWIGUTIL_EXPORT
PyObject *svn_swig_py_proparray_to_dict(const apr_array_header_t *array);
/* helper function to convert a 'apr_array_header_t *' of
'svn_prop_inherited_item_t' to a Python dictionary mapping strings
to dictionary. */
-SVN_SWIG_SWIGUTIL_EXPORT
PyObject *
svn_swig_py_propinheriteditemarray_to_dict(const apr_array_header_t *array);
/* helper function to convert a Python dictionary mapping strings to
strings into an apr_hash_t mapping const char *'s to svn_string_t's,
allocated in POOL. */
-SVN_SWIG_SWIGUTIL_EXPORT
apr_hash_t *svn_swig_py_prophash_from_dict(PyObject *dict,
apr_pool_t *pool);
/* helper function to convert a Python dictionary mapping strings to
integers into an apr_hash_t mapping const char *'s to revnums,
allocated in POOL. */
-SVN_SWIG_SWIGUTIL_EXPORT
apr_hash_t *svn_swig_py_path_revs_hash_from_dict(PyObject *dict,
apr_pool_t *pool);
/* helper function to convert a Python dictionary mapping strings to
SWIG wrappers described by type into an apr_hash_t mapping const char *'s to
struct pointers, allocated in POOL. */
-SVN_SWIG_SWIGUTIL_EXPORT
apr_hash_t *svn_swig_py_struct_ptr_hash_from_dict(PyObject *dict,
swig_type_info *type,
apr_pool_t *pool);
@@ -259,7 +218,6 @@ typedef int (*svn_swig_py_object_unwrap_
In case of failure, raises a Python exception, presuming that seq was the
function argument #argnum.
pool is used to allocate the array. */
-SVN_SWIG_SWIGUTIL_EXPORT
const apr_array_header_t *
svn_swig_py_seq_to_array(PyObject *seq,
int element_size,
@@ -269,7 +227,6 @@ svn_swig_py_seq_to_array(PyObject *seq,
/* An svn_swig_py_object_unwrap_t that extracts a char pointer from a Python
string. */
-SVN_SWIG_SWIGUTIL_EXPORT
int
svn_swig_py_unwrap_string(PyObject *source,
void *destination,
@@ -277,7 +234,6 @@ svn_swig_py_unwrap_string(PyObject *sour
/* An svn_swig_py_object_unwrap_t that extracts an svn_revnum_t from a Python
integer. */
-SVN_SWIG_SWIGUTIL_EXPORT
int
svn_swig_py_unwrap_revnum(PyObject *source,
void *destination,
@@ -285,30 +241,25 @@ svn_swig_py_unwrap_revnum(PyObject *sour
/* An svn_swig_py_object_unwrap_t that extracts a struct pointer from a SWIG
wrapper. baton is expected to be a swig_type_info* describing the struct. */
-SVN_SWIG_SWIGUTIL_EXPORT
int
svn_swig_py_unwrap_struct_ptr(PyObject *source,
void *destination,
void *baton);
/* make an editor that "thunks" from C callbacks up to Python */
-SVN_SWIG_SWIGUTIL_EXPORT
void svn_swig_py_make_editor(const svn_delta_editor_t **editor,
void **edit_baton,
PyObject *py_editor,
apr_pool_t *pool);
-SVN_SWIG_SWIGUTIL_EXPORT
apr_file_t *svn_swig_py_make_file(PyObject *py_file,
apr_pool_t *pool);
-SVN_SWIG_SWIGUTIL_EXPORT
svn_stream_t *svn_swig_py_make_stream(PyObject *py_io,
apr_pool_t *pool);
/* Convert ops, a C array of num_ops elements, to a Python list of SWIG
objects with descriptor op_type_info and pool set to parent_pool. */
-SVN_SWIG_SWIGUTIL_EXPORT
PyObject *
svn_swig_py_convert_txdelta_op_c_array(int num_ops,
svn_txdelta_op_t *ops,
@@ -317,7 +268,6 @@ svn_swig_py_convert_txdelta_op_c_array(i
/* a notify function that executes a Python function that is passed in
via the baton argument */
-SVN_SWIG_SWIGUTIL_EXPORT
void svn_swig_py_notify_func(void *baton,
const char *path,
svn_wc_notify_action_t action,
@@ -327,21 +277,18 @@ void svn_swig_py_notify_func(void *baton
svn_wc_notify_state_t prop_state,
svn_revnum_t revision);
-SVN_SWIG_SWIGUTIL_EXPORT
void svn_swig_py_notify_func2(void *baton,
const svn_wc_notify_t *notify,
apr_pool_t *pool);
/* a status function that executes a Python function that is passed in
via the baton argument */
-SVN_SWIG_SWIGUTIL_EXPORT
void svn_swig_py_status_func(void *baton,
const char *path,
svn_wc_status_t *status);
/* a svn_delta_path_driver callback that executes a Python function
that is passed in via the baton argument */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_delta_path_driver_cb_func(void **dir_baton,
void *parent_baton,
void *callback_baton,
@@ -350,24 +297,20 @@ svn_error_t *svn_swig_py_delta_path_driv
/* a status function that executes a Python function that is passed in
via the baton argument */
-SVN_SWIG_SWIGUTIL_EXPORT
void svn_swig_py_status_func2(void *baton,
const char *path,
svn_wc_status2_t *status);
/* a cancel function that executes a Python function passed in via the
cancel_baton argument. */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_cancel_func(void *cancel_baton);
/* thunked fs get_locks function */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_fs_get_locks_func(void *baton,
svn_lock_t *lock,
apr_pool_t *pool);
/* thunked commit log fetcher */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_get_commit_log_func(const char **log_msg,
const char **tmp_file,
const apr_array_header_t *
@@ -376,7 +319,6 @@ svn_error_t *svn_swig_py_get_commit_log_
apr_pool_t *pool);
/* thunked repos authz callback function */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_repos_authz_func(svn_boolean_t *allowed,
svn_fs_root_t *root,
const char *path,
@@ -384,14 +326,12 @@ svn_error_t *svn_swig_py_repos_authz_fun
apr_pool_t *pool);
/* thunked history callback function */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_repos_history_func(void *baton,
const char *path,
svn_revnum_t revision,
apr_pool_t *pool);
/* thunked log receiver function */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_log_receiver(void *py_receiver,
apr_hash_t *changed_paths,
svn_revnum_t rev,
@@ -401,23 +341,19 @@ svn_error_t *svn_swig_py_log_receiver(vo
apr_pool_t *pool);
/* thunked log receiver2 function */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_log_entry_receiver(void *baton,
svn_log_entry_t *log_entry,
apr_pool_t *pool);
/* thunked repos freeze function */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_repos_freeze_func(void *baton,
apr_pool_t *pool);
/* thunked fs freeze function */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_fs_freeze_func(void *baton,
apr_pool_t *pool);
/* thunked proplist receiver2 function */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_proplist_receiver2(void *baton,
const char *path,
apr_hash_t *prop_hash,
@@ -425,21 +361,18 @@ svn_error_t *svn_swig_py_proplist_receiv
apr_pool_t *pool);
/* thunked info receiver function */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_info_receiver_func(void *py_receiver,
const char *path,
const svn_info_t *info,
apr_pool_t *pool);
/* thunked location segments receiver function */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *
svn_swig_py_location_segment_receiver_func(svn_location_segment_t *segment,
void *baton,
apr_pool_t *pool);
/* thunked blame receiver function */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_client_blame_receiver_func(void *baton,
apr_int64_t line_no,
svn_revnum_t revision,
@@ -449,21 +382,18 @@ svn_error_t *svn_swig_py_client_blame_re
apr_pool_t *pool);
/* thunked changelist receiver function */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_changelist_receiver_func(void *baton,
const char *path,
const char *changelist,
apr_pool_t *pool);
/* auth provider callbacks */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t * svn_swig_py_auth_gnome_keyring_unlock_prompt_func(
char **keyring_passwd,
const char *keyring_name,
void *baton,
apr_pool_t *pool);
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_auth_simple_prompt_func(
svn_auth_cred_simple_t **cred,
void *baton,
@@ -472,7 +402,6 @@ svn_error_t *svn_swig_py_auth_simple_pro
svn_boolean_t may_save,
apr_pool_t *pool);
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_auth_username_prompt_func(
svn_auth_cred_username_t **cred,
void *baton,
@@ -480,7 +409,6 @@ svn_error_t *svn_swig_py_auth_username_p
svn_boolean_t may_save,
apr_pool_t *pool);
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_auth_ssl_server_trust_prompt_func(
svn_auth_cred_ssl_server_trust_t **cred,
void *baton,
@@ -490,7 +418,6 @@ svn_error_t *svn_swig_py_auth_ssl_server
svn_boolean_t may_save,
apr_pool_t *pool);
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_auth_ssl_client_cert_prompt_func(
svn_auth_cred_ssl_client_cert_t **cred,
void *baton,
@@ -498,7 +425,6 @@ svn_error_t *svn_swig_py_auth_ssl_client
svn_boolean_t may_save,
apr_pool_t *pool);
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_auth_ssl_client_cert_pw_prompt_func(
svn_auth_cred_ssl_client_cert_pw_t **cred,
void *baton,
@@ -507,7 +433,6 @@ svn_error_t *svn_swig_py_auth_ssl_client
apr_pool_t *pool);
/* auth cleanup callback */
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_config_auth_walk_func(svn_boolean_t *delete_cred,
void *walk_baton,
const char *cred_kind,
@@ -515,32 +440,27 @@ svn_error_t *svn_swig_py_config_auth_wal
apr_hash_t *hash,
apr_pool_t *scratch_pool);
-SVN_SWIG_SWIGUTIL_EXPORT
void
svn_swig_py_setup_ra_callbacks(svn_ra_callbacks2_t **callbacks,
void **baton,
PyObject *py_callbacks,
apr_pool_t *pool);
-SVN_SWIG_SWIGUTIL_EXPORT
svn_wc_diff_callbacks2_t *
svn_swig_py_setup_wc_diff_callbacks2(void **baton,
PyObject *py_callbacks,
apr_pool_t *pool);
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_commit_callback2(const svn_commit_info_t *commit_info,
void *baton,
apr_pool_t *pool);
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_commit_callback(svn_revnum_t new_revision,
const char *date,
const char *author,
void *baton);
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_ra_file_rev_handler_func(
void *baton,
const char *path,
@@ -551,7 +471,6 @@ svn_error_t *svn_swig_py_ra_file_rev_han
apr_array_header_t *prop_diffs,
apr_pool_t *pool);
-SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_ra_lock_callback(
void *baton,
const char *path,
@@ -560,17 +479,14 @@ svn_error_t *svn_swig_py_ra_lock_callbac
svn_error_t *ra_err,
apr_pool_t *pool);
-SVN_SWIG_SWIGUTIL_EXPORT
-extern const svn_ra_reporter2_t swig_py_ra_reporter2;
+const svn_ra_reporter2_t *svn_swig_py_get_ra_reporter2(void);
-SVN_SWIG_SWIGUTIL_EXPORT
svn_boolean_t
svn_swig_py_config_enumerator2(const char *name,
const char *value,
void *baton,
apr_pool_t *pool);
-SVN_SWIG_SWIGUTIL_EXPORT
svn_boolean_t
svn_swig_py_config_section_enumerator2(const char *name,
void *baton,
Modified: subversion/branches/cache-server/subversion/bindings/swig/python/svn/core.py
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/bindings/swig/python/svn/core.py?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/bindings/swig/python/svn/core.py (original)
+++ subversion/branches/cache-server/subversion/bindings/swig/python/svn/core.py Tue Oct 15 08:52:06 2013
@@ -27,44 +27,8 @@ from libsvn.core import *
import libsvn.core as _libsvncore
import atexit as _atexit
import sys
-__all__ = [
- # Symbols that 'import *' used to pull (in 1.7)
- 'Pool',
- 'SVNSYNC_PROP_CURRENTLY_COPYING',
- 'SVNSYNC_PROP_FROM_URL',
- 'SVNSYNC_PROP_FROM_UUID',
- 'SVNSYNC_PROP_LAST_MERGED_REV',
- 'SVNSYNC_PROP_LOCK',
- 'SVNSYNC_PROP_PREFIX',
- 'SubversionException',
- # 'apr_array_header_t',
- # 'apr_file_open_stderr',
- # 'apr_file_open_stdout',
- # 'apr_file_t',
- # 'apr_hash_t',
- # 'apr_initialize',
- # 'apr_pool_clear',
- # 'apr_pool_destroy',
- # 'apr_pool_t',
- # 'apr_terminate',
- # 'apr_time_ansi_put',
- # 'run_app',
-
- # Symbols defined explicitly below.
- 'SVN_IGNORED_REVNUM',
- 'SVN_INVALID_REVNUM',
- 'svn_path_compare_paths',
- 'svn_mergeinfo_merge',
- 'svn_mergeinfo_sort',
- 'svn_rangelist_merge',
- 'svn_rangelist_reverse',
- # 'Stream',
- # 'apr_initialize',
- # 'apr_terminate',
- 'svn_pool_create',
- 'svn_pool_destroy',
- 'svn_pool_clear',
-]
+# __all__ is defined later, since some svn_* functions are implemented below.
+
class SubversionException(Exception):
@@ -343,3 +307,22 @@ def run_app(func, *args, **kw):
performed as the function exits (normally or via an exception).
'''
return func(application_pool, *args, **kw)
+
+# Currently, this excludes:
+# 'FALSE' 'TRUE'
+# 'apr_array_header_t' 'apr_file_t' 'apr_hash_t'
+# 'apr_file_open_stderr' 'apr_file_open_stdout'
+# 'apr_initialize' 'apr_terminate'
+# 'apr_pool_clear' 'apr_pool_destroy' 'apr_pool_t'
+# 'apr_time_ansi_put'
+# 'run_app'
+# 'svn__apr_hash_index_key' 'svn__apr_hash_index_klen' 'svn__apr_hash_index_val'
+# 'svn_relpath__internal_style' 'svn_uri__is_ancestor'
+# 'svn_tristate__from_word' 'svn_tristate__to_word'
+__all__ = filter(lambda s: (s.startswith('svn_')
+ or s.startswith('SVN_')
+ or s.startswith('SVNSYNC_')
+ or s in ('Pool', 'SubversionException'))
+ and '__' not in s,
+ locals())
+
Modified: subversion/branches/cache-server/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c (original)
+++ subversion/branches/cache-server/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c Tue Oct 15 08:52:06 2013
@@ -23,9 +23,16 @@
/* Tell swigutil_rb.h that we're inside the implementation */
#define SVN_SWIG_SWIGUTIL_RB_C
+/* Windows hack: Allow overriding some <ruby.h> defaults */
+#include "swigutil_rb__pre_ruby.h"
#include "swig_ruby_external_runtime.swg"
#include "swigutil_rb.h"
+
+#ifdef HAVE_RUBY_ST_H
+#include <ruby/st.h>
+#else
#include <st.h>
+#endif
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
@@ -53,6 +60,7 @@
#include <locale.h>
#include <math.h>
+#include "svn_private_config.h"
#include "svn_hash.h"
#include "svn_nls.h"
#include "svn_pools.h"
@@ -735,7 +743,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 +1540,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;
@@ -1596,7 +1605,7 @@ typedef struct callback_handle_error_bat
} callback_handle_error_baton_t;
static VALUE
-callback(VALUE baton)
+callback(VALUE baton, ...)
{
callback_baton_t *cbb = (callback_baton_t *)baton;
VALUE result;
@@ -1608,7 +1617,7 @@ callback(VALUE baton)
}
static VALUE
-callback_rescue(VALUE baton)
+callback_rescue(VALUE baton, ...)
{
callback_rescue_baton_t *rescue_baton = (callback_rescue_baton_t*)baton;
@@ -1625,7 +1634,7 @@ callback_rescue(VALUE baton)
}
static VALUE
-callback_ensure(VALUE pool)
+callback_ensure(VALUE pool, ...)
{
svn_swig_rb_pop_pool(pool);
@@ -1637,15 +1646,16 @@ 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);
}
static VALUE
-callback_handle_error(VALUE baton)
+callback_handle_error(VALUE baton, ...)
{
callback_handle_error_baton_t *handle_error_baton;
handle_error_baton = (callback_handle_error_baton_t *)baton;
@@ -4024,4 +4034,7 @@ static svn_ra_reporter3_t rb_ra_reporter
svn_swig_rb_ra_reporter_abort_report
};
-svn_ra_reporter3_t *svn_swig_rb_ra_reporter3 = &rb_ra_reporter3;
+svn_ra_reporter3_t *svn_swig_rb_get_ra_reporter3()
+{
+ return &rb_ra_reporter3;
+}
Modified: subversion/branches/cache-server/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h (original)
+++ subversion/branches/cache-server/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h Tue Oct 15 08:52:06 2013
@@ -22,8 +22,14 @@
#ifndef SVN_SWIG_SWIGUTIL_RB_H
#define SVN_SWIG_SWIGUTIL_RB_H
+/* Windows hack: Allow overriding some <ruby.h> defaults */
+#include "swigutil_rb__pre_ruby.h"
#include <ruby.h>
+#ifdef HAVE_RUBY_REGEX_H
+#include <ruby/regex.h>
+#else
#include <regex.h>
+#endif
#if SIZEOF_VOIDP == SIZEOF_LONG
# define PTR2NUM(x) (ULONG2NUM((unsigned long)(x)))
@@ -45,17 +51,6 @@
#include "svn_client.h"
#include "svn_repos.h"
-/* Define DLL export magic on Windows. */
-#ifdef WIN32
-# ifdef SVN_SWIG_SWIGUTIL_RB_C
-# define SVN_RB_SWIG_SWIGUTIL_EXPORT __declspec(dllexport)
-# else
-# define SVN_RB_SWIG_SWIGUTIL_EXPORT __declspec(dllimport)
-# endif
-#else
-# define SVN_RB_SWIG_SWIGUTIL_EXPORT
-#endif
-
/* Ruby <=1.8.5 compatibility */
#ifndef RARRAY_LEN
#define RARRAY_LEN(x) RARRAY(x)->len
@@ -74,7 +69,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
{
@@ -84,152 +84,98 @@ typedef struct apr_pool_wrapper_t
apr_array_header_t *children;
} apr_pool_wrapper_t;
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_initialize(void);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_pool_t *svn_swig_rb_pool(void);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_allocator_t *svn_swig_rb_allocator(void);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_svn_delta_editor(void);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_svn_delta_text_delta_window_handler(void);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_raise_svn_fs_already_close(void);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_raise_svn_repos_already_close(void);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_svn_error_new(VALUE code, VALUE message,
VALUE file, VALUE line, VALUE child);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_svn_error_to_rb_error(svn_error_t *error);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_handle_svn_error(svn_error_t *error);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void *svn_swig_rb_to_swig_type(VALUE value, const void *ctx, apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_from_swig_type(void *value, void *ctx);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_depth_t svn_swig_rb_to_depth(VALUE value);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_mergeinfo_inheritance_t svn_swig_rb_to_mergeinfo_inheritance(VALUE value);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_svn_date_string_to_time(const char *date);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_apr_hash_to_hash_string(apr_hash_t *hash);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_apr_hash_to_hash_svn_string(apr_hash_t *hash);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_apr_hash_to_hash_swig_type(apr_hash_t *hash,
const char *type_name);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_apr_hash_to_hash_merge_range(apr_hash_t *hash);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_apr_hash_to_hash_merge_range_hash(apr_hash_t *hash);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_prop_hash_to_hash(apr_hash_t *prop_hash);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_apr_revnum_key_hash_to_hash_string(apr_hash_t *hash);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_apr_array_to_array_string(const apr_array_header_t *ary);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_apr_array_to_array_svn_string(const apr_array_header_t *ary);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_apr_array_to_array_svn_rev(const apr_array_header_t *ary);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_apr_array_to_array_proplist_item(const apr_array_header_t *ary);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_apr_array_to_array_external_item2(const apr_array_header_t *ary);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_apr_array_to_array_merge_range(const apr_array_header_t *ary);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_apr_array_to_array_auth_provider_object(const apr_array_header_t *ary);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_prop_apr_array_to_hash_prop(const apr_array_header_t *ary);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_hash_t *svn_swig_rb_hash_to_apr_hash_string(VALUE hash, apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_hash_t *svn_swig_rb_hash_to_apr_hash_svn_string(VALUE hash,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_hash_t *svn_swig_rb_hash_to_apr_hash_swig_type(VALUE hash,
const char *typename,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_hash_t *svn_swig_rb_hash_to_apr_hash_revnum(VALUE hash,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_hash_t *svn_swig_rb_hash_to_apr_hash_merge_range(VALUE hash,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_array_header_t *svn_swig_rb_strings_to_apr_array(VALUE strings,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_array_header_t *
svn_swig_rb_array_to_auth_provider_object_apr_array(VALUE array,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_array_header_t *svn_swig_rb_array_to_apr_array_revnum(VALUE array,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_array_header_t *svn_swig_rb_array_to_apr_array_merge_range(VALUE array,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_array_header_t *svn_swig_rb_array_to_apr_array_copy_source(VALUE array,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_array_header_t *svn_swig_rb_array_to_apr_array_revision_range(VALUE array,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_array_header_t *svn_swig_rb_to_apr_array_prop(VALUE array_or_hash,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_array_header_t *svn_swig_rb_to_apr_array_row_prop(VALUE array_or_hash,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_get_pool(int argc, VALUE *argv, VALUE self, VALUE *rb_pool, apr_pool_t **pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_boolean_t svn_swig_rb_set_pool(VALUE target, VALUE pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_set_pool_for_no_swig_type(VALUE target, VALUE pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_push_pool(VALUE pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_pop_pool(VALUE pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_destroy_pool(VALUE pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_destroy_internal_pool(VALUE pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_make_delta_editor(svn_delta_editor_t **editor,
void **edit_baton,
VALUE rb_editor,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_make_baton(VALUE proc, VALUE pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_set_baton(VALUE target, VALUE baton);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_log_receiver(void *baton,
apr_hash_t *changed_paths,
svn_revnum_t revision,
@@ -238,19 +184,16 @@ svn_error_t *svn_swig_rb_log_receiver(vo
const char *message,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_log_entry_receiver(void *baton,
svn_log_entry_t *entry,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_repos_authz_func(svn_boolean_t *allowed,
svn_fs_root_t *root,
const char *path,
void *baton,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_repos_authz_callback(svn_repos_authz_access_t required,
svn_boolean_t *allowed,
svn_fs_root_t *root,
@@ -259,7 +202,6 @@ svn_error_t *svn_swig_rb_repos_authz_cal
apr_pool_t *pool);
/* Implements the svn_client_get_commit_log3_t API. */
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_get_commit_log_func(const char **log_msg,
const char **tmp_file,
const apr_array_header_t *
@@ -267,76 +209,60 @@ svn_error_t *svn_swig_rb_get_commit_log_
void *baton,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_notify_func2(void *baton,
const svn_wc_notify_t *notify,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_conflict_resolver_func
(svn_wc_conflict_result_t **result,
const svn_wc_conflict_description_t *description,
void *baton,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_commit_callback(svn_revnum_t new_revision,
const char *date,
const char *author,
void *baton);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_commit_callback2(const svn_commit_info_t *commit_info,
void *baton,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_cancel_func(void *cancel_baton);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_info_receiver(void *baton,
const char *path,
const svn_info_t *info,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_boolean_t svn_swig_rb_config_enumerator(const char *name,
const char *value,
void *baton,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_boolean_t svn_swig_rb_config_section_enumerator(const char *name,
void *baton,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_delta_path_driver_cb_func(void **dir_baton,
void *parent_baton,
void *callback_baton,
const char *path,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_txdelta_window_handler(svn_txdelta_window_t *window,
void *baton);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_fs_warning_callback(void *baton, svn_error_t *err);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_fs_warning_callback_baton_register(VALUE baton,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_fs_get_locks_callback(void *baton,
svn_lock_t *lock,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_just_call(void *baton);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_setup_ra_callbacks(svn_ra_callbacks2_t **callbacks,
void **baton,
VALUE rb_callbacks,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_ra_lock_callback(void *baton,
const char *path,
svn_boolean_t do_lock,
@@ -344,7 +270,6 @@ svn_error_t *svn_swig_rb_ra_lock_callbac
svn_error_t *ra_err,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_ra_file_rev_handler(void *baton,
const char *path,
svn_revnum_t rev,
@@ -354,13 +279,11 @@ svn_error_t *svn_swig_rb_ra_file_rev_han
apr_array_header_t *prop_diffs,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_repos_history_func(void *baton,
const char *path,
svn_revnum_t revision,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_repos_file_rev_handler(void *baton,
const char *path,
svn_revnum_t rev,
@@ -370,7 +293,6 @@ svn_error_t *svn_swig_rb_repos_file_rev_
apr_array_header_t *prop_diffs,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_wc_relocation_validator3(void *baton,
const char *uuid,
const char *url,
@@ -379,14 +301,12 @@ svn_error_t *svn_swig_rb_wc_relocation_v
/* auth provider callbacks */
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t * svn_swig_rb_auth_gnome_keyring_unlock_prompt_func(
char **keyring_passwd,
const char *keyring_name,
void *baton,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_auth_simple_prompt_func(
svn_auth_cred_simple_t **cred,
void *baton,
@@ -395,7 +315,6 @@ svn_error_t *svn_swig_rb_auth_simple_pro
svn_boolean_t may_save,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_auth_username_prompt_func(
svn_auth_cred_username_t **cred,
void *baton,
@@ -403,7 +322,6 @@ svn_error_t *svn_swig_rb_auth_username_p
svn_boolean_t may_save,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_auth_ssl_server_trust_prompt_func(
svn_auth_cred_ssl_server_trust_t **cred,
void *baton,
@@ -413,7 +331,6 @@ svn_error_t *svn_swig_rb_auth_ssl_server
svn_boolean_t may_save,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_auth_ssl_client_cert_prompt_func(
svn_auth_cred_ssl_client_cert_t **cred,
void *baton,
@@ -421,7 +338,6 @@ svn_error_t *svn_swig_rb_auth_ssl_client
svn_boolean_t may_save,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_auth_ssl_client_cert_pw_prompt_func(
svn_auth_cred_ssl_client_cert_pw_t **cred,
void *baton,
@@ -429,27 +345,20 @@ svn_error_t *svn_swig_rb_auth_ssl_client
svn_boolean_t may_save,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
apr_file_t *svn_swig_rb_make_file(VALUE file, apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_stream_t *svn_swig_rb_make_stream(VALUE io);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_filename_to_temp_file(const char *file_name);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_set_revision(svn_opt_revision_t *rev, VALUE value);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_adjust_arg_for_client_ctx_and_pool(int *argc, VALUE **argv);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_wc_status_func(void *baton,
const char *path,
svn_wc_status2_t *status);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_client_blame_receiver_func(void *baton,
apr_int64_t line_no,
svn_revnum_t revision,
@@ -459,39 +368,27 @@ svn_error_t *svn_swig_rb_client_blame_re
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_wc_entry_callbacks2_t *svn_swig_rb_wc_entry_callbacks2(void);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_wc_diff_callbacks2_t *svn_swig_rb_wc_diff_callbacks2(void);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_make_txdelta_window_handler_wrapper(VALUE *rb_handler_pool,
apr_pool_t **handler_pool,
svn_txdelta_window_handler_t **handler,
void ***handler_baton);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_setup_txdelta_window_handler_wrapper(VALUE obj,
svn_txdelta_window_handler_t handler,
void *handler_baton);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
-svn_error_t *svn_swig_rb_invoke_txdelta_window_handler(VALUE window_handler,
- svn_txdelta_window_t *window,
- apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_invoke_txdelta_window_handler_wrapper(VALUE obj,
svn_txdelta_window_t *window,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_txdelta_window_t_ops_get(svn_txdelta_window_t *window);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_client_diff_summarize_func(const svn_client_diff_summarize_t *diff,
void *baton,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_client_list_func(void *baton,
const char *path,
const svn_dirent_t *dirent,
@@ -499,20 +396,17 @@ svn_error_t *svn_swig_rb_client_list_fun
const char *abs_path,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_proplist_receiver(void *baton,
const char *path,
apr_hash_t *prop_hash,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_changelist_receiver(void *baton,
const char *path,
const char *changelist,
apr_pool_t *pool);
-SVN_RB_SWIG_SWIGUTIL_EXPORT
-extern svn_ra_reporter3_t *svn_swig_rb_ra_reporter3;
+svn_ra_reporter3_t *svn_swig_rb_get_ra_reporter3();
#ifdef __cplusplus
}
Modified: subversion/branches/cache-server/subversion/bindings/swig/ruby/test/greek_tree.rb
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/bindings/swig/ruby/test/greek_tree.rb?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/bindings/swig/ruby/test/greek_tree.rb (original)
+++ subversion/branches/cache-server/subversion/bindings/swig/ruby/test/greek_tree.rb Tue Oct 15 08:52:06 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/cache-server/subversion/bindings/swig/ruby/test/test_client.rb
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/bindings/swig/ruby/test/test_client.rb?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/bindings/swig/ruby/test/test_client.rb (original)
+++ subversion/branches/cache-server/subversion/bindings/swig/ruby/test/test_client.rb Tue Oct 15 08:52:06 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/cache-server/subversion/bindings/swig/ruby/test/test_fs.rb
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/bindings/swig/ruby/test/test_fs.rb?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/bindings/swig/ruby/test/test_fs.rb (original)
+++ subversion/branches/cache-server/subversion/bindings/swig/ruby/test/test_fs.rb Tue Oct 15 08:52:06 2013
@@ -209,10 +209,14 @@ class SvnFsTest < Test::Unit::TestCase
ctx.commit(@wc_path)
end
- assert_raises(Svn::Error::FsNoSuchTransaction) do
+ assert_raises(Svn::Error::FsMalformedTxnId) do
@fs.open_txn("NOT-EXIST")
end
+ assert_raises(Svn::Error::FsNoSuchTransaction) do
+ @fs.open_txn("9-9")
+ end
+
start_time = Time.now
txn1 = @fs.transaction
assert_equal([Svn::Core::PROP_REVISION_DATE], txn1.proplist.keys)
Modified: subversion/branches/cache-server/subversion/bindings/swig/ruby/test/util.rb
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/bindings/swig/ruby/test/util.rb?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/bindings/swig/ruby/test/util.rb (original)
+++ subversion/branches/cache-server/subversion/bindings/swig/ruby/test/util.rb Tue Oct 15 08:52:06 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,41 @@
require "fileutils"
require "pathname"
-require "svn/util"
+
+# Tale of a hack...
+#
+# Here we are, %SVN-WC-ROOT%/subversion/bindings/swig/ruby/test/util.rb,
+# trying to require %SVN-WC-ROOT%/subversion/bindings/swig/ruby/svn/util.rb,
+# all the while supporting both Ruby 1.8 and 1.9. Simply using this,
+#
+# require "svn/util"
+#
+# works for Ruby 1.8 if the CWD is subversion/bindings/swig/ruby
+# when we are running the tests, e.g.:
+#
+# %SVN-WC-ROOT%/subversion/bindings/swig/ruby>ruby test\run-test.rb
+#
+# This is because the CWD is included in the load path when Ruby 1.8
+# searches for required files. But this doesn't work for Ruby 1.9,
+# which doesn't include the CWD this way, so instead we could use this:
+#
+# require "./svn/util"
+#
+# But that only works if ./svn/util is relative to the CWD (again if the
+# CWD is %SVN-WC-ROOT%/subversion/bindings/swig/ruby). However, if we run
+# the tests from a different CWD and specify
+# %SVN-WC-ROOT%/subversion/bindings/swig/ruby as an additional $LOAD_PATH
+# using the ruby -I option, then that fails on both 1.8 and 1.9 with a
+# LoadError.
+#
+# The usual solution in a case like this is to use require_relative,
+#
+# require_relative "../svn/util"
+#
+# But that's only available in Ruby 1.9. We could require the backports gem
+# but there is a simple workaround, just calculate the full path of util:
+require File.join(File.dirname(__FILE__), '../svn/util')
+
require "tmpdir"
require "my-assertions"
@@ -43,19 +77,21 @@ 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")
+ @svnserve_pid_file = File.join(@tmp_path, "svnserve.pid")
@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/cache-server/subversion/bindings/swig/ruby/test/windows_util.rb
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/bindings/swig/ruby/test/windows_util.rb?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/bindings/swig/ruby/test/windows_util.rb (original)
+++ subversion/branches/cache-server/subversion/bindings/swig/ruby/test/windows_util.rb Tue Oct 15 08:52:06 2013
@@ -34,114 +34,31 @@ module SvnTestUtil
end
end
- def service_control(command, args={})
- args = args.collect do |key, value|
- "#{key}= #{Svnserve.escape_value(value)}"
- end.join(" ")
- result = `sc #{command} #{service_name} #{args}`
- if result.match(/FAILED/)
- raise "Failed to #{command} #{service_name}: #{args}"
- end
- /^\s*STATE\s*:\s\d+\s*(.*?)\s*$/ =~ result
- $1
- end
-
- def grant_everyone_full_access(dir)
- dir = dir.tr(File::SEPARATOR, File::ALT_SEPARATOR)
- `cacls #{Svnserve.escape_value(dir)} /T /E /P Everyone:F`
- end
-
- def service_exists?
- begin
- service_control("query")
- true
- rescue
- false
- end
- end
-
- def service_stopped?
- "STOPPED" == service_control("query") rescue true
- end
-
def setup_svnserve
@svnserve_port = @svnserve_ports.last
@repos_svnserve_uri = "svn://#{@svnserve_host}:#{@svnserve_port}"
- grant_everyone_full_access(@full_repos_path)
@@service_created ||= begin
@@service_created = true
- service_control('stop') unless service_stopped?
- service_control('delete') if service_exists?
-
- svnserve_dir = File.expand_path("svnserve")
- FileUtils.mkdir_p(svnserve_dir)
- at_exit do
- service_control('stop') unless service_stopped?
- service_control('delete') if service_exists?
- FileUtils.rm_rf(svnserve_dir)
- end
- trap("INT") do
- service_control('stop') unless service_stopped?
- service_control('delete') if service_exists?
- FileUtils.rm_rf(svnserve_dir)
- end
-
- config = SetupEnvironment.gen_make_opts
- apr_version_include = Pathname.new(config["--with-apr"]) +
- 'include' + 'apr_version.h'
- %r'^\s*#define\s+APR_MAJOR_VERSION\s+(\d+)' =~ apr_version_include.read
- apr_major_version = $1 == '0' ? '' : "-#{$1}"
-
- 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)
- ENV["PATH"].split(";").each do |path|
- found_targets = []
- targets.each do |target|
- target_path = "#{path}\\#{target}"
- if File.exists?(target_path)
- found_targets << target
- FileUtils.cp(target_path, svnserve_dir)
- end
- end
- targets -= found_targets
- break if targets.empty?
- end
- # Remove optional targets instead of raising below. If they are really
- # needed, svnserve won't start anyway.
- targets -= %W[libapriconv#{apr_major_version}.dll]
- unless targets.empty?
- raise "can't find libraries to work svnserve: #{targets.join(' ')}"
- end
-
- grant_everyone_full_access(svnserve_dir)
- svnserve_path = File.join(svnserve_dir, "svnserve.exe")
- svnserve_path = svnserve_path.tr(File::SEPARATOR,
- File::ALT_SEPARATOR)
+ top_directory = File.join(File.dirname(__FILE__), "..", "..", "..", "..", "..")
+ build_type = ENV["BUILD_TYPE"] || "Release"
+ svnserve_path = File.join(top_directory, build_type, 'subversion', 'svnserve', 'svnserve.exe')
svnserve_path = Svnserve.escape_value(svnserve_path)
root = @full_repos_path.tr(File::SEPARATOR, File::ALT_SEPARATOR)
+ FileUtils.mkdir_p(root)
- args = ["--service", "--root", Svnserve.escape_value(root),
- "--listen-host", @svnserve_host,
- "--listen-port", @svnserve_port]
+ IO.popen("#{svnserve_path} -d -r #{Svnserve.escape_value(root)} --listen-host #{@svnserve_host} --listen-port #{@svnserve_port} --pid-file #{@svnserve_pid_file}")
user = ENV["USERNAME"] || Etc.getlogin
- service_control('create',
- [["binPath", "#{svnserve_path} #{args.join(' ')}"],
- ["DisplayName", service_name],
- ["type", "own"]])
end
- service_control('start')
true
end
def teardown_svnserve
- service_control('stop') unless service_stopped?
+ # TODO:
+ # Load @svnserve_pid_file
+ # Kill process
end
def add_pre_revprop_change_hook
@@ -194,7 +111,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)
Modified: subversion/branches/cache-server/subversion/bindings/swig/svn_client.i
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/bindings/swig/svn_client.i?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/bindings/swig/svn_client.i (original)
+++ subversion/branches/cache-server/subversion/bindings/swig/svn_client.i Tue Oct 15 08:52:06 2013
@@ -64,12 +64,10 @@
}
#endif
-#if defined(SWIGRUBY) || defined(SWIGPYTHON)
%apply apr_array_header_t *REVISION_RANGE_LIST {
const apr_array_header_t *ranges_to_merge,
const apr_array_header_t *revision_ranges
}
-#endif
#ifdef SWIGRUBY
%apply const char *NOT_NULL {
Modified: subversion/branches/cache-server/subversion/bindings/swig/svn_delta.i
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/bindings/swig/svn_delta.i?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/bindings/swig/svn_delta.i (original)
+++ subversion/branches/cache-server/subversion/bindings/swig/svn_delta.i Tue Oct 15 08:52:06 2013
@@ -63,6 +63,9 @@
*/
#ifdef SWIGPYTHON
+/* Make swig wrap this function for us, to allow making an editor in python
+ ### There must be a cleaner way to implement this?
+ ### Maybe follow Ruby by wrapping it where passing an editor? */
void svn_swig_py_make_editor(const svn_delta_editor_t **editor,
void **edit_baton,
PyObject *py_editor,
@@ -71,14 +74,8 @@ void svn_swig_py_make_editor(const svn_d
#ifdef SWIGPERL
%typemap(in) (const svn_delta_editor_t *EDITOR, void *BATON) {
- svn_delta_make_editor(&$1, &$2, $input, _global_pool);
+ svn_swig_pl_make_editor(&$1, &$2, $input, _global_pool);
}
-
-void svn_delta_wrap_window_handler(svn_txdelta_window_handler_t *handler,
- void **handler_baton,
- SV *callback,
- apr_pool_t *pool);
-
#endif
#ifdef SWIGRUBY
Modified: subversion/branches/cache-server/subversion/bindings/swig/svn_ra.i
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/bindings/swig/svn_ra.i?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/bindings/swig/svn_ra.i (original)
+++ subversion/branches/cache-server/subversion/bindings/swig/svn_ra.i Tue Oct 15 08:52:06 2013
@@ -65,7 +65,7 @@
#ifdef SWIGPERL
/* FIXME: svn_ra_callbacks2_t ? */
%typemap(in) (const svn_ra_callbacks_t *callbacks, void *callback_baton) {
- svn_ra_make_callbacks(&$1, &$2, $input, _global_pool);
+ svn_swig_pl_make_callbacks(&$1, &$2, $input, _global_pool);
}
#endif
#ifdef SWIGRUBY
@@ -77,7 +77,7 @@
#ifdef SWIGPYTHON
%callback_typemap(const svn_ra_reporter2_t *reporter, void *report_baton,
- (svn_ra_reporter2_t *)&swig_py_ra_reporter2,
+ svn_swig_py_get_ra_reporter2(),
,
)
%callback_typemap(svn_location_segment_receiver_t receiver, void *receiver_baton,
@@ -90,7 +90,7 @@
%callback_typemap(const svn_ra_reporter3_t *reporter, void *report_baton,
,
,
- svn_swig_rb_ra_reporter3)
+ svn_swig_rb_get_ra_reporter3())
#endif
#ifndef SWIGPERL
Modified: subversion/branches/cache-server/subversion/include/mod_authz_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/include/mod_authz_svn.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/include/mod_authz_svn.h (original)
+++ subversion/branches/cache-server/subversion/include/mod_authz_svn.h Tue Oct 15 08:52:06 2013
@@ -36,9 +36,20 @@ extern "C" {
/*
* mod_dav_svn to mod_authz_svn bypass mechanism
*/
+/** Provider group for subrequest bypass */
#define AUTHZ_SVN__SUBREQ_BYPASS_PROV_GRP "dav2authz_subreq_bypass"
+/** Provider name for subrequest bypass */
#define AUTHZ_SVN__SUBREQ_BYPASS_PROV_NAME "mod_authz_svn_subreq_bypass"
+/** Provider version for subrequest bypass */
#define AUTHZ_SVN__SUBREQ_BYPASS_PROV_VER "00.00a"
+/** Provider to allow mod_dav_svn to bypass the generation of an apache
+ * request when checking GET access from "mod_dav_svn/auth.c".
+ *
+ * Uses @a r @a repos_path and @a repos_name to determine if the user
+ * making the request is authorized.
+ *
+ * If the access is allowed returns @c OK or @c HTTP_FORBIDDEN if it is not.
+ */
typedef int (*authz_svn__subreq_bypass_func_t)(request_rec *r,
const char *repos_path,
const char *repos_name);
Modified: subversion/branches/cache-server/subversion/include/private/svn_cache.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/include/private/svn_cache.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/include/private/svn_cache.h (original)
+++ subversion/branches/cache-server/subversion/include/private/svn_cache.h Tue Oct 15 08:52:06 2013
@@ -173,6 +173,12 @@ typedef struct svn_cache__info_t
* May be 0 if that information is not available.
*/
apr_uint64_t total_entries;
+
+ /** Number of index buckets with the given number of entries.
+ * Bucket sizes larger than the array will saturate into the
+ * highest array index.
+ */
+ apr_uint64_t histogram[32];
} svn_cache__info_t;
/**
@@ -299,6 +305,33 @@ svn_cache__membuffer_cache_create(svn_me
apr_pool_t *result_pool);
/**
+ * @defgroup Standard priority classes for #svn_cache__create_membuffer_cache.
+ * @{
+ */
+
+/**
+ * Data in this priority class should not be removed from the cache unless
+ * absolutely necessary. Use of this should be very restricted.
+ */
+#define SVN_CACHE__MEMBUFFER_HIGH_PRIORITY 10000
+
+/**
+ * Data in this priority class has a good chance to remain in cache unless
+ * there is more data in this class than the cache's capcity. Use of this
+ * as the default for all information that is costly to fetch from disk.
+ */
+#define SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY 1000
+
+/**
+ * Data in this priority class will be removed as soon as the cache starts
+ * filling up. Use of this for ephemeral data that can easisly be acquired
+ * again from other sources.
+ */
+#define SVN_CACHE__MEMBUFFER_LOW_PRIORITY 100
+
+/** @} */
+
+/**
* Creates a new cache in @a *cache_p, storing the data in a potentially
* shared @a membuffer object. The elements in the cache will be indexed
* by keys of length @a klen, which may be APR_HASH_KEY_STRING if they
@@ -306,7 +339,9 @@ svn_cache__membuffer_cache_create(svn_me
* serialize_func and deserialized using @a deserialize_func. Because
* the same memcache object may cache many different kinds of values
* form multiple caches, @a prefix should be specified to differentiate
- * this cache from other caches. @a *cache_p will be allocated in @a result_pool.
+ * this cache from other caches. All entries written through this cache
+ * interface will be assigned into the given @a priority class. @a *cache_p
+ * will be allocated in @a result_pool.
*
* If @a deserialize_func is NULL, then the data is returned as an
* svn_string_t; if @a serialize_func is NULL, then the data is
@@ -325,6 +360,7 @@ svn_cache__create_membuffer_cache(svn_ca
svn_cache__deserialize_func_t deserialize,
apr_ssize_t klen,
const char *prefix,
+ apr_uint32_t priority,
svn_boolean_t thread_safe,
apr_pool_t *result_pool);
@@ -371,6 +407,18 @@ svn_cache__get(void **value,
apr_pool_t *result_pool);
/**
+ * Looks for an entry indexed by @a key in @a cache, setting @a *found
+ * to TRUE if an entry has been found and FALSE otherwise. @a key may be
+ * NULL in which case @a *found will be FALSE. Temporary allocations will
+ * be made from @a scratch_pool.
+ */
+svn_error_t *
+svn_cache__has_key(svn_boolean_t *found,
+ svn_cache__t *cache,
+ const void *key,
+ apr_pool_t *scratch_pool);
+
+/**
* Stores the value @a value under the key @a key in @a cache. Uses @a
* scratch_pool for temporary allocations. The cache makes copies of
* @a key and @a value if necessary (that is, @a key and @a value may
@@ -461,13 +509,16 @@ svn_cache__get_info(svn_cache__t *cache,
/**
* Return the information given in @a info formatted as a multi-line string.
- * Allocations take place in @a result_pool.
+ * If @a access_only has been set, size and fill-level statistics will be
+ * omitted. Allocations take place in @a result_pool.
*/
svn_string_t *
svn_cache__format_info(const svn_cache__info_t *info,
+ svn_boolean_t access_only,
apr_pool_t *result_pool);
-/* Access the process-global (singleton) membuffer cache. The first call
+/**
+ * Access the process-global (singleton) membuffer cache. The first call
* will automatically allocate the cache using the current cache config.
* NULL will be returned if the desired cache size is 0.
*
@@ -476,6 +527,13 @@ svn_cache__format_info(const svn_cache__
struct svn_membuffer_t *
svn_cache__get_global_membuffer_cache(void);
+/**
+ * Return total access and size stats over all membuffer caches as they
+ * share the underlying data buffer. The result will be allocated in POOL.
+ */
+svn_cache__info_t *
+svn_cache__membuffer_get_global_info(apr_pool_t *pool);
+
/** @} */