[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Implement '--include-externals' option to 'svn list'

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Thu, 15 Nov 2012 09:40:44 -0500

On 11/15/2012 03:47 AM, Bert Huijben wrote:
>>> Can't you just add the new argument to every call to list_func() that
>>> applies to an external?
>>
>>
>> There is no separate list_func() call to list external items. We are
>> just calling svn_client_list3() recursively for each external, which in
>> turn calls list_func() using get_dir_contents(). I am struggling a bit
>> hard to carry forward external information via svn_client_list3(). Can
>> we add two more arguments external_parent_url and external_target to
>> svn_client_list3()?
>
> You could just create a static function with those extra arguments and make
> the outer svn_client_list3() call into that function.
> Please try to avoid adding implementation details to the public api, unless
> absolutely necessary.
> (We have such wrappers in almost every case where we use externals)
>
> This model would also allow future improvements like re-using the
> ra-session, without updating the public function prototype.

Right. The pattern (to the degree that there is one) would have you
creating a function named something like svn_client__list_internal(), which
has all the code from svn_client_list3() plus the extra (optional)
parameters and functionality you need. svn_client_list3() then becomes a
thin wrapper around that function.

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Enterprise Cloud Development

Received on 2012-11-15 15:41:21 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.