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

svn_opt_parse_path and canonical paths

From: Blair Zajac <blair_at_orcaware.com>
Date: 2007-10-17 00:13:51 CEST

I need a version of svn_opt_parse_path() that doesn't canonicalize it's
arguments for relative externals (the scheme relative //hostname/path/to/repos
has it's // collapsed to / so it becomes a server root relative URL).

In the docstring for svn_opt_parse_path() it makes no mention that it accepts
non-canonicalized paths and returns canonicalized paths, but looking at its
implementation, it does this.

I'm guessing there's a lot of code that assumes that you can use
svn_opt_parse_path() without calling svn_path_canonicalize() calls from its
implementation.

If we ever want to support relative URLs on the command line, I'm guessing that
we'll need to change svn_opt_parse_path() to not canonicalize it.

So I guess I'm looking at some doing some code duplication or I can go through
all callers of svn_opt_parse_path() and check that they do some call to
svn_path_canonicalize() afterwards.

BTW, it looks like svn_path_local_style() has always canonicalized its
arguments, so anybody mind adding it to the list of functions that are safe to
use at the top of svn_path.h with uncanonicalized form:

  * Nearly all the @c svn_path_xxx functions expect paths passed into
  * them to be in canonical form as defined by the Subversion path
  * library itself. The only functions which do *not* have such
  * expectations are:
  *
  * - @c svn_path_canonicalize()
  * - @c svn_path_is_canonical()
  * - @c svn_path_internal_style()

Blair

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 17 00:14:03 2007

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.