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

Re: version label in my source

From: John Peacock <jpeacock_at_rowman.com>
Date: 2004-04-26 21:19:10 CEST

Stewart Johnson wrote:
> I'd like to be able to put tag information in my source files, but I'm not
> sure how to do it. If I create a tag for my project:
>
> $ svn copy http://example.com/repos/myproj/trunk \
> http://example.com/repos/myproj/tags/REL-0.1.0 \
> -m "Release 0.1.0: snapshot build for the subsystem test team"
>
> ... then is it possible to get that release information into my source files?
> ie: I'd like "REL-0.1.0" to appear in the header of my sources, and
> preferably also the commit comment to be there too. Is this possible, or am I
> going about this the wrong way?

Currently, the only keyword which comes close to what you want is $HeadURL$,
which would look like

        $HeadURL: http://example.com/repos/myproj/tags/REL-0.1.0 $

when expanded for the example you list above. Depending on what kind of source
files you are talking about, it may be easier or harder to extract the portion
of that tag that you want.

There is currently no way to get the commit comment into a source file, short of

        svn log filename > filename.log

and then parsing the log file.

There is a couple of outstanding patches on the dev list (by yours truly ;)
which would change the way that keywords are handled internally, and set the
stage for localized keywords. But they are not a short-term solution.

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Apr 26 21:19:39 2004

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.