[Daniel Schepler]
>   1) Error:
> test_apply(SvnDeltaTest):
> ArgumentError: NULL pointer given

Since you can reproduce this bug and I can't, could you please test a
patch?  Simply replace the file debian/patches/swig-1.3.28.patch with
the attached file and rebuild, and let us know whether it makes a
difference.

(Basically it adds some swig updates from subversion 1.3.1 and some
more which are proposed for 1.3.2.  I do not know whether this bundle
of patches is supposed to fix this issue, and the SWIG code is
sufficiently hairy that I can't tell.)

Thanks,
Peter
Stolen from trunk (r17280, r17931, r17967, r18031, r18172,
r18205, r18491, r18924, r18928, r18951, r18953):
Support SWIG 1.3.28.  Proposed for Subversion 1.3.2.

This would not be necessary if we used the shipped SWIG in the build,
rather than Debian's.  This happens to be inconvenient, however.

Index: build/generator/swig/external_runtime.py
===================================================================
--- build/generator/swig/external_runtime.py
+++ build/generator/swig/external_runtime.py
@@ -32,6 +32,8 @@
     self.checkout("perl5","perlrun.swg")
     self.checkout("ruby","rubydef.swg")
     self.checkout("ruby", "rubyhead.swg")
+    if self.version() >= 103026:
+      self.checkout("ruby", "rubytracking.swg")
 
     # Runtime library names
     runtime_library = {
@@ -53,6 +55,16 @@
       else:
         _exec.run("%s -%s -external-runtime %s" % (self.swig_path, lang, out))
 
+      if lang == "ruby" and self.version() >= 103026 and self.version() < 
103028:
+        # SWIG 1.3.26-27 should include rubytracking.swg in their
+        # external runtime, but they don't.
+        runtime = open(out, "r").read()
+        tracking = open("%s/rubytracking.swg" % self.proxy_dir,"r").read()
+        out_file = open(out, "w")
+        out_file.write(tracking)
+        out_file.write(runtime)
+        out_file.close()
+
       # SWIG 1.3.25 and earlier use the wrong number of arguments in calls to
       # SWIG_GetModule. We fix this below.
       if self.version() <= 103025:
Index: build/ac-macros/swig.m4
===================================================================
--- build/ac-macros/swig.m4
+++ build/ac-macros/swig.m4
@@ -74,14 +74,15 @@
     #   packages/rpm/redhat-7.x/subversion.spec
     #   packages/rpm/rhel-3/subversion.spec
     #   packages/rpm/rhel-4/subversion.spec
-    if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" -a \
-               "$SWIG_VERSION" -le "103025"; then
+    if test -n "$SWIG_VERSION" &&
+       test "$SWIG_VERSION" -ge "103024" &&
+       test "$SWIG_VERSION" -le "103028"; then
       SWIG_SUITABLE=yes
     else
       SWIG_SUITABLE=no
       AC_MSG_WARN([Detected SWIG version $SWIG_VERSION_RAW])
-      AC_MSG_WARN([This is not compatible with Subversion])
-      AC_MSG_WARN([Subversion can use SWIG version 1.3.24 or later])
+      AC_MSG_WARN([Subversion requires 1.3.24 or later, and is known to work])
+      AC_MSG_WARN([with versions up to 1.3.28])
     fi
   fi
  
Index: subversion/bindings/swig/core.i
===================================================================
--- subversion/bindings/swig/core.i
+++ subversion/bindings/swig/core.i
@@ -656,23 +656,80 @@
 
 #ifdef SWIGRUBY
 /* Dummy declaration */
-struct apr_pool_t 
+struct apr_pool_wrapper_t
 {
 };
 
 /* Leave memory administration to ruby's GC */
-%extend apr_pool_t
+%extend apr_pool_wrapper_t
 {
-  apr_pool_t(apr_pool_t *parent=NULL, apr_allocator_t *allocator=NULL) {
-    /* Disable parent pool. */
-    return svn_pool_create_ex(NULL, NULL);
+  apr_pool_wrapper_t(apr_pool_wrapper_t *parent) {
+    apr_pool_wrapper_t *self;
+    apr_pool_t *parent_pool;
+
+    self = ALLOC(apr_pool_wrapper_t);
+    if (parent) {
+      parent_pool = parent->pool;
+      APR_ARRAY_PUSH(parent->children, apr_pool_wrapper_t *) = self;
+    } else {
+      parent_pool = NULL;
+    }
+    self->pool = svn_pool_create_ex(parent_pool, NULL);
+    self->destroyed = FALSE;
+    self->parent = parent;
+    self->children = apr_array_make(self->pool, 0,
+                                    sizeof(apr_pool_wrapper_t *));
+    return self;
   }
 
-  ~apr_pool_t() {
-    apr_pool_destroy(self);
+  ~apr_pool_wrapper_t() {
+    if (!self->destroyed) {
+      apr_pool_wrapper_destroy_children(self);
+      apr_pool_wrapper_remove_from_parent(self);
+      apr_pool_destroy(self->pool);
+    }
+    free(self);
   }
 };
 
+%ignore apr_pool_wrapper_destroy_children;
+%ignore apr_pool_wrapper_remove_from_parent;
+%inline %{
+static void
+apr_pool_wrapper_destroy_children(apr_pool_wrapper_t *self)
+{
+  if (!self->destroyed) {
+    apr_pool_wrapper_t **child;
+
+    self->destroyed = TRUE;
+    while (child = apr_array_pop(self->children)) {
+      if (*child) {
+        apr_pool_wrapper_destroy_children(*child);
+      }
+    }
+  }
+}
+
+static void
+apr_pool_wrapper_remove_from_parent(apr_pool_wrapper_t *self)
+{
+  if (self->parent) {
+    apr_pool_wrapper_t *child;
+    int i, len;
+
+    len = self->parent->children->nelts;
+    for (i = 0; i < len; i++) {
+      child = APR_ARRAY_IDX(self->parent->children, i, apr_pool_wrapper_t *);
+      if (child == self) {
+        APR_ARRAY_IDX(self->parent->children, i, apr_pool_wrapper_t *) = NULL;
+        break;
+      }
+    }
+  }
+}
+%}
+
+
 %include svn_diff_h.swg
 
 %inline %{
@@ -687,7 +744,72 @@
 {
   return INT2NUM((int)APR_LOCALE_CHARSET);
 }
-%}
 
-#endif
+/* prompt providers return baton for protecting GC */
+static VALUE
+svn_swig_rb_auth_get_simple_prompt_provider(
+  svn_auth_provider_object_t **provider,
+  svn_auth_simple_prompt_func_t prompt_func,
+  void *prompt_baton,
+  int retry_limit,
+  apr_pool_t *pool)
+{
+  svn_auth_get_simple_prompt_provider(provider, prompt_func, prompt_baton,
+                                      retry_limit, pool);
+  return rb_ary_new3(1, (VALUE)prompt_baton);
+}
 
+static VALUE
+svn_swig_rb_auth_get_ssl_client_cert_prompt_provider(
+  svn_auth_provider_object_t **provider,
+  svn_auth_ssl_client_cert_prompt_func_t prompt_func,
+  void *prompt_baton,
+  int retry_limit,
+  apr_pool_t *pool)
+{
+  svn_auth_get_ssl_client_cert_prompt_provider(provider, prompt_func,
+                                               prompt_baton, retry_limit,
+                                               pool);
+  return rb_ary_new3(1, (VALUE)prompt_baton);
+}
+
+static VALUE
+svn_swig_rb_auth_get_ssl_client_cert_pw_prompt_provider(
+  svn_auth_provider_object_t **provider,
+  svn_auth_ssl_client_cert_pw_prompt_func_t prompt_func,
+  void *prompt_baton,
+  int retry_limit,
+  apr_pool_t *pool)
+{
+  svn_auth_get_ssl_client_cert_pw_prompt_provider(provider, prompt_func,
+                                                  prompt_baton, retry_limit,
+                                                  pool);
+  return rb_ary_new3(1, (VALUE)prompt_baton);
+}
+
+static VALUE
+svn_swig_rb_auth_get_ssl_server_trust_prompt_provider(
+  svn_auth_provider_object_t **provider,
+  svn_auth_ssl_server_trust_prompt_func_t prompt_func,
+  void *prompt_baton,
+  apr_pool_t *pool)
+{
+  svn_auth_get_ssl_server_trust_prompt_provider(provider, prompt_func,
+                                                prompt_baton, pool);
+  return rb_ary_new3(1, (VALUE)prompt_baton);
+}
+
+static VALUE
+svn_swig_rb_auth_get_username_prompt_provider(
+  svn_auth_provider_object_t **provider,
+  svn_auth_username_prompt_func_t prompt_func,
+  void *prompt_baton,
+  int retry_limit,
+  apr_pool_t *pool)
+{
+  svn_auth_get_username_prompt_provider(provider, prompt_func, prompt_baton,
+                                        retry_limit, pool);
+  return rb_ary_new3(1, (VALUE)prompt_baton);
+}
+%}
+#endif
Index: subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
===================================================================
--- subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
+++ subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
@@ -89,6 +89,7 @@
   apr_pool_t *pool;
 } hash_to_apr_hash_data_t;
 
+static void r2c_swig_type2(VALUE value, const char *type_name, void **result);
 
 static VALUE
 rb_ary_aref1(VALUE ary, VALUE arg)
@@ -303,9 +304,9 @@
 }
 
 static VALUE
-rb_pool_new(void)
+rb_pool_new(VALUE parent)
 {
-  return rb_funcall(rb_svn_core_pool(), rb_id_new(), 0);
+  return rb_funcall(rb_svn_core_pool(), rb_id_new(), 1, parent);
 }
 
 static VALUE swig_type_re = Qnil;
@@ -343,41 +344,41 @@
 svn_swig_rb_get_pool(int argc, VALUE *argv, VALUE self,
                      VALUE *rb_pool, apr_pool_t **pool)
 {
+  VALUE target;
+  apr_pool_wrapper_t *pool_wrapper;
+  apr_pool_wrapper_t **pool_wrapper_p;
+  
   *rb_pool = Qnil;
   
   if (argc > 0) {
     if (POOL_P(argv[argc - 1])) {
-      *rb_pool = argv[argc - 1];
+      *rb_pool = rb_pool_new(argv[argc - 1]);
       argc -= 1;
     }
   }
 
+  target = find_swig_type_object(argc, argv);
+  
   if (!NIL_P(self)) {
     *rb_pool = rb_get_pool(self);
-    if (!POOL_P(*rb_pool)) {
+    if (POOL_P(*rb_pool)) {
+      *rb_pool = rb_pool_new(*rb_pool);
+    } else {
       *rb_pool = Qnil;
     }
   }
 
   if (NIL_P(*rb_pool)) {
-    VALUE target = find_swig_type_object(argc, argv);
-    *rb_pool = rb_get_pool(target);
-    if (!POOL_P(*rb_pool)) {
-      *rb_pool = Qnil;
-    }
+    *rb_pool = rb_pool_new(rb_get_pool(target));
   }
-  
-  if (NIL_P(*rb_pool)) {
-    *rb_pool = rb_pool_new();
-    {
-      VALUE target = find_swig_type_object(argc, argv);
-      if (!NIL_P(target)) {
-        rb_set_pool(target, *rb_pool);
-      }
-    }
+
+  if (!NIL_P(target) && !CONTEXT_P(target)) {
+    rb_set_pool(target, *rb_pool);
   }
-  
-  SWIG_ConvertPtr(*rb_pool, (void **)pool, SWIG_TypeQuery("apr_pool_t *"), 1);
+
+  pool_wrapper_p = &pool_wrapper;
+  r2c_swig_type2(*rb_pool, "apr_pool_wrapper_t *", (void **)pool_wrapper_p);
+  *pool = pool_wrapper->pool;
 }
 
 static VALUE
@@ -555,28 +556,42 @@
                                                                              \
   return rb_copied_ ## type;                                                 \
 }                                                                            \
-                                                                             \
+
+#define DEFINE_DUP_BASE_WITH_CONVENIENCE(type, dup_func, type_prefix)        \
+DEFINE_DUP_BASE(type, dup_func, type_prefix)                                 \
 static VALUE                                                                 \
 c2r_ ## type ## __dup(type_prefix svn_ ## type ## _t *type)                  \
 {                                                                            \
   return c2r_ ## type ## _dup((void *)type, NULL);                           \
 }
 
-#define DEFINE_DUP(type, dup_func) DEFINE_DUP_BASE(type, dup_func, const)
-#define DEFINE_DUP2(type) DEFINE_DUP(type, type ## _dup)
-#define DEFINE_DUP_NO_CONST(type, dup_func) DEFINE_DUP_BASE(type, dup_func,)
-#define DEFINE_DUP_NO_CONST2(type) DEFINE_DUP_NO_CONST(type, type ## _dup)
+#define DEFINE_DUP(type, dup_func) \
+  DEFINE_DUP_BASE_WITH_CONVENIENCE(type, dup_func, const)
+#define DEFINE_DUP2(type) \
+  DEFINE_DUP(type, type ## _dup)
+
+#define DEFINE_DUP_NO_CONVENIENCE(type, dup_func) \
+  DEFINE_DUP_BASE(type, dup_func, const)
+#define DEFINE_DUP_NO_CONVENIENCE2(type) \
+  DEFINE_DUP_NO_CONVENIENCE(type, type ## _dup)
+
+#define DEFINE_DUP_NO_CONST(type, dup_func) \
+  DEFINE_DUP_BASE_WITH_CONVENIENCE(type, dup_func,)
+#define DEFINE_DUP_NO_CONST2(type) \
+  DEFINE_DUP_NO_CONST(type, type ## _dup)
+
 
+DEFINE_DUP(wc_notify, wc_dup_notify)
 DEFINE_DUP2(txdelta_window)
 DEFINE_DUP2(info)
 DEFINE_DUP2(lock)
 DEFINE_DUP2(auth_ssl_server_cert_info)
 DEFINE_DUP2(wc_entry)
-DEFINE_DUP2(prop)
-DEFINE_DUP2(client_commit_item2)
-DEFINE_DUP2(client_proplist_item)
-DEFINE_DUP2(wc_external_item)
-DEFINE_DUP(wc_notify, wc_dup_notify)
+DEFINE_DUP_NO_CONVENIENCE2(prop)
+DEFINE_DUP_NO_CONVENIENCE2(client_commit_item2)
+DEFINE_DUP_NO_CONVENIENCE2(client_proplist_item)
+DEFINE_DUP_NO_CONVENIENCE2(wc_external_item)
+DEFINE_DUP_NO_CONVENIENCE2(log_changed_path)
 DEFINE_DUP_NO_CONST(wc_status2, wc_dup_status2)
 
 
@@ -598,11 +613,27 @@
 {
   void **result = NULL;
   result = apr_palloc(pool, sizeof(void *));
-  SWIG_ConvertPtr(value, result, SWIG_TypeQuery((char *)ctx), 1);
+  r2c_swig_type2(value, (const char *)ctx, result);
   return *result;
 }
 #define r2c_swig_type svn_swig_rb_to_swig_type
 
+static void
+r2c_swig_type2(VALUE value, const char *type_name, void **result)
+{
+  int res;
+  res = SWIG_ConvertPtr(value, result, SWIG_TypeQuery(type_name),
+                        SWIG_POINTER_EXCEPTION);
+#ifdef SWIG_IsOK
+  if (!SWIG_IsOK(res)) {
+    VALUE message = rb_funcall(value, rb_intern("inspect"), 0);
+    rb_str_cat2(message, "must be ");
+    rb_str_cat2(message, type_name);
+    SWIG_Error(SWIG_ArgError(res), StringValuePtr(message));
+  }
+#endif
+}
+
 static void *
 r2c_long(VALUE value, void *ctx, apr_pool_t *pool)
 {
@@ -1366,13 +1397,18 @@
   
   if (!NIL_P(proc)) {
     VALUE args;
+    VALUE rb_changed_paths = Qnil;
+
+    if (changed_paths) {
+      rb_changed_paths = c2r_hash(changed_paths,
+                                  c2r_log_changed_path_dup,
+                                  NULL);
+    }
 
     args = rb_ary_new3(7,
                        proc,
                        rb_id_call(),
-                       changed_paths ? 
-                       svn_swig_rb_apr_hash_to_hash_string(changed_paths) :
-                       Qnil,
+                       rb_changed_paths,
                        c2r_long(&revision, NULL),
                        c2r_string2(author),
                        c2r_string2(date),
@@ -2115,8 +2151,7 @@
       void *result_cred = NULL;
       svn_auth_cred_simple_t *tmp_cred = NULL;
       
-      SWIG_ConvertPtr(result, &result_cred,
-                      SWIG_TypeQuery("svn_auth_cred_simple_t *"), 1);
+      r2c_swig_type2(result, "svn_auth_cred_simple_t *", &result_cred);
       tmp_cred = (svn_auth_cred_simple_t *)result_cred;
       new_cred = apr_pcalloc(pool, sizeof (*new_cred));
       new_cred->username = tmp_cred->username ? \
@@ -2159,8 +2194,7 @@
       void *result_cred = NULL;
       svn_auth_cred_username_t *tmp_cred = NULL;
       
-      SWIG_ConvertPtr(result, &result_cred,
-                      SWIG_TypeQuery("svn_auth_cred_username_t *"), 1);
+      r2c_swig_type2(result, "svn_auth_cred_username_t *", &result_cred);
       tmp_cred = (svn_auth_cred_username_t *)result_cred;
       new_cred = apr_pcalloc(pool, sizeof (*new_cred));
       new_cred->username = tmp_cred->username ? \
@@ -2206,8 +2240,8 @@
       void *result_cred;
       svn_auth_cred_ssl_server_trust_t *tmp_cred = NULL;
       
-      SWIG_ConvertPtr(result, &result_cred,
-                      SWIG_TypeQuery("svn_auth_cred_ssl_server_trust_t *"), 1);
+      r2c_swig_type2(result, "svn_auth_cred_ssl_server_trust_t *",
+                     &result_cred);
       tmp_cred = (svn_auth_cred_ssl_server_trust_t *)result_cred;
       new_cred = apr_pcalloc(pool, sizeof (*new_cred));
       *new_cred = *tmp_cred;
@@ -2247,8 +2281,8 @@
       void *result_cred = NULL;
       svn_auth_cred_ssl_client_cert_t *tmp_cred = NULL;
       
-      SWIG_ConvertPtr(result, &result_cred,
-                      SWIG_TypeQuery("svn_auth_cred_ssl_client_cert_t *"), 1);
+      r2c_swig_type2(result, "svn_auth_cred_ssl_client_cert_t *",
+                     &result_cred);
       tmp_cred = (svn_auth_cred_ssl_client_cert_t *)result_cred;
       new_cred = apr_pcalloc(pool, sizeof (*new_cred));
       new_cred->cert_file = tmp_cred->cert_file ? \
@@ -2290,8 +2324,8 @@
       void *result_cred = NULL;
       svn_auth_cred_ssl_client_cert_pw_t *tmp_cred = NULL;
       
-      SWIG_ConvertPtr(result, &result_cred,
-                      SWIG_TypeQuery("svn_auth_cred_ssl_client_cert_pw_t *"), 
1);
+      r2c_swig_type2(result, "svn_auth_cred_ssl_client_cert_pw_t *",
+                     &result_cred);
       tmp_cred = (svn_auth_cred_ssl_client_cert_pw_t *)result_cred;
       new_cred = apr_pcalloc(pool, sizeof (*new_cred));
       new_cred->password = tmp_cred->password ? \
@@ -2354,14 +2388,18 @@
   svn_stream_t *stream;
   
   if (RTEST(rb_funcall(rb_svn_core_stream(), rb_id_eqq(), 1, io))) {
-    SWIG_ConvertPtr(io, (void **)&stream, SWIG_TypeQuery("svn_stream_t *"), 1);
+    svn_stream_t **stream_p;
+    stream_p = &stream;
+    r2c_swig_type2(io, "svn_stream_t *", (void **)stream_p);
   } else {
-    VALUE rb_pool = rb_pool_new();
-    apr_pool_t *pool;
+    VALUE rb_pool = rb_pool_new(Qnil);
+    apr_pool_wrapper_t *pool_wrapper;
+    apr_pool_wrapper_t **pool_wrapper_p;
     
     rb_set_pool(io, rb_pool);
-    SWIG_ConvertPtr(rb_pool, (void **)&pool, SWIG_TypeQuery("apr_pool_t *"), 
1);
-    stream = svn_stream_create((void *)io, pool);
+    pool_wrapper_p = &pool_wrapper;
+    r2c_swig_type2(rb_pool, "apr_pool_wrapper_t *", (void **)pool_wrapper_p);
+    stream = svn_stream_create((void *)io, pool_wrapper->pool);
     svn_stream_set_read(stream, read_handler_rbio);
     svn_stream_set_write(stream, write_handler_rbio);
   }
@@ -2801,13 +2839,10 @@
                                                  void *handler_baton)
 {
   rb_ivar_set(obj, rb_id_handler(),
-              SWIG_NewPointerObj((void *)handler,
-                                 
SWIG_TypeQuery("svn_txdelta_window_handler_t"),
-                                 0));
+              c2r_swig_type((void *)handler,
+                            (void *)"svn_txdelta_window_handler_t"));
   rb_ivar_set(obj, rb_id_handler_baton(),
-              SWIG_NewPointerObj((void *)handler_baton,
-                                 SWIG_TypeQuery("void *"),
-                                 0));
+              c2r_swig_type(handler_baton, (void *)"void *"));
   return obj;
 }
 
@@ -2817,14 +2852,14 @@
                                           apr_pool_t *pool)
 {
   svn_txdelta_window_handler_t handler;
+  svn_txdelta_window_handler_t *handler_p;
   void *handler_baton;
 
-  handler = r2c_swig_type(window_handler,
-                          (void *)"svn_txdelta_window_handler_t",
-                          pool);
-  handler_baton = r2c_swig_type(rb_funcall(window_handler, rb_id_baton(), 0),
-                                (void *)"void *",
-                                pool);
+  handler_p = &handler;
+  r2c_swig_type2(window_handler, "svn_txdelta_window_handler_t",
+                 (void **)handler_p);
+  r2c_swig_type2(rb_funcall(window_handler, rb_id_baton(), 0),
+                 "void *", &handler_baton);
 
   return handler(window, handler_baton);
 }
@@ -2835,14 +2870,14 @@
                                                   apr_pool_t *pool)
 {
   svn_txdelta_window_handler_t handler;
+  svn_txdelta_window_handler_t *handler_p;
   void *handler_baton;
 
-  SWIG_ConvertPtr(rb_ivar_get(obj, rb_id_handler()),
-                  (void **)&handler,
-                  SWIG_TypeQuery("svn_txdelta_window_handler_t"),
-                  1);
-  SWIG_ConvertPtr(rb_ivar_get(obj, rb_id_handler_baton()),
-                  (void **)&handler_baton, SWIG_TypeQuery("void *"), 1);
+  handler_p = &handler;
+  r2c_swig_type2(rb_ivar_get(obj, rb_id_handler()),
+                 "svn_txdelta_window_handler_t", (void **)handler_p);
+  r2c_swig_type2(rb_ivar_get(obj, rb_id_handler_baton()),
+                 "void *", &handler_baton);
 
   return handler(window, handler_baton);
 }
Index: subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h
===================================================================
--- subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h
+++ subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h
@@ -22,7 +22,16 @@
 
 #include <rubyio.h>
 
+typedef struct apr_pool_wrapper_t
+{
+  apr_pool_t *pool;
+  svn_boolean_t destroyed;
+  struct apr_pool_wrapper_t *parent;
+  apr_array_header_t *children;
+} apr_pool_wrapper_t;
+
 void svn_swig_rb_nls_initialize(void);
+void svn_swig_rb_initialize(void);
 
 VALUE svn_swig_rb_svn_delta_editor(void);
 VALUE svn_swig_rb_svn_delta_text_delta_window_handler(void);
Index: subversion/bindings/swig/ruby/svn/core.rb
===================================================================
--- subversion/bindings/swig/ruby/svn/core.rb
+++ subversion/bindings/swig/ruby/svn/core.rb
@@ -83,7 +83,7 @@
     AuthCredSSLServerTrust = AuthCredSslServerTrust
     
     
-    Pool = Svn::Ext::Core::Apr_pool_t
+    Pool = Svn::Ext::Core::Apr_pool_wrapper_t
     
     class Pool
       class << self
@@ -91,6 +91,13 @@
           ObjectSpace.each_object(Pool) {}
         end
       end
+
+      alias _initialize initialize
+      private :_initialize
+      def initialize(parent=nil)
+        _initialize(parent)
+        @parent = parent
+      end
     end
 
     Stream = SWIG::TYPE_p_svn_stream_t
Index: subversion/bindings/swig/ruby/test/test_client.rb
===================================================================
--- subversion/bindings/swig/ruby/test/test_client.rb
+++ subversion/bindings/swig/ruby/test/test_client.rb
@@ -240,15 +240,17 @@
     ctx.commit(@wc_path)
 
     File.open(path, "w") {|f| f.print(src * 2)}
-    assert_raises(Svn::Error::CLIENT_MODIFIED) do
-      ctx.delete(path)
-    end
-    assert_raises(Svn::Error::WC_LOCKED) do
+    gc_disable do
+      assert_raises(Svn::Error::CLIENT_MODIFIED) do
+        ctx.delete(path)
+      end
+      assert_raises(Svn::Error::WC_LOCKED) do
+        ctx.delete(path, true)
+      end
+      ctx.cleanup(@wc_path)
       ctx.delete(path, true)
+      ctx.commit(@wc_path)
     end
-    ctx.cleanup(@wc_path)
-    ctx.delete(path, true)
-    ctx.commit(@wc_path)
     assert(!File.exist?(path))
   end
  
@@ -278,15 +280,17 @@
     ctx.commit(@wc_path)
 
     File.open(path, "w") {|f| f.print(src * 2)}
-    assert_raises(Svn::Error::CLIENT_MODIFIED) do
-      ctx.rm(path)
-    end
-    assert_raises(Svn::Error::WC_LOCKED) do
+    gc_disable do
+      assert_raises(Svn::Error::CLIENT_MODIFIED) do
+        ctx.rm(path)
+      end
+      assert_raises(Svn::Error::WC_LOCKED) do
+        ctx.rm_f(path)
+      end
+      ctx.cleanup(@wc_path)
       ctx.rm_f(path)
+      ctx.commit(@wc_path)
     end
-    ctx.cleanup(@wc_path)
-    ctx.rm_f(path)
-    ctx.commit(@wc_path)
     assert(!File.exist?(path))
 
     File.open(path, "w") {|f| f.print(src)}
@@ -771,30 +775,32 @@
 
     ctx.up(@wc_path, rev - 1)
     File.open(path, "w") {|f| f.print(src)}
-    assert_raise(Svn::Error::WC_OBSTRUCTED_UPDATE) do
-      ctx.up(@wc_path, rev)
-    end
-
-    assert_raise(Svn::Error::WC_LOCKED) do
-      ctx.commit(@wc_path)
-    end
+    
+    gc_disable do
+      assert_raise(Svn::Error::WC_OBSTRUCTED_UPDATE) do
+        ctx.up(@wc_path, rev)
+      end
+      assert_raise(Svn::Error::WC_LOCKED) do
+        ctx.commit(@wc_path)
+      end
 
-    ctx.set_cancel_func do
-      raise Svn::Error::CANCELLED
-    end
-    assert_raise(Svn::Error::CANCELLED) do
-      ctx.cleanup(@wc_path)
-    end
-    assert_raise(Svn::Error::WC_LOCKED) do
-      ctx.commit(@wc_path)
-    end
+      ctx.set_cancel_func do
+        raise Svn::Error::CANCELLED
+      end
+      assert_raise(Svn::Error::CANCELLED) do
+        ctx.cleanup(@wc_path)
+      end
+      assert_raise(Svn::Error::WC_LOCKED) do
+        ctx.commit(@wc_path)
+      end
 
-    ctx.set_cancel_func(nil)
-    assert_nothing_raised do
-      ctx.cleanup(@wc_path)
-    end
-    assert_nothing_raised do
-      ctx.commit(@wc_path)
+      ctx.set_cancel_func(nil)
+      assert_nothing_raised do
+        ctx.cleanup(@wc_path)
+      end
+      assert_nothing_raised do
+        ctx.commit(@wc_path)
+      end
     end
   end
 
Index: subversion/bindings/swig/ruby/test/test_core.rb
===================================================================
--- subversion/bindings/swig/ruby/test/test_core.rb
+++ subversion/bindings/swig/ruby/test/test_core.rb
@@ -16,7 +16,6 @@
   end
 
   def teardown
-    GC.enable
     teardown_repository(@repos_path)
     teardown_config
   end
@@ -118,28 +117,29 @@
   end
   
   def test_pool_GC
-    GC.disable
-
-    made_number_of_pool = 100
-    pools = []
+    gc_disable do
+      made_number_of_pool = 100
+      pools = []
     
-    gc
-    before_number_of_pools = Svn::Core::Pool.number_of_pools
-    made_number_of_pool.times do
-      pools << used_pool
-    end
-    gc
-    current_number_of_pools = Svn::Core::Pool.number_of_pools
-    created_number_of_pools = current_number_of_pools - before_number_of_pools
-    assert_operator(made_number_of_pool, :<=, current_number_of_pools)
-
-    gc
-    pools.clear
-    before_number_of_pools = Svn::Core::Pool.number_of_pools
-    gc
-    current_number_of_pools = Svn::Core::Pool.number_of_pools
-    recycled_number_of_pools = before_number_of_pools - current_number_of_pools
-    assert_operator(made_number_of_pool * 0.8, :<=, recycled_number_of_pools)
+      gc
+      before_number_of_pools = Svn::Core::Pool.number_of_pools
+      made_number_of_pool.times do
+        pools << used_pool
+      end
+      gc
+      current_number_of_pools = Svn::Core::Pool.number_of_pools
+      created_number_of_pools = current_number_of_pools - 
before_number_of_pools
+      assert_operator(made_number_of_pool, :<=, current_number_of_pools)
+      
+      gc
+      pools.clear
+      before_number_of_pools = Svn::Core::Pool.number_of_pools
+      gc
+      current_number_of_pools = Svn::Core::Pool.number_of_pools
+      recycled_number_of_pools =
+        before_number_of_pools - current_number_of_pools
+      assert_operator(made_number_of_pool * 0.8, :<=, recycled_number_of_pools)
+    end
   end
 
   def test_config
@@ -350,8 +350,8 @@
   end
 
   def gc
-    before_disabled = GC.enable
-    GC.start
-    GC.disable if before_disabled
+    gc_enable do
+      GC.start
+    end
   end
 end
Index: subversion/bindings/swig/ruby/test/test_repos.rb
===================================================================
--- subversion/bindings/swig/ruby/test/test_repos.rb
+++ subversion/bindings/swig/ruby/test/test_repos.rb
@@ -111,6 +111,13 @@
     end_rev = info3.revision
 
     logs = @repos.logs(file, start_rev, end_rev, end_rev - start_rev + 1)
+    logs = logs.collect do |changed_paths, revision, author, date, message|
+      paths = {}
+      changed_paths.each do |key, changed_path|
+        paths[key] = changed_path.action
+      end
+      [paths, revision, author, date, message]
+    end
     assert_equal([
                    [
                      {"/#{file}" => "A"},
Index: subversion/bindings/swig/ruby/test/test_wc.rb
===================================================================
--- subversion/bindings/swig/ruby/test/test_wc.rb
+++ subversion/bindings/swig/ruby/test/test_wc.rb
@@ -321,11 +321,25 @@
 
     assert(!Svn::Wc.locked?(@wc_path))
     ctx = make_context(log)
-    assert_raise(Svn::Error::FS_NO_SUCH_REVISION) do
-      ctx.update(@wc_path, youngest_rev + 1)
+
+    gc_disable do
+      assert_raise(Svn::Error::FS_NO_SUCH_REVISION) do
+        ctx.update(@wc_path, youngest_rev + 1)
+      end
+      assert(Svn::Wc.locked?(@wc_path))
+    end
+    gc_enable do
+      GC.start
+      assert(!Svn::Wc.locked?(@wc_path))
+    end
+    
+    gc_disable do
+      assert_raise(Svn::Error::FS_NO_SUCH_REVISION) do
+        ctx.update(@wc_path, youngest_rev + 1)
+      end
+      assert(Svn::Wc.locked?(@wc_path))
+      ctx.cleanup(@wc_path)
+      assert(!Svn::Wc.locked?(@wc_path))
     end
-    assert(Svn::Wc.locked?(@wc_path))
-    ctx.cleanup(@wc_path)
-    assert(!Svn::Wc.locked?(@wc_path))
   end
 end
Index: subversion/bindings/swig/ruby/test/util.rb
===================================================================
--- subversion/bindings/swig/ruby/test/util.rb
+++ subversion/bindings/swig/ruby/test/util.rb
@@ -50,6 +50,26 @@
     end
   end
 
+  def change_gc_status(prev_disabled)
+    begin
+      yield
+    ensure
+      if prev_disabled
+        GC.disable
+      else
+        GC.enable
+      end
+    end
+  end
+  
+  def gc_disable(&block)
+    change_gc_status(GC.disable, &block)
+  end
+
+  def gc_enable(&block)
+    change_gc_status(GC.enable, &block)
+  end
+
   def setup_tmp([EMAIL PROTECTED])
     FileUtils.rm_rf(path)
     FileUtils.mkdir_p(path)
@@ -201,5 +221,4 @@
     auth_baton[Svn::Core::AUTH_PARAM_CONFIG_DIR] = @config_path
     auth_baton[Svn::Core::AUTH_PARAM_DEFAULT_USERNAME] = @author
   end
-  
 end
Index: subversion/bindings/swig/svn_client.i
===================================================================
--- subversion/bindings/swig/svn_client.i
+++ subversion/bindings/swig/svn_client.i
@@ -485,7 +485,7 @@
 
 #ifdef SWIGRUBY
 %inline %{
-static void
+static VALUE
 svn_client_set_log_msg_func2(svn_client_ctx_t *ctx,
                              svn_client_get_commit_log2_t log_msg_func2,
                              void *log_msg_baton2,
@@ -493,9 +493,10 @@
 {
   ctx->log_msg_func2 = log_msg_func2;
   ctx->log_msg_baton2 = log_msg_baton2;
+  return (VALUE)log_msg_baton2;
 }
  
-static void
+static VALUE
 svn_client_set_notify_func2(svn_client_ctx_t *ctx,
                             svn_wc_notify_func2_t notify_func2,
                             void *notify_baton2,
@@ -503,9 +504,10 @@
 {
   ctx->notify_func2 = notify_func2;
   ctx->notify_baton2 = notify_baton2;
+  return (VALUE)notify_baton2;
 }
 
-static void
+static VALUE
 svn_client_set_cancel_func(svn_client_ctx_t *ctx,
                            svn_cancel_func_t cancel_func,
                            void *cancel_baton,
@@ -513,6 +515,7 @@
 {
   ctx->cancel_func = cancel_func;
   ctx->cancel_baton = cancel_baton;
+  return (VALUE)cancel_baton;
 }
 %}
 #endif

Attachment: signature.asc
Description: Digital signature

Reply via email to