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

Re: Add HEAD revision to a file at checkout

From: Ryan Schmidt <subversion-2006c_at_ryandesign.com>
Date: 2006-08-02 20:18:44 CEST

On Aug 2, 2006, at 16:32, Nico Kadel-Garcia wrote:

>> I'm holding a web application in Subversion with TortoiseSVN. Our
>> developers have asked if it's possible to show the revision of the
>> deployed version on a web page of the project.
>>
>> At the moment I'm doing this manually, that means that I'm replacing
>> "Rev: 123" with the new revision after new checkout/deployment in the
>> web page itself.
>>
>> Is it possible to do this automatically, like having Subversion
>> replacing $REV with the HEAD revision at checkout? Important thing is
>> that it should not use the last revision of the document, it should
>> use the actual HEAD revision.
>
> viewvc, baby. You want to install viewvc from www.viewvc.org: its
> URL's are not identical to those of the repository itself, but it's
> a trivial way to browse the contents and get revision numbers.

Mm.... no, that's not what he's asking. He's himself developing a web
site, and wants the HEAD revision number displayed for his users to see.

Frank, there are no client-side hooks. What you would do is have a
script that you use to deploy a new version of the site. The script
might "svn up" a working copy, then use "svnversion" (or "svn info"
some parsing) to get the revision number, then write this into a file
in the working copy. (The working copy has been set up to ignore the
presence of that file with svn:ignore.) The homepage of your web app
then merely reads in the contents of that text file and displays it.

Here's another take on this, written more for programmers of compiled
languages but maybe still useful:

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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Aug 2 20:27:42 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.