Greg Stein wrote:
> On Sat, Apr 24, 2010 at 10:37, Neels J Hofmeyr <neels_at_elego.de> wrote:
>> ...
>> At first glance, it appears that different code paths want to handle
>> incomplete nodes differently. Some want to act as if the node was 'normal'
>> == versioned. Most appear to want to act as if incomplete nodes were
>> non-versioned -- but maybe they just do that now because a cleanly
>> non-versioned node returns the same value as an incomplete node. And that's
>> the problem -- the API tempts hackers to just ignore the incomplete state
>> without reflection.
>>
>> Maybe svn_wc__node_get_kind() should use determine if a node is incomplete
>> and throw an error if so, including a boolean arg allow_incomplete to bypass
>> that error?
>
> The node_get_kind API is there for simplicity. Don't throw errors.
>
> Adjust return values instead. I would recommend returning none for
> unversioned and hidden nodes (the idea behind hidden is "it isn't
> there", so these are the same concept). And reserve unknown for
> incomplete nodes.
Ok cool. I was at first thinking the same and then thought that maybe the
'unknown' was intended to mean something like "it's definitely not in the
WC, but who knows which kind it may be in the repos".
But with that said, I agree totally.
One thing I'd like to clarify though -- this function could technically also
be used to determine the kind that may have been noted in an incomplete
node. I assume that's not worth considering for a simplicity-API.
~Neels
Received on 2010-04-24 22:40:52 CEST