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