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

Re: Newbie question: getting the revision number substituted in the source code

From: Michael Price <mprice_at_atl.lmco.com>
Date: 2003-01-08 20:56:28 CET

Karl Fogel writes:
> > What would be really nice is if we could get it all formatted nicely...
> > The dream might be something like (assuming tag "1.2" and revision 2311):
> >
> > > svn print "Version %t.%r, built %D %T"
> > Version 1.2.2311, built 2003-01-08 19:32:00
>
> You can (and should) accomplish the same thing by parsing that stuff
> from the output of other svn commands, munging appropriately, and
> splicing it into your build however you wish.

As an example (made up a tag as it wasn't clear where you were obtaining
this):

$ ~/wc> tag=1.2
$ ~/wc> revision="`svn status -Nqu | cut -d ':' -f2 | tr -d ' '`"
$ ~/wc> date="`date '+%Y-%m-%d %k:%M:%S'`"
$ ~/wc> echo "Version $tag.$revision, built $date"
Version 1.2.38, built 2003-01-08 14:46:42

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jan 8 20:59:24 2003

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