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


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

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

From Lew <noone@lewscanon.com>
Newsgroups comp.lang.java.programmer
Subject Re: Get Rev Number from SVN to Display in Web App
Date 2012-05-08 05:44 -0700
Organization albasani.net
Message-ID <job4fq$qp4$1@news.albasani.net> (permalink)
References <joaro7$8hs$1@news.albasani.net> <snbn79-ct6.ln1@hurricane.fredriksson.dy.fi> <joavia$gkd$1@news.albasani.net> <b1fn79-7f8.ln1@hurricane.fredriksson.dy.fi> <job38e$o6m$1@news.albasani.net>

Show all headers | View raw


Jan Burse wrote:
> Donkey Hottie schrieb:
>> Jan Burse wrote:
>>> Donkey Hottie schrieb:
>>>> Just put the "$Revision: $" into your source code
>>>
>>> Hi, thanks, but how do I get the revision from SVN?
>>> Are there some SVN specific Ant tasks around, something
>>> along get property? By revision I mean the transaction
>>> number of SVN, not something I know and that I can put
>>> manually in some file.
>>>
>>> Bye
>>
>> If you put that string to a file, svn will replace it with the revision
>> number when the file is committed to svn.
>>
>> The file must be enabled to get this using command
>>
>> svn propset svn:keywords "Revision" filename
>>
>> http://johnbokma.com/mexit/2008/09/30/subversion-svn-keywords-property.html
>>
>> The next "svn commit" will update the file with revision number.
>>
>>
>
> But still it doesn't solve my problem. Since it needs
> that I commit a file. But if no changes happened at
> all, the SVN command I am looking for, should just
> return the global transaction count from the last time.
> SVN maintains such a counter.

<http://lmgtfy.com/?q=get+subversion+revision+number+automatically+in+Ant>

which led me to find:
<http://ant.apache.org/antlibs/svn/>
<http://subclipse.tigris.org/svnant.html>

I didn't drill down deep enough there to find your specific answer, but since 
the Ant tasks are wrappers for the "svn" command, if you know how to do it 
with "svn" you should be able to do it with Ant. Some of the links from that 
search give specific hacks that you might find useful.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

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