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

Re: Auto-subst of repository roots

From: Alan Barrett <apb_at_cequrux.com>
Date: 2005-11-03 11:33:45 CET

On Thu, 03 Nov 2005, Greg Hudson wrote:
> In http://svn.haxx.se/dev/archive-2005-05/1367.shtml I outlined a more
> complicated proposal which saves significantly more typing. I'm not
> sure it's a good idea, but I do think we should be aiming higher than
> just repository root substitution.

I agree that we should aim higher, and your proposed syntax looks

In http://svn.haxx.se/dev/archive-2005-05/1367.shtml Greg Hudson wrote:
> I'll throw out a sketch of a straw-man proposal within the above
> solution space: (1) we introduce a directory property "svn:transforms"
> whose value is a series of lines which look like "T /trunk /tags". Each
> line defines a named transformation rule; in the example, the rule name
> is "T" and the rule substitutes the FS path prefix /trunk with /tags and
> adds in the tag name as a path component; (2) we introduce a revision
> specifier syntax "rule#path[@rev]" which transforms the URL according to
> the svn:transforms value in the current directory, and uses either the
> specified revision or the head revision. So you would do "svn diff -r
> T#mytag foo.c" to diff a file against a tag, with the example transform
> rule.

Would there be a search procedure? For example, search upwards in
parent and ancestor directories for the appropriate property until it's
found? If the property is found but the transform rule is not found, do
we keep searching, so that child directories can inherit transform rules
from their parents?

I think there needs to be some sort of wildcard and parameter
substitution mechanism. The transform rules that take you to the trunk
do not need a parameter, but the transform rules that take you to a
branch or tag do need a parameter. The transform rules that take you
away from a branch or tag similarly need to have a wildcard in the
source path, which is not necessary in the transform rules that take you
away from the trunk.

  # rule n args source path target path
  TRUNK 0 trunk trunk
  TRUNK 0 branches/* trunk
  TRUNK 0 tags/* trunk
  BRANCH 1 trunk branches/$1
  BRANCH 1 branches/* branches/$1
  BRANCH 1 tags/* branches/$1
  TAG 1 trunk tags/$1
  TAG 1 branches/* tags/$1
  TAG 1 tags/* tags/$1

(The above table clearly needs a better syntax with less duplication.
Notice that, at least in this example, the target path depends only on
the rule, not the source path, and that all rules cater for the same set
of source paths.)

Use case: I have a checked out copy of
scheme://host/repository/project/branches/foobranch/dir/subdir. I
type "svn diff -r TAG#tagname filename". The "#" is recognised as
part of the magic syntax. The property search process finds that the
scheme://host/repository/project directory has the appropriate property.
Within that property, the variant of the "TAG" rule that says how to
go from "branches/*" is matched, and the "$1" in the target path is
replaced with "tagname". The result is as if I had typed "svn diff
-r scheme://host/repository/project/tags/tagname/dir/subdir/filename

--apb (Alan Barrett)

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 3 11:35:50 2005

This is an archived mail posted to the Subversion Dev mailing list.