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

[RFC] Canonical Paths

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-08-28 22:12:46 CEST

Blair Zajac <blair@orcaware.com> writes:

> > > I can't cleanup the directory, nor revert win-tests.py.
> > >
> > > Any ideas?
> >
> > Does avoiding the troublesome "." path work? Try
> >
> > $ cd ..
> > $ svn cleanup svn
> Thanks, that did the trick.
> We gotta nail that bug soon.

Hmmm, I think I may do this, I am running into more and more problems
as I work on issue 749 and introduce the access baton.

I believe the situation is as follows:

1. The Subversion libraries only handle canonical paths, and all the
   functions should passed canonical paths. The only exceptions to
   this rule are svn_path_internal_style, svn_path_canonicalize and
   svn_path_canonicalize_nts, which obviously can accept non-canonical

2. The application is responsible for canonicalizing all user input
   paths before passing them to the Subversion.

3. The canonical form for the path representing the current directory
   could be either "." or "". Currently the path library is not
   consistent. We should pick one, and then we do not need to handle
   the other. APR is know to have some problems using "", so "."
   would be the one I would choose.

4. Functions like svn_path_split, svn_path_remove_component, etc
   should only return canonical paths.

5. In some places the path library handles NULL paths. This is
   unnecessary, as all inputs should be canonical, and so should be
   removed (fixing any breakage that results).

Have I missed anything? Does anyone dispute any of the above?

One question: svn_path_internal_style, which converts from native
separators to canonical separators, doesn't seem to be used. Should
the application pass all user input paths through this function?

Philip Martin
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Aug 28 22:13:19 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.