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

Question regarding repository-local path keyword

From: John Peacock <jpeacock_at_rowman.com>
Date: 2005-01-02 00:06:03 CET

I've gotten the correct elements in place to provide the information to fill in
the repository local path for a given file:

$ svn cat file:///home/jpeacock/tmp/repo/sub1/sub2/test1
$HeadURL: file:///home/jpeacock/tmp/repo/sub1/sub2/test1 $
$RepositoryLocalPath: file:///home/jpeacock/tmp/repo $

NOTE: what I am displaying as $RepositoryLocalPath$ now is the full repos_root

However, there is no path (or string) function to subtract a prefix off a
path/url ( so to get the desired value of "sub1/sub2/test1" for the above test
file). I'm thinking I can create a function that will do this by decomposing
each path into it's components and then removing the common components. I have
a couple of questions, though:

1) Should I throw an error if the common components don't completely consume the
prefix path? Or should I return the portion of the source path which includes
every element not in common with the prefix string?

2) I'm thinking I should make this work on either URL's or paths (and require
that they be normalized first). Is this reasonable?

3) Anyone want to share their opinion of a good function name? Here are a
couple of possibilities:

svn_path_remove_prefix(**path, *prefix, pool)
svn_path_remove_common_path(**path, *prefix, pool)

4) Should I just cut to the chase and treat these as strings and just step
through each string, character by character? In this case, it would be good
enough since I know for certain that the prefix is a proper subset of the whole
path string (and I've confirmed that it works here).

Anything else I am forgetting???


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Jan 2 00:08:25 2005

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.