You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Joe Swatosh <jo...@gmail.com> on 2007/04/11 06:42:26 UTC

Re: svn commit: r24322 - trunk/subversion/bindings/swig/ruby/svn

Hi kou,

It took me a while to track this one down.  Without this patch I'm
essentially unable
to run the bindings tests at all.  Lots of errors trying to convert
nil to a string.

I just put this typemap in with the others I found.  Is it the best
place, or is there somewhere better?

--
Joe

[[[
* subversion/bindings/swig/svn_client.i
  Allow nil to be passed as changelist_name argument
]]]

Index: subversion/bindings/swig/svn_client.i
===================================================================
--- subversion/bindings/swig/svn_client.i       (revision 24525)
+++ subversion/bindings/swig/svn_client.i       (working copy)
@@ -116,6 +116,16 @@
 #endif

 #ifdef SWIGRUBY
+
+/* Allow nil to be passed as changelist_name argument */
+%typemap(in) const char *changelist_name {
+  if (NIL_P($input)) {
+    $1 = NULL;
+  } else {
+    $1 = StringValuePtr($input);
+  }
+}
+
 %typemap(argout) apr_array_header_t **props {
   %append_output(svn_swig_rb_apr_array_to_array_proplist_item(*$1));
 }


On 4/1/07, kou@tigris.org <ko...@tigris.org> wrote:
> Author: kou
> Date: Sun Apr  1 21:56:04 2007
> New Revision: 24322
>
> Log:
> Support svn_client_commit4().
>
> * subversion/bindings/swig/ruby/svn/client.rb
>  (Svn::Client::Context#commit): Use Svn::Client.commit4 instead
>  of Svn::Client.commit3.
>
>
> Modified:
>   trunk/subversion/bindings/swig/ruby/svn/client.rb
>
> Modified: trunk/subversion/bindings/swig/ruby/svn/client.rb
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/bindings/swig/ruby/svn/client.rb?pathrev=24322&r1=24321&r2=24322
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r24322 - trunk/subversion/bindings/swig/ruby/svn

Posted by Joe Swatosh <jo...@gmail.com>.
Hi kou,

On 4/11/07, Kouhei Sutou <ko...@cozmixng.org> wrote:
> Hi Joe,
>
> 2007/4/12, Joe Swatosh <jo...@gmail.com>:
>
> > >

> > >


> Oh, I'm sorry. Could you commit the patch?
> And could you add the following %apply in #ifdef SWIGRUBY?
>
>  %apply const char *NOT_NULL {
>    const char *changelist_name
>  };
>

Done in r24543.

Thanks,
--
Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r24322 - trunk/subversion/bindings/swig/ruby/svn

Posted by Kouhei Sutou <ko...@cozmixng.org>.
Hi Joe,

2007/4/12, Joe Swatosh <jo...@gmail.com>:

> > Uhm. The typemap affects all 'changelist_name' but there are some
> > non-NULL 'changelist_name' argument.
> > (e.g. svn_client_get_changelist)
> >
> > What about this?
> >
>
> Almost.  I needed to add:
>
> %ignore svn_client_commit4;
>
> To get it working.

Oh, I'm sorry. Could you commit the patch?
And could you add the following %apply in #ifdef SWIGRUBY?

  %apply const char *NOT_NULL {
    const char *changelist_name
  };


Thanks,
--
kou

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r24322 - trunk/subversion/bindings/swig/ruby/svn

Posted by Joe Swatosh <jo...@gmail.com>.
Hi kou,

On 4/11/07, Kouhei Sutou <ko...@cozmixng.org> wrote:
> Hi Joe,
>
> 2007/4/11, Joe Swatosh <jo...@gmail.com>:
>
> > It took me a while to track this one down.  Without this patch I'm


>
> Uhm. The typemap affects all 'changelist_name' but there are some
> non-NULL 'changelist_name' argument.
> (e.g. svn_client_get_changelist)
>
> What about this?
>

Almost.  I needed to add:

%ignore svn_client_commit4;

To get it working.

Thanks!
--
Joe

Re: svn commit: r24322 - trunk/subversion/bindings/swig/ruby/svn

Posted by Kouhei Sutou <ko...@cozmixng.org>.
Hi Joe,

2007/4/11, Joe Swatosh <jo...@gmail.com>:

> It took me a while to track this one down.  Without this patch I'm
> essentially unable
> to run the bindings tests at all.  Lots of errors trying to convert
> nil to a string.

The problem isn't ocuured on my environment because default string
convert typemap of my SWIG (1.3.31) accepts nil.

> I just put this typemap in with the others I found.  Is it the best
> place, or is there somewhere better?

Uhm. The typemap affects all 'changelist_name' but there are some
non-NULL 'changelist_name' argument.
(e.g. svn_client_get_changelist)

What about this?

Thanks,
--
kou



> Index: subversion/bindings/swig/svn_client.i
> ===================================================================
> --- subversion/bindings/swig/svn_client.i       (revision 24525)
> +++ subversion/bindings/swig/svn_client.i       (working copy)
> @@ -116,6 +116,16 @@
>  #endif
>
>  #ifdef SWIGRUBY
> +
> +/* Allow nil to be passed as changelist_name argument */
> +%typemap(in) const char *changelist_name {
> +  if (NIL_P($input)) {
> +    $1 = NULL;
> +  } else {
> +    $1 = StringValuePtr($input);
> +  }
> +}
> +
>  %typemap(argout) apr_array_header_t **props {
>    %append_output(svn_swig_rb_apr_array_to_array_proplist_item(*$1));
>  }
>
>
> On 4/1/07, kou@tigris.org <ko...@tigris.org> wrote:
> > Author: kou
> > Date: Sun Apr  1 21:56:04 2007
> > New Revision: 24322
> >
> > Log:
> > Support svn_client_commit4().
> >
> > * subversion/bindings/swig/ruby/svn/client.rb
> >  (Svn::Client::Context#commit): Use Svn::Client.commit4 instead
> >  of Svn::Client.commit3.
> >
> >
> > Modified:
> >   trunk/subversion/bindings/swig/ruby/svn/client.rb
> >
> > Modified: trunk/subversion/bindings/swig/ruby/svn/client.rb
> > URL: http://svn.collab.net/viewvc/svn/trunk/subversion/bindings/swig/ruby/svn/client.rb?pathrev=24322&r1=24321&r2=24322
> >
>