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

Re: wc-ng: determine if a node is versioned

From: Neels J Hofmeyr <neels_at_elego.de>
Date: Sat, 24 Apr 2010 22:40:15 +0200

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.


Received on 2010-04-24 22:40:52 CEST

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.