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

RE: redundant path functions

From: Bert Huijben <bert_at_qqmail.nl>
Date: Wed, 31 Mar 2010 11:34:35 +0200

> -----Original Message-----
> From: Greg Stein [mailto:gstein_at_gmail.com]
> Sent: woensdag 31 maart 2010 2:47
> To: dev_at_subversion.apache.org
> Subject: redundant path functions
> The following functions seem very redundant. Because each is slightly
> different, I always have to compare/contrast them to isolate their
> differences. It would be much better if we could pick JUST ONE, and
> run with that:
> svn_*_is_child()
> svn_*_is_ancestor()
> svn_*_skip_ancestor()
> I do realize that we published the svn_dirent_* functions in 1.6, but
> we don't have to carry their analogues to the new functions. (and
> possibly even deprecate the 1.6 funcs)
> It seems that the is_child variant is the only function needed. The
> is_ancestor() is merely is_child() != NULL, and the skip_ancestor is
> simply pool=NULL.
> Am I missing something, and/or can/should we remove this redundancy?

There is one difference between is_child and the ancestors functions: How
they handle the case where the path is the ancestor itself.

The is_child function returns NULL, while is_ancestor returns true.
Skip ancestor removes the ancestor (prefix) and returns "" for the ancestor
itself and leaves paths that don't have the ancestor as-is.

Received on 2010-03-31 11:35:13 CEST

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