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

Re: [PATCH]: Transform rules prototype

From: Vincent Lefevre <vincent+svn_at_vinc17.org>
Date: 2005-11-06 20:15:56 CET

On 2005-11-05 22:35:10 -0500, Daniel Berlin wrote:
> Url's starting with "rule://" will be tranformed according to the rules.

Since this is configurable, why not transforming *any* URL-like string?

If a user wants to transform only strings starting with "rule://",
he should be allowed to specify that in the rules.

> 1. Argument text cannot contain /, in this url syntax, since doing so
> would require adding an end argument delimiter.

The end argument delimiter could be given in the rule, e.g.

release#*/=branches/gcc-$1-branch/

The * is a special character that matches anything up to the
delimiter.

> 2. The rule:// text is deleted as part of processing.
> 3. Where the occurrence of the text in the match part happens is of no
> consequence (IE we don't require it occur right after a / or anything).
> This would be easy to change

There would be a problem with your example and something like that:

  svn ls rule://repo/dir/branches.c

> 4. Each rule is applied exactly once per url, to the first match it
> finds. This would be easy to change.
>
> Examples:
> Given:
>
> [transform-rules]
> repo=svn://gcc.gnu.org/svn/gcc 3
> branches=repo/branches 2
> release=branches/gcc-$1-branch 1

I'd rather see this written like this (following my comments above):

^rule://repo=svn://gcc.gnu.org/svn/gcc 3
^rule://branches=rule://repo/branches 2
^rule://release#*/=rule://branches/gcc-$1-branch/

The special characters are the following ones:
  1. At the beginning of the rule, ^ means that the match must occur
     at the beginning of the string.
  2. * matches anything up to the separator (following *), if there is
     one. For instance, in the 3rd rule above, * would be equivalent
     to [^/]* in a regexp.
  3. In the replacement text, $[1-9] is replaced by the corresponding
     matched text. $. is replaced by the URL given by svn info.

-- 
Vincent Lefèvre <vincent_at_vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Nov 6 20:17:14 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.