You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by od...@cypoint.se on 2006/09/01 13:01:38 UTC

Base revision keyword feature

Hello!

I have a feature request regarding access to the base revision number (the
current revision number of the repository at checkout/export/update) as a
keyword.

A "base revision" keyword would greatly simplify usage of subversion
revision numbers as build numbers.
I know that this is possible today via the svnversion (or svn log) command,
but a keyword expansion would work without depending on any subversion
tools on the client, and would work for repository exports as well.

Re: Base revision keyword feature

Posted by John Peacock <jp...@rowman.com>.
odd.moller@cypoint.se wrote:
> A "base revision" keyword would greatly simplify usage of subversion
> revision numbers as build numbers.

You are mistaken about how keywords work; they are stored unexpanded in 
the repository and only the client code expands them at specific times 
(e.g. when the file containing the keyword is updated).  See also below.

> I know that this is possible today via the svnversion (or svn log) command,
> but a keyword expansion would work without depending on any subversion
> tools on the client, and would work for repository exports as well.

I don't understand this part.  It is not possible to checkout or export 
from Subversion without using the Subversion tools locally (unless you 
are thinking that you can use a web mirroring tool to copy the files 
directly out of the repository using the DAV browser).

> I think the above FAQ answer need not apply if the proposed "base revision"
> keyword is implemented in such a way as to avoid a total repository
> traversal. If the svn server knows the set of files that has the "base
> revision" keyword, only these files need have the keyword expanded at
> update/commit. Either the server could automatically keep track of files
> with the "base revision" keyword, or some property on the repository root
> directory could specify the set of files explicitly.

As I said above, the server *never* expands keywords - only the client 
does this.  If you read the chapter about "Mixed Revision working 
copies" you will see that Updates and Commits are completely independent 
operations.  When you commit a file, that file, and only that file is 
committed (for recursive commits read that as being "each file 
independently").  No other file will be updated when *this* file has 
been changed (it's a core part of how the working copy code operates).

The "base revision" or "repository global revision" is a meta property 
of the working copy, or any individual file.  That's why it is best 
handled in a build system using e.g. svnversion.

HTH

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Base revision keyword feature

Posted by Karl Fogel <kf...@google.com>.
A meta-comment:

Please don't follow up to an existing post to start a new thread.  See
 
   http://subversion.tigris.org/mailing-list-guidelines.html#fresh-post

for why.

Thank you,
-Karl

odd.moller@cypoint.se writes:
> Hello!
>
> I have a feature request regarding access to the base revision number (the
> current revision number of the repository at checkout/export/update) as a
> keyword.
>
> A "base revision" keyword would greatly simplify usage of subversion
> revision numbers as build numbers.
> I know that this is possible today via the svnversion (or svn log) command,
> but a keyword expansion would work without depending on any subversion
> tools on the client, and would work for repository exports as well.
>
>>From the FAQ:
> Q: "Why doesn't the $Revision$ keyword do what I want? It expands to the
> file's last-changed revision, but I want something that will expand to the
> file's current revision."
> A: "Subversion increments the revision number of the repository as a whole,
> so it can't expand any keyword to be that number - it would have to search
> and possibly modify every file in your working copy on every update and
> commit."
>
> I think the above FAQ answer need not apply if the proposed "base revision"
> keyword is implemented in such a way as to avoid a total repository
> traversal. If the svn server knows the set of files that has the "base
> revision" keyword, only these files need have the keyword expanded at
> update/commit. Either the server could automatically keep track of files
> with the "base revision" keyword, or some property on the repository root
> directory could specify the set of files explicitly.
>
>
> One way of implementing this (without changing the server) would be to
> update a file at each commit. The problem with this is that there exists no
> method of adding files to the transaction change set via a hook (afaik).
>
>
> Greetings
> /// Odd Möller
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org