Re: SVN::Client::log() first argument Re: svn commit: r1729519 - /subversion/trunk/tools/client-side/svn-graph.pl

2016-02-15 Thread James McCoy
On Mon, Feb 15, 2016 at 11:54:39AM +0100, Bert Huijben wrote:
> > -Original Message-
> > From: James McCoy [mailto:vega.ja...@gmail.com] On Behalf Of James
> > McCoy
> > Sent: zondag 14 februari 2016 19:20
> > To: Daniel Shahaf <d...@daniel.shahaf.name>
> > Cc: dev@subversion.apache.org
> > Subject: Re: SVN::Client::log() first argument Re: svn commit: r1729519 -
> > /subversion/trunk/tools/client-side/svn-graph.pl
> > 
> > On Sun, Feb 14, 2016 at 02:34:42PM +, Daniel Shahaf wrote:
> > > james...@apache.org wrote on Wed, Feb 10, 2016 at 03:22:36 -:
> > > ># Retrieve the requested history.
> > > > -  $ra->get_log([''], $startrev, $youngest, 0, 1, 0, 
> > > > \_revision);
> > > > +  $client->log($repos_url, $startrev, $youngest, 1, 0,
> > \_revision);
> > >
> > > Why does this work?  Both svn_client.h and SVN::Client(3) state the
> > > first argument is "targets", plural.
> > 
> > SVN::Client(3) describes targets as
> > 
> >$targets
> >This argument can either be a single $target (as defined
> >above) or a reference to an array of them.
> 
> Do you have any pointers to see how this is implemented?

subversion/bindings/swig/include/svn_containers.swg defines a typemap
for "const apr_array_header_t *" parameters:

%typemap(in) const apr_array_header_t *STRINGLIST {
$1 = svn_swig_pl_strings_to_array($input,
 _global_pool);
}
%typemap(in) const apr_array_header_t *STRINGLIST_MAY_BE_NULL {
$1 = SvOK($input) ? svn_swig_pl_strings_to_array(
$input, _global_pool) : NULL;
}

svn_swig_pl_strings_to_array (via svn_swig_pl_to_array), in
subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c, handles
ensuring an apr_array_header_t is passed in to Subversion's APIs.

static apr_array_header_t *svn_swig_pl_to_array(SV *source,
pl_element_converter_t cv,
void *ctx, apr_pool_t *pool)
{
...
} else if (SvOK(source)) {
targlen = 1;
temp = apr_array_make(pool, targlen, sizeof(const char *));
temp->nelts = targlen;
APR_ARRAY_IDX(temp, 0, const char *) = cv(source, ctx, pool);
} else {

Cheers,
-- 
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <james...@jamessan.com>


RE: SVN::Client::log() first argument Re: svn commit: r1729519 - /subversion/trunk/tools/client-side/svn-graph.pl

2016-02-15 Thread Bert Huijben


> -Original Message-
> From: James McCoy [mailto:vega.ja...@gmail.com] On Behalf Of James
> McCoy
> Sent: zondag 14 februari 2016 19:20
> To: Daniel Shahaf <d...@daniel.shahaf.name>
> Cc: dev@subversion.apache.org
> Subject: Re: SVN::Client::log() first argument Re: svn commit: r1729519 -
> /subversion/trunk/tools/client-side/svn-graph.pl
> 
> On Sun, Feb 14, 2016 at 02:34:42PM +, Daniel Shahaf wrote:
> > james...@apache.org wrote on Wed, Feb 10, 2016 at 03:22:36 -:
> > ># Retrieve the requested history.
> > > -  $ra->get_log([''], $startrev, $youngest, 0, 1, 0, \_revision);
> > > +  $client->log($repos_url, $startrev, $youngest, 1, 0,
> \_revision);
> >
> > Why does this work?  Both svn_client.h and SVN::Client(3) state the
> > first argument is "targets", plural.
> 
> SVN::Client(3) describes targets as
> 
>$targets
>  This argument can either be a single $target (as defined
>  above) or a reference to an array of them.

Do you have any pointers to see how this is implemented?

I can find this documentation specific for 'targets' argument in one of our .i 
files, but no matching implementation.

I'm trying to find why, but the only things I can find would indicate that this 
is just based on how swig implements array mappings for perl.

Bert



Re: SVN::Client::log() first argument Re: svn commit: r1729519 - /subversion/trunk/tools/client-side/svn-graph.pl

2016-02-14 Thread James McCoy
On Sun, Feb 14, 2016 at 02:34:42PM +, Daniel Shahaf wrote:
> james...@apache.org wrote on Wed, Feb 10, 2016 at 03:22:36 -:
> ># Retrieve the requested history.
> > -  $ra->get_log([''], $startrev, $youngest, 0, 1, 0, \_revision);
> > +  $client->log($repos_url, $startrev, $youngest, 1, 0, \_revision);
> 
> Why does this work?  Both svn_client.h and SVN::Client(3) state the
> first argument is "targets", plural.

SVN::Client(3) describes targets as

   $targets
   This argument can either be a single $target (as defined
   above) or a reference to an array of them.

Cheers,
-- 
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy 


SVN::Client::log() first argument Re: svn commit: r1729519 - /subversion/trunk/tools/client-side/svn-graph.pl

2016-02-14 Thread Daniel Shahaf
james...@apache.org wrote on Wed, Feb 10, 2016 at 03:22:36 -:
># Retrieve the requested history.
> -  $ra->get_log([''], $startrev, $youngest, 0, 1, 0, \_revision);
> +  $client->log($repos_url, $startrev, $youngest, 1, 0, \_revision);

Why does this work?  Both svn_client.h and SVN::Client(3) state the
first argument is "targets", plural.

Cheers,

Daniel