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

Re: [RFC] Canonical Paths

From: Dave Cridland <dave_at_cridland.net>
Date: 2002-08-29 10:03:06 CEST

I almost hate to contribute to this discussion, given that I'm not
entirely sure it's not a bike-shed. However, I'm just throwing ideas
about. I will happily code the relevant support code up for this idea if
there's the slightest interest. I don't think I'd have a clue which
functions actually need canonical paths, though.

What about defining, in code terms, a "Canonical Path" as a structure
(or object, in those language bindings which support them):

typedef struct {
        char * s;
        size_t l;
} SVN_PATH_COMPONENT;

typedef struct {
        SVN_PATH_COMPONENT * c;
        size_t l;
} SVN_PATH_CANONICAL;

const SVN_PATH_COMPONENT svn_path_cwd = { 0, 0 };
const SVN_PATH_COMPONENT svn_path_repository_root = { 0, 1 };

Gives you type safety, such that it's impossible to pass a non-canonical
path into a function expecting a canonical one, and allows for
canonicalization of local paths to be based on any path seperators and
cwd semantics you want.

You do, of course, have to build some extra functions for making a "DAV
canonical path" - URL encode each component, and glue them with '/' -
and a "Repository Canonical Path", but discussions seem to be hinting
that these are (potentially) different anyway.

Thoughts?

Dave.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 29 09:57:46 2002

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.