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

Re: API review - svn_dirent_uri.h

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Wed, 15 Jun 2011 17:32:28 +0100

On Fri, 2011-06-10 at 09:06 +0100, Julian Foad wrote:
> I (Julian Foad) wrote:
> > On Thu, 2011-06-09, I (Julian Foad) wrote:
> > > svn_dirent_uri.h
> > > svn_relpath_internal_style()
> > > svn_relpath_local_style()
> > > # These two are inappropriate: only dirents have a 'local' style.
> >
> > I removed the former and made the latter private in r1133964.

Bert pointed out that there is a desire and precedent for the Windows
client to display in-repository relpaths using the Windows "\"
separator, so svn_relpath_local_style() may be wanted. It was currently
not used (and is now deleted) so presumably the functionality is
currently implemented by using svn_dirent_local_style(). I suggest we
bring it back as a private function if and when we want to use it.

> > > svn_dirent_skip_ancestor()
> > > # See ### comment.
> > > svn_relpath_skip_ancestor()
> > > # See ### comment.
> > > svn_uri_skip_ancestor()
> >
> > I intend to make the three skip_ancestor functions return NULL if the
> > supposed child is not in fact a child of (or equal to) the parent path.
> > No callers appear to want the current behaviour of returning the child
> > in that case - I've just confirmed that both by testing and by
> > inspection.
>
> Scratch that "confirmation": I've only inspected the relpath one, and my
> testing of all of them was flawed.

I intend all the _skip_ancestor functions to return NULL when the
supposed child is not in fact a child. I have changed the fspath,
relpath and uri functions to behave like that, and all their callers
were either happy with that or were trivially updated to cope.

Many callers of svn_dirent_skip_ancestor(), on the other hand, expect
the 'child' input to be returned if it is not in fact a child. I am
splitting the function into two:

  svn_dirent_skip_ancestor() - return NULL if not a child
  [some other function name] - return 'child' input if not a child

- Julian
Received on 2011-06-15 18:33:15 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.