You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Phil Endecott <sp...@chezphil.org> on 2005/11/05 11:48:09 UTC

Keyword to identify exported tag?

Dear All,

Back in the land of CVS, I used to have something like this in my file 
headers:

// This is Gnomovision, release $Name$

When I tagged a release (e.g. V1-0) I would create a tar file:

$ cvs export -r V1-0 -d gnomovision-1.0 gnomovision
$ tar czf gnomovision-1.0.tgz gnomovision-1.0

Or something like that - it's only been a few weeks and I'm already 
forgetting the syntax!  Anyway the point is that CVS would replace 
$Name$ with the tag that I had used in the export command, so people 
looking at files from the tar could see what release they had come from. 
  (This is my project release name/number, not the revision of the 
individual file or anything else.)

I'd like to be able to do something similar with Subversion.  It can 
happen either when I "svn copy" (or "svncopy.pl") to tag the release, or 
when I export to create the tar file.  I already have a wrapper script 
to do the export-and-tar so that would be a good place to add it.

Can anyone suggest a good way to do this?

Cheers,

--Phil.




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

Re: Keyword to identify exported tag?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Nov 5, 2005, at 17:52, Phil Endecott wrote:

> Ryan Schmidt wrote:
>> On Nov 5, 2005, at 12:48, Phil Endecott wrote:
>>> CVS would replace  $Name$ with the tag that I had used in the  
>>> export command
>> Would $URL:$ work for you? It would contain the full URL, which,  
>> if  you export a tag, would contain the name of the tag.
>
> I'm hoping that someone can suggest something better.  The URL  
> contains lots of distracting stuff in addition to the release name.

Subversion has no concept of a release name, so it cannot provide  
better. To Subversion, it's all just directories. No directory is any  
more or less significant than any other.

> The aim is that someone who looks at the file can quickly work out  
> what they're dealing with.  Scenario: someone asks a question on  
> the project mailing list and I think "I bet they're using an old  
> version" and I ask them to check.
>
> A related thing is this:
>
>   const char* version = "$Name$";
>
>   void usage() {
>     printf("Gnomovision version %s\n",version);
>   }
>
> In this case you could have the program parse the actual version  
> out of the URL string before printing it, but again I wonder if  
> anyone has any better ideas.

This may be relevant:

http://subversion.tigris.org/faq.html#version-value-in-source

Though I think for $URL$ you could just put it in the source file,  
since it wouldn't change with every revision. And then you could  
parse it as you like.


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

Re: Keyword to identify exported tag?

Posted by Phil Endecott <sp...@chezphil.org>.
Ryan Schmidt wrote:
> On Nov 5, 2005, at 12:48, Phil Endecott wrote:
>> CVS would replace  
>> $Name$ with the tag that I had used in the export command
> 
> Would $URL:$ work for you? It would contain the full URL, which, if  you 
> export a tag, would contain the name of the tag.

I'm hoping that someone can suggest something better.  The URL contains 
lots of distracting stuff in addition to the release name.  The aim is 
that someone who looks at the file can quickly work out what they're 
dealing with.  Scenario: someone asks a question on the project mailing 
list and I think "I bet they're using an old version" and I ask them to 
check.

A related thing is this:

   const char* version = "$Name$";

   void usage() {
     printf("Gnomovision version %s\n",version);
   }

In this case you could have the program parse the actual version out of 
the URL string before printing it, but again I wonder if anyone has any 
better ideas.

Cheers,

--Phil.


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

Re: Keyword to identify exported tag?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Nov 5, 2005, at 12:48, Phil Endecott wrote:

> Back in the land of CVS, I used to have something like this in my  
> file headers:
>
> // This is Gnomovision, release $Name$
>
> When I tagged a release (e.g. V1-0) I would create a tar file:
>
> $ cvs export -r V1-0 -d gnomovision-1.0 gnomovision
> $ tar czf gnomovision-1.0.tgz gnomovision-1.0
>
> Or something like that - it's only been a few weeks and I'm already  
> forgetting the syntax!  Anyway the point is that CVS would replace  
> $Name$ with the tag that I had used in the export command, so  
> people looking at files from the tar could see what release they  
> had come from.  (This is my project release name/number, not the  
> revision of the individual file or anything else.)
>
> I'd like to be able to do something similar with Subversion.  It  
> can happen either when I "svn copy" (or "svncopy.pl") to tag the  
> release, or when I export to create the tar file.  I already have a  
> wrapper script to do the export-and-tar so that would be a good  
> place to add it.
>
> Can anyone suggest a good way to do this?

Would $URL:$ work for you? It would contain the full URL, which, if  
you export a tag, would contain the name of the tag.

http://svnbook.red-bean.com/en/1.1/ch07s02.html#svn-ch-7-sect-2.3.4



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

Re: Keyword to identify exported tag?

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2005-11-05 11:48:09 +0000, Phil Endecott wrote:
> Or something like that - it's only been a few weeks and I'm already 
> forgetting the syntax!  Anyway the point is that CVS would replace 
> $Name$ with the tag that I had used in the export command, so people 
> looking at files from the tar could see what release they had come from. 
>  (This is my project release name/number, not the revision of the 
> individual file or anything else.)
> 
> I'd like to be able to do something similar with Subversion.  It can 
> happen either when I "svn copy" (or "svncopy.pl") to tag the release, or 
> when I export to create the tar file.  I already have a wrapper script 
> to do the export-and-tar so that would be a good place to add it.
> 
> Can anyone suggest a good way to do this?

With Subversion, this can already be done with the Rev keyword,
but you'll just get a number identifying the tag. The URL keyword
gives more information. Or you can just use sed, perl or whatever
if you think there won't be any problem with binary files.

-- 
Vincent Lefèvre <vi...@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: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org