You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Caleb Tennis <ca...@aei-tech.com> on 2004/09/09 18:01:04 UTC

Feature Request: Repository Version property keyword

The svn:keywords namespace could benefit from another addition - something 
like "RepositoryVersion" which could act much like "LastChangedRevision" only 
it updates at each repository commit and not just on the particular file 
change.

This feature would be nice because the text of the expanded string could be 
directly encoded into code or text of what's being written.  For example, in 
a C program:

const char *repo_version = "$RepositoryVersion$";

Then the program in question could utilize this version information.  For 
example, programs we use here can utilize this as a "build" number which the 
user can know what version of the software they are running.

A current workaround for this exists using scripts and getting a number from 
the 'svnversion' command (this is done, for example, by the scripts which 
generate the docbook output for the Subversion online book), but having 
direct expansion directly in the version controlled file would be a nifty 
feature as well.

Thoughts?  Comments?  Shall I file an issue?

Regards,
Caleb (please cc me directly)

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

Re: Feature Request: Repository Version property keyword

Posted by Max Bowsher <ma...@ukf.net>.
Ben Collins-Sussman wrote:
> On Thu, 2004-09-09 at 13:54, Caleb Tennis wrote:
>> On Thursday 09 September 2004 01:53 pm, Ben Collins-Sussman wrote:
>>> The point here is that if we implemented $GlobalRev$, then every update
>>> and commit would have to walk the *entire* working copy and scan for
>>> properties.  That's really time-consuming.  It would be a massive
>>> slowdown.
>>
>> Okay, I'll buy it. :)
>>
>> My apologies for not catching this in the FAQ before mailing, too.
>
> The FAQ could be clearer.  I should copy that explanation into it.  :-/

And note that that's not the only reason.

If you substitute the revision into a version.c file or equivalent, then 
create a mixed revision WC by doing some operations in a subtree, then that 
keyword expansion is lying about what code is really being built. Which is 
why we have svnversion instead.

Max.


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

Re: Feature Request: Repository Version property keyword

Posted by Ben Collins-Sussman <su...@collab.net>.
On Thu, 2004-09-09 at 13:54, Caleb Tennis wrote:
> On Thursday 09 September 2004 01:53 pm, Ben Collins-Sussman wrote:
> > The point here is that if we implemented $GlobalRev$, then every update
> > and commit would have to walk the *entire* working copy and scan for
> > properties.  That's really time-consuming.  It would be a massive
> > slowdown.
> 
> Okay, I'll buy it. :)
> 
> My apologies for not catching this in the FAQ before mailing, too.

The FAQ could be clearer.  I should copy that explanation into it.  :-/



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

Re: Feature Request: Repository Version property keyword

Posted by Caleb Tennis <ca...@aei-tech.com>.
On Thursday 09 September 2004 01:53 pm, Ben Collins-Sussman wrote:
> The point here is that if we implemented $GlobalRev$, then every update
> and commit would have to walk the *entire* working copy and scan for
> properties.  That's really time-consuming.  It would be a massive
> slowdown.

Okay, I'll buy it. :)

My apologies for not catching this in the FAQ before mailing, too.

Caleb

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

Re: Feature Request: Repository Version property keyword

Posted by Ben Collins-Sussman <su...@collab.net>.
On Thu, 2004-09-09 at 13:42, Caleb Tennis wrote:

> The text: "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"  seems to suggest that this ability is possible, and would be 
> more feasible if a special property is set on the particular file.  The 
> parser would just ignore files that don't have the property set.

At the moment, a given update or commit only affects a specific list of
files, and so only those specific files need to have their properties
scanned (in case keywords need to be substituted.)

The point here is that if we implemented $GlobalRev$, then every update
and commit would have to walk the *entire* working copy and scan for
properties.  That's really time-consuming.  It would be a massive
slowdown.




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

Re: Feature Request: Repository Version property keyword

Posted by Caleb Tennis <ca...@aei-tech.com>.
On Thursday 09 September 2004 01:23 pm, Jani Averbach wrote:
> http://subversion.tigris.org/project_faq.html#version-value-in-source

But this seems like such a hack - particularly if you're not using Makefiles 
or writing in C.

The text: "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"  seems to suggest that this ability is possible, and would be 
more feasible if a special property is set on the particular file.  The 
parser would just ignore files that don't have the property set.

Anyway, just a thought.

Caleb

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

Re: Feature Request: Repository Version property keyword

Posted by Jani Averbach <ja...@jaa.iki.fi>.
http://subversion.tigris.org/project_faq.html#version-value-in-source

BR, Jani

On 2004-09-09 13:01-0500, Caleb Tennis wrote:
> 
> The svn:keywords namespace could benefit from another addition - something 
> like "RepositoryVersion" which could act much like "LastChangedRevision" only 
> it updates at each repository commit and not just on the particular file 
> change.
> 
> This feature would be nice because the text of the expanded string could be 
> directly encoded into code or text of what's being written.  For example, in 
> a C program:
> 
> const char *repo_version = "$RepositoryVersion$";
> 
> Then the program in question could utilize this version information.  For 
> example, programs we use here can utilize this as a "build" number which the 
> user can know what version of the software they are running.
> 
> A current workaround for this exists using scripts and getting a number from 
> the 'svnversion' command (this is done, for example, by the scripts which 
> generate the docbook output for the Subversion online book), but having 
> direct expansion directly in the version controlled file would be a nifty 
> feature as well.
> 
> Thoughts?  Comments?  Shall I file an issue?
> 
> Regards,
> Caleb (please cc me directly)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
> 

-- 
Jani Averbach


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

Re: Feature Request: Repository Version property keyword

Posted by John Peacock <jp...@rowman.com>.
Caleb Tennis wrote:

> The svn:keywords namespace could benefit from another addition - something 
> like "RepositoryVersion" which could act much like "LastChangedRevision" only 
> it updates at each repository commit and not just on the particular file 
> change.

Except that keywords are only expanded when the file containing the 
keyword changes.  This is the nature of mixed revision working copies. 
In the FAQ entry that Jani quoted, the Makefile entry listed 
specifically rebuilds the svn_version.c file anytime 'make' is run, 
which has the appropriate effect.

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