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

Re: Which family of path/dirent/uri/relpath functions to use for svn_lock_t->path?

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Fri, 12 Nov 2010 18:00:02 +0000

Julian Foad wrote:
> Peter Samuelson wrote:
> > [Julian Foad]
> > > Proposal for switching to a dedicated "fs path" API:
> > >
> > > Step 1: Introduce a new API for FS paths, as a thin layer that maps to
> > > existing path APIs. It must assert that the fspath arguments and fspath
> > > return values begin with '/'. Initially it should map directly to
> > > svn_uri_*, so that it can be seen to be a direct replacement.

I've just scanned through libsvn_fs*, libsvn_repos and libsvn_ra*, and
the only svn_uri_* functions used here on non-URI paths appear to be:


So that makes for a nice small start-up requirement for this new API.
There are probably others used elsewhere in our codebase, of course.

- Julian

> > So do these or do these not involve doing URI escaping? %20 for space,
> > etc.
> No escaping involved here - these are not URLs and these are not
> relative-URLs and so do not have any escaping inside them. When we make
> a URL from a base URL and a repo-relpath, *then* we will escape it.
> I believe, but haven't checked recently, that the present set of
> svn_uri_* functions doesn't touch or care about percent-escaping when
> handling these paths. Because we have forced them to handle this case,
> they don't assert that their arguments are canonical. After we make
> this transition, then the svn_uri_* functions should be able (from a
> correctness point of view) to assert that their 'URI' inputs and outputs
> are canonical.
> > By calling them 'fs paths', the assumption is that these are in
> > UTF-8, and there is no marshalling / escaping to even think about,
> > except when converting it to or from a URI or dirent. Is that the
> > intent?
> Yes.
> > > Bikeshed: svn_fspath__* or svn_fs__path_* or something else?
> >
> > svn_fspath__ seems better to me. svn_fs__path_ sounds like this is all
> > internal to libsvn_fs, whereas I understand you want this in
> > libsvn_subr for layers to use that are _not_ specifically talking about
> > svn_fs internals.
> Correct, so yes, I agree.
> - Julian
Received on 2010-11-12 19:00:45 CET

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.