You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@gmail.com> on 2012/04/04 14:33:48 UTC
Re: svn commit: r1309283 - in /subversion/trunk/subversion:
include/private/svn_client_private.h libsvn_client/commit_util.c
libsvn_client/copy.c libsvn_client/merge.c libsvn_client/mergeinfo.c libsvn_client/util.c
On Apr 4, 2012 4:26 AM, <ju...@apache.org> wrote:
>
> Author: julianfoad
> Date: Wed Apr 4 08:26:15 2012
> New Revision: 1309283
>
> URL: http://svn.apache.org/viewvc?rev=1309283&view=rev
> Log:
> Convert svn_client__wc_node_get_origin() to use svn_client__pathrev_t for
> its output.
>
> * subversion/include/private/svn_client_private.h,
> subversion/libsvn_client/util.c
> (svn_client__wc_node_get_origin): Use pathrev_t for the output.
This revision certainly shows how pathrev_t is a simplifying concept. Very
nice!
That said: I'd recommend being wary in your work about the struct being an
*input* param in public APIs. There are seriously heavy internal
constraints on the struct members. (eg. pass a struct with a NULL uuid, or
even a non-matching one)
I don't have a recommendation right now for what happens if the struct is
made public. I just wanted to raise a yellow flag. It seems best to keep it
very private because of the difficult constraints/preconditions in its
members.
Cheers,
-g
Re: svn commit: r1309283 - in /subversion/trunk/subversion:
include/private/svn_client_private.h libsvn_client/commit_util.c
libsvn_client/copy.c libsvn_client/merge.c libsvn_client/mergeinfo.c libsvn_client/util.c
Posted by Greg Stein <gs...@gmail.com>.
On Apr 4, 2012 9:17 AM, "Julian Foad" <ju...@btopenworld.com> wrote:
>
> Greg Stein wrote:
> >> Convert svn_client__wc_node_get_origin() to use svn_client__pathrev_t
for
> >> its output.
> >>
> >> * subversion/include/private/svn_client_private.h,
> >> subversion/libsvn_client/util.c
> >> (svn_client__wc_node_get_origin): Use pathrev_t for the output.
>
> > This revision certainly shows how pathrev_t is a simplifying concept.
Very nice!
> > That said: I'd recommend being wary in your work about the struct being
an *input* param in public APIs. There are seriously heavy internal
constraints on the struct members. (eg. pass a struct with a NULL uuid, or
even a non-matching one)
> > I don't have a recommendation right now for what happens if the struct
is made public. I just wanted to raise a yellow flag. It seems best to keep
it very private because of the difficult constraints/preconditions in its
members.
>
>
> Right, good point. I'd really like to see this (or something similar)
become more widespread so I hope we can find a satisfactory solution.
It may be as simple as only returning const structs in the API. Or opaque.
But certainly warnings like, "seriously, don't mess around in here. tweak
at your own peril." :-)
Cheers,
-g
Re: svn commit: r1309283 - in /subversion/trunk/subversion: include/private/svn_client_private.h libsvn_client/commit_util.c libsvn_client/copy.c libsvn_client/merge.c libsvn_client/mergeinfo.c libsvn_client/util.c
Posted by Julian Foad <ju...@btopenworld.com>.
Greg Stein wrote:
>> Convert svn_client__wc_node_get_origin() to use svn_client__pathrev_t for
>> its output.
>>
>> * subversion/include/private/svn_client_private.h,
>> subversion/libsvn_client/util.c
>> (svn_client__wc_node_get_origin): Use pathrev_t for the output.
> This revision certainly shows how pathrev_t is a simplifying concept. Very nice!
> That said: I'd recommend being wary in your work about the struct being an *input* param in public APIs. There are seriously heavy internal constraints on the struct members. (eg. pass a struct with a NULL uuid, or even a non-matching one)
> I don't have a recommendation right now for what happens if the struct is made public. I just wanted to raise a yellow flag. It seems best to keep it very private because of the difficult constraints/preconditions in its members.
Right, good point. I'd really like to see this (or something similar) become more widespread so I hope we can find a satisfactory solution.
- Julian