You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jim Searle <ji...@gmail.com> on 2012/03/22 00:03:05 UTC

Using info2 in perl

I am currently using the perl api info and diff_summarize methods, but
I need to switch to info2 and diff_summarize2 since they support the
'depth' option.  But I can't figure out the correct syntax, does
anyone have an example?

Thanks,
Jim

Re: Using info2 in perl

Posted by Daniel Shahaf <da...@elego.de>.
Daniel Shahaf wrote on Tue, Apr 24, 2012 at 01:34:16 +0300:
> (Obligatory invitation for you to want to write a patch that exposes
> svn_wc_status_func2_t to the Perl bindings goes here.)

And thanks, etc.  I'm just a bit too tired for the full boilerplate
right now :-/

> 
> http://subversion.apache.org/patches
> 
> Jim Searle wrote on Mon, Apr 23, 2012 at 11:42:33 -0700:
> > Thanks.  Yes, it does look like svn_wc_status_func_t is ifdef'ed out
> > for perl bindings.  So, I assumed it was an issue with the perl
> > bindings, and reported it to Alien-SVN, but I was told it needs to be
> > reported to subversion.
> > 
> > I tried to find if this is a known issue, but can not seem to find
> > one.  The closest I found was:
> > http://subversion.tigris.org/issues/show_bug.cgi?id=2646
> > But that only implements exporting of the functions.  So I filed a new issue:
> > http://subversion.tigris.org/issues/show_bug.cgi?id=4165
> > 
> > - Jim
> > 
> > On Fri, Apr 20, 2012 at 2:39 PM, Daniel Shahaf <da...@elego.de> wrote:
> > > Hmm.  A quick glance at subversion/bindings/swig/svn_wc.i tells me that
> > > perhaps svn_wc_status_func2_t aren't supported by the Perl bindings?
> > > (notice the pattern of #ifndef's around svn_wc_status_func_t and
> > > svn_wc_status_func2_t)
> > >
> > > Jim Searle wrote on Fri, Apr 20, 2012 at 14:21:52 -0700:
> > >> I was able to get info2 working with Daniel's suggestion, but now I
> > >> can not get status3 to work.
> > >>
> > >> For the code below I get this error when it tries to run status3:
> > >> TypeError in method 'svn_client_status3', argument 4 of type
> > >> 'svn_wc_status_func2_t'
> > >>
> > >> Seems like it wants me to typecast the subroutine, but not sure how to do that?
> > >>
> > >> $s = SVN::Client->new();
> > >> # Standard status
> > >> print "Using status:\n";
> > >> $s->status("", undef,
> > >>            sub{($path, $status) = @_;
> > >>                print "$path,$status\n" },
> > >>            1, 1, 1, 0);
> > >>
> > >> print "\n\nUsing status3:\n";
> > >> $s->status3( "", undef,
> > >>              sub{($path, $status) = @_;
> > >>                  print "$path,$status\n" },
> > >>              $SVN::Core::depth_immediates, 1, 1, 0, 1, undef );
> > >>
> > >> Thanks,
> > >> Jim
> > >>
> > >> On Wed, Mar 21, 2012 at 5:14 PM, Daniel Shahaf <da...@elego.de> wrote:
> > >> > Jim Searle wrote on Wed, Mar 21, 2012 at 16:03:05 -0700:
> > >> >> I am currently using the perl api info and diff_summarize methods, but
> > >> >> I need to switch to info2 and diff_summarize2 since they support the
> > >> >> 'depth' option.  But I can't figure out the correct syntax, does
> > >> >> anyone have an example?
> > >> >>
> > >> >
> > >> > % perl -MSVN::Client -le '$s = SVN::Client->new();
> > >> >                          $s->info2( "", 1,"HEAD",
> > >> >                                     sub{($target, $info_t, $pool) = @_;
> > >> >                                         print "$target: ", $info_t->URL },
> > >> >                                     $SVN::Core::depth_infinity, undef )'
> > >> > A: file:///tmp/svn/r1/trunk/A
> > >> > A/B: file:///tmp/svn/r1/trunk/A/B
> > >> > ...
> > >> > A/D/H/psi: file:///tmp/svn/r1/trunk/A/D/H/psi
> > >> > iota: file:///tmp/svn/r1/trunk/iota
> > >> >
> > >> > How I built this:
> > >> >
> > >> > - Follow the docs of the svn_client_info2() C API (in doxygen, or in svn_client.h)
> > >> >
> > >> > - Drop the ctx parameter
> > >> >
> > >> > - Drop any baton parameters
> > >> >
> > >> > - When in doubt about some object --- print it.  ref() and Dumper() help too.
> > >> >
> > >> > HTH,
> > >> >
> > >> > Daniel
> > >> >
> > >> >> Thanks,
> > >> >> Jim

Re: Using info2 in perl

Posted by Daniel Shahaf <da...@elego.de>.
(Obligatory invitation for you to want to write a patch that exposes
svn_wc_status_func2_t to the Perl bindings goes here.)

http://subversion.apache.org/patches

Jim Searle wrote on Mon, Apr 23, 2012 at 11:42:33 -0700:
> Thanks.  Yes, it does look like svn_wc_status_func_t is ifdef'ed out
> for perl bindings.  So, I assumed it was an issue with the perl
> bindings, and reported it to Alien-SVN, but I was told it needs to be
> reported to subversion.
> 
> I tried to find if this is a known issue, but can not seem to find
> one.  The closest I found was:
> http://subversion.tigris.org/issues/show_bug.cgi?id=2646
> But that only implements exporting of the functions.  So I filed a new issue:
> http://subversion.tigris.org/issues/show_bug.cgi?id=4165
> 
> - Jim
> 
> On Fri, Apr 20, 2012 at 2:39 PM, Daniel Shahaf <da...@elego.de> wrote:
> > Hmm.  A quick glance at subversion/bindings/swig/svn_wc.i tells me that
> > perhaps svn_wc_status_func2_t aren't supported by the Perl bindings?
> > (notice the pattern of #ifndef's around svn_wc_status_func_t and
> > svn_wc_status_func2_t)
> >
> > Jim Searle wrote on Fri, Apr 20, 2012 at 14:21:52 -0700:
> >> I was able to get info2 working with Daniel's suggestion, but now I
> >> can not get status3 to work.
> >>
> >> For the code below I get this error when it tries to run status3:
> >> TypeError in method 'svn_client_status3', argument 4 of type
> >> 'svn_wc_status_func2_t'
> >>
> >> Seems like it wants me to typecast the subroutine, but not sure how to do that?
> >>
> >> $s = SVN::Client->new();
> >> # Standard status
> >> print "Using status:\n";
> >> $s->status("", undef,
> >>            sub{($path, $status) = @_;
> >>                print "$path,$status\n" },
> >>            1, 1, 1, 0);
> >>
> >> print "\n\nUsing status3:\n";
> >> $s->status3( "", undef,
> >>              sub{($path, $status) = @_;
> >>                  print "$path,$status\n" },
> >>              $SVN::Core::depth_immediates, 1, 1, 0, 1, undef );
> >>
> >> Thanks,
> >> Jim
> >>
> >> On Wed, Mar 21, 2012 at 5:14 PM, Daniel Shahaf <da...@elego.de> wrote:
> >> > Jim Searle wrote on Wed, Mar 21, 2012 at 16:03:05 -0700:
> >> >> I am currently using the perl api info and diff_summarize methods, but
> >> >> I need to switch to info2 and diff_summarize2 since they support the
> >> >> 'depth' option.  But I can't figure out the correct syntax, does
> >> >> anyone have an example?
> >> >>
> >> >
> >> > % perl -MSVN::Client -le '$s = SVN::Client->new();
> >> >                          $s->info2( "", 1,"HEAD",
> >> >                                     sub{($target, $info_t, $pool) = @_;
> >> >                                         print "$target: ", $info_t->URL },
> >> >                                     $SVN::Core::depth_infinity, undef )'
> >> > A: file:///tmp/svn/r1/trunk/A
> >> > A/B: file:///tmp/svn/r1/trunk/A/B
> >> > ...
> >> > A/D/H/psi: file:///tmp/svn/r1/trunk/A/D/H/psi
> >> > iota: file:///tmp/svn/r1/trunk/iota
> >> >
> >> > How I built this:
> >> >
> >> > - Follow the docs of the svn_client_info2() C API (in doxygen, or in svn_client.h)
> >> >
> >> > - Drop the ctx parameter
> >> >
> >> > - Drop any baton parameters
> >> >
> >> > - When in doubt about some object --- print it.  ref() and Dumper() help too.
> >> >
> >> > HTH,
> >> >
> >> > Daniel
> >> >
> >> >> Thanks,
> >> >> Jim

Re: Using info2 in perl

Posted by Jim Searle <ji...@gmail.com>.
Thanks.  Yes, it does look like svn_wc_status_func_t is ifdef'ed out
for perl bindings.  So, I assumed it was an issue with the perl
bindings, and reported it to Alien-SVN, but I was told it needs to be
reported to subversion.

I tried to find if this is a known issue, but can not seem to find
one.  The closest I found was:
http://subversion.tigris.org/issues/show_bug.cgi?id=2646
But that only implements exporting of the functions.  So I filed a new issue:
http://subversion.tigris.org/issues/show_bug.cgi?id=4165

- Jim

On Fri, Apr 20, 2012 at 2:39 PM, Daniel Shahaf <da...@elego.de> wrote:
> Hmm.  A quick glance at subversion/bindings/swig/svn_wc.i tells me that
> perhaps svn_wc_status_func2_t aren't supported by the Perl bindings?
> (notice the pattern of #ifndef's around svn_wc_status_func_t and
> svn_wc_status_func2_t)
>
> Jim Searle wrote on Fri, Apr 20, 2012 at 14:21:52 -0700:
>> I was able to get info2 working with Daniel's suggestion, but now I
>> can not get status3 to work.
>>
>> For the code below I get this error when it tries to run status3:
>> TypeError in method 'svn_client_status3', argument 4 of type
>> 'svn_wc_status_func2_t'
>>
>> Seems like it wants me to typecast the subroutine, but not sure how to do that?
>>
>> $s = SVN::Client->new();
>> # Standard status
>> print "Using status:\n";
>> $s->status("", undef,
>>            sub{($path, $status) = @_;
>>                print "$path,$status\n" },
>>            1, 1, 1, 0);
>>
>> print "\n\nUsing status3:\n";
>> $s->status3( "", undef,
>>              sub{($path, $status) = @_;
>>                  print "$path,$status\n" },
>>              $SVN::Core::depth_immediates, 1, 1, 0, 1, undef );
>>
>> Thanks,
>> Jim
>>
>> On Wed, Mar 21, 2012 at 5:14 PM, Daniel Shahaf <da...@elego.de> wrote:
>> > Jim Searle wrote on Wed, Mar 21, 2012 at 16:03:05 -0700:
>> >> I am currently using the perl api info and diff_summarize methods, but
>> >> I need to switch to info2 and diff_summarize2 since they support the
>> >> 'depth' option.  But I can't figure out the correct syntax, does
>> >> anyone have an example?
>> >>
>> >
>> > % perl -MSVN::Client -le '$s = SVN::Client->new();
>> >                          $s->info2( "", 1,"HEAD",
>> >                                     sub{($target, $info_t, $pool) = @_;
>> >                                         print "$target: ", $info_t->URL },
>> >                                     $SVN::Core::depth_infinity, undef )'
>> > A: file:///tmp/svn/r1/trunk/A
>> > A/B: file:///tmp/svn/r1/trunk/A/B
>> > ...
>> > A/D/H/psi: file:///tmp/svn/r1/trunk/A/D/H/psi
>> > iota: file:///tmp/svn/r1/trunk/iota
>> >
>> > How I built this:
>> >
>> > - Follow the docs of the svn_client_info2() C API (in doxygen, or in svn_client.h)
>> >
>> > - Drop the ctx parameter
>> >
>> > - Drop any baton parameters
>> >
>> > - When in doubt about some object --- print it.  ref() and Dumper() help too.
>> >
>> > HTH,
>> >
>> > Daniel
>> >
>> >> Thanks,
>> >> Jim

Re: Using info2 in perl

Posted by Daniel Shahaf <da...@elego.de>.
Hmm.  A quick glance at subversion/bindings/swig/svn_wc.i tells me that
perhaps svn_wc_status_func2_t aren't supported by the Perl bindings?
(notice the pattern of #ifndef's around svn_wc_status_func_t and
svn_wc_status_func2_t)

Jim Searle wrote on Fri, Apr 20, 2012 at 14:21:52 -0700:
> I was able to get info2 working with Daniel's suggestion, but now I
> can not get status3 to work.
> 
> For the code below I get this error when it tries to run status3:
> TypeError in method 'svn_client_status3', argument 4 of type
> 'svn_wc_status_func2_t'
> 
> Seems like it wants me to typecast the subroutine, but not sure how to do that?
> 
> $s = SVN::Client->new();
> # Standard status
> print "Using status:\n";
> $s->status("", undef,
>            sub{($path, $status) = @_;
>                print "$path,$status\n" },
>            1, 1, 1, 0);
> 
> print "\n\nUsing status3:\n";
> $s->status3( "", undef,
>              sub{($path, $status) = @_;
>                  print "$path,$status\n" },
>              $SVN::Core::depth_immediates, 1, 1, 0, 1, undef );
> 
> Thanks,
> Jim
> 
> On Wed, Mar 21, 2012 at 5:14 PM, Daniel Shahaf <da...@elego.de> wrote:
> > Jim Searle wrote on Wed, Mar 21, 2012 at 16:03:05 -0700:
> >> I am currently using the perl api info and diff_summarize methods, but
> >> I need to switch to info2 and diff_summarize2 since they support the
> >> 'depth' option.  But I can't figure out the correct syntax, does
> >> anyone have an example?
> >>
> >
> > % perl -MSVN::Client -le '$s = SVN::Client->new();
> >                          $s->info2( "", 1,"HEAD",
> >                                     sub{($target, $info_t, $pool) = @_;
> >                                         print "$target: ", $info_t->URL },
> >                                     $SVN::Core::depth_infinity, undef )'
> > A: file:///tmp/svn/r1/trunk/A
> > A/B: file:///tmp/svn/r1/trunk/A/B
> > ...
> > A/D/H/psi: file:///tmp/svn/r1/trunk/A/D/H/psi
> > iota: file:///tmp/svn/r1/trunk/iota
> >
> > How I built this:
> >
> > - Follow the docs of the svn_client_info2() C API (in doxygen, or in svn_client.h)
> >
> > - Drop the ctx parameter
> >
> > - Drop any baton parameters
> >
> > - When in doubt about some object --- print it.  ref() and Dumper() help too.
> >
> > HTH,
> >
> > Daniel
> >
> >> Thanks,
> >> Jim

Re: Using info2 in perl

Posted by Jim Searle <ji...@gmail.com>.
I was able to get info2 working with Daniel's suggestion, but now I
can not get status3 to work.

For the code below I get this error when it tries to run status3:
TypeError in method 'svn_client_status3', argument 4 of type
'svn_wc_status_func2_t'

Seems like it wants me to typecast the subroutine, but not sure how to do that?

$s = SVN::Client->new();
# Standard status
print "Using status:\n";
$s->status("", undef,
           sub{($path, $status) = @_;
               print "$path,$status\n" },
           1, 1, 1, 0);

print "\n\nUsing status3:\n";
$s->status3( "", undef,
             sub{($path, $status) = @_;
                 print "$path,$status\n" },
             $SVN::Core::depth_immediates, 1, 1, 0, 1, undef );

Thanks,
Jim

On Wed, Mar 21, 2012 at 5:14 PM, Daniel Shahaf <da...@elego.de> wrote:
> Jim Searle wrote on Wed, Mar 21, 2012 at 16:03:05 -0700:
>> I am currently using the perl api info and diff_summarize methods, but
>> I need to switch to info2 and diff_summarize2 since they support the
>> 'depth' option.  But I can't figure out the correct syntax, does
>> anyone have an example?
>>
>
> % perl -MSVN::Client -le '$s = SVN::Client->new();
>                          $s->info2( "", 1,"HEAD",
>                                     sub{($target, $info_t, $pool) = @_;
>                                         print "$target: ", $info_t->URL },
>                                     $SVN::Core::depth_infinity, undef )'
> A: file:///tmp/svn/r1/trunk/A
> A/B: file:///tmp/svn/r1/trunk/A/B
> ...
> A/D/H/psi: file:///tmp/svn/r1/trunk/A/D/H/psi
> iota: file:///tmp/svn/r1/trunk/iota
>
> How I built this:
>
> - Follow the docs of the svn_client_info2() C API (in doxygen, or in svn_client.h)
>
> - Drop the ctx parameter
>
> - Drop any baton parameters
>
> - When in doubt about some object --- print it.  ref() and Dumper() help too.
>
> HTH,
>
> Daniel
>
>> Thanks,
>> Jim

Re: Using info2 in perl

Posted by Daniel Shahaf <da...@elego.de>.
Jim Searle wrote on Wed, Mar 21, 2012 at 16:03:05 -0700:
> I am currently using the perl api info and diff_summarize methods, but
> I need to switch to info2 and diff_summarize2 since they support the
> 'depth' option.  But I can't figure out the correct syntax, does
> anyone have an example?
> 

% perl -MSVN::Client -le '$s = SVN::Client->new();
                          $s->info2( "", 1,"HEAD",
                                     sub{($target, $info_t, $pool) = @_; 
                                         print "$target: ", $info_t->URL },
                                     $SVN::Core::depth_infinity, undef )'
A: file:///tmp/svn/r1/trunk/A
A/B: file:///tmp/svn/r1/trunk/A/B
...
A/D/H/psi: file:///tmp/svn/r1/trunk/A/D/H/psi
iota: file:///tmp/svn/r1/trunk/iota

How I built this:

- Follow the docs of the svn_client_info2() C API (in doxygen, or in svn_client.h)

- Drop the ctx parameter

- Drop any baton parameters

- When in doubt about some object --- print it.  ref() and Dumper() help too.

HTH,

Daniel

> Thanks,
> Jim