Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #14399

Re: Get Rev Number from SVN to Display in Web App

From Donkey Hottie <donkey@fredriksson.dy.fi>
Newsgroups comp.lang.java.programmer
Subject Re: Get Rev Number from SVN to Display in Web App
Date 2012-05-08 14:13 +0300
Organization A noiseless patient Spider
Message-ID <snbn79-ct6.ln1@hurricane.fredriksson.dy.fi> (permalink)
References <joaro7$8hs$1@news.albasani.net>

Show all headers | View raw


On 8.5.2012 13:15, Jan Burse wrote:
> Dear All,
> 
> Is there a simple Ant task to retrieve the revision
> number of my code from a SVN repository, and then
> store it in some location, so that later my web
> application can show it?
> 
> Best Regards

Just put the "$Revision: $" into your source code, and if it is a jsp
page, add echo "<!-- last build at `date` -->" >>the.jsp so it changes.
You may play with tail so that you just replace the last line in the
file with that time stamp. And have some Java utility to parse the
revision number from the string "$Revision: 2020$"

  s.split(":")[1].replace('$',' ').trim();

So there. The page always will have the latest revision from version
control in it.

-- 

You shall be rewarded for a dastardly deed.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Get Rev Number from SVN to Display in Web App Jan Burse <janburse@fastmail.fm> - 2012-05-08 12:15 +0200
  Re: Get Rev Number from SVN to Display in Web App Roedy Green <see_website@mindprod.com.invalid> - 2012-05-08 03:23 -0700
    Re: Get Rev Number from SVN to Display in Web App Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-05-08 05:34 -0500
  Re: Get Rev Number from SVN to Display in Web App Donkey Hottie <donkey@fredriksson.dy.fi> - 2012-05-08 14:13 +0300
    Re: Get Rev Number from SVN to Display in Web App Jan Burse <janburse@fastmail.fm> - 2012-05-08 13:20 +0200
      Re: Get Rev Number from SVN to Display in Web App Donkey Hottie <donkey@fredriksson.dy.fi> - 2012-05-08 15:09 +0300
        Re: Get Rev Number from SVN to Display in Web App Jan Burse <janburse@fastmail.fm> - 2012-05-08 14:17 +0200
        Re: Get Rev Number from SVN to Display in Web App Jan Burse <janburse@fastmail.fm> - 2012-05-08 14:23 +0200
          Re: Get Rev Number from SVN to Display in Web App Lew <noone@lewscanon.com> - 2012-05-08 05:44 -0700
  Re: Get Rev Number from SVN to Display in Web App Nigel Wade <nmw@ion.le.ac.uk> - 2012-05-08 14:56 +0100
    Re: Get Rev Number from SVN to Display in Web App Jan Burse <janburse@fastmail.fm> - 2012-05-08 16:21 +0200

csiph-web