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

Re: revision in source code

From: Mark Reibert <svn_at_reibert.com>
Date: Sun, 08 Jun 2008 15:30:46 -0700

On Mon, 2008-06-09 at 00:07 +0200, svn interested wrote:
> Mark Reibert wrote:
> > On Thu, 2008-06-05 at 08:34 -0400, Andy Levy wrote:
> >> On Thu, Jun 5, 2008 at 8:11 AM, massimiliano
> >> <massimiliano.cialdi_at_powersoft.it> wrote:
> >>> how can "read" the base_dir revision and put in a C string automagically (or
> >>> through a script)?
> >> http://subversion.tigris.org/faq.html#version-value-in-source
> >
> > The problem - or at least inconvenience - with svnversion is it requires
> > a working copy. A build purist prefers to "svn export" a tag and build
> > from the export. This way the build is of exactly the same source
> > delivered to the customers/users.
> >
> > One option is to do something like "svn info <repo_url>/tags/<release>"
> > and grab the commit or "last changed" revision. Then export, munge the
> > release and commit revision into the source where needed, and build.
> >
> Hi Marc,
> on your svn-server you can use "svnlook youngest" to retrieve the
> revision number. On a different machine you can use a regex to retrieve
> the revision number as last line from your "svn export" output.

I prefer the revision that created (or last updated) the tag, not the
repo youngest rev. Otherwise, my build string could be "1.5.2.2378" one
day, and "1.5.2.2480" the next (if I ever had to re-build the 1.5.2
release). That might confuse users, who think they have a different
release when in fact they do not.

Regarding "svnlook youngest", between the time I run that and then "svn
export" (to do the build) the youngest rev could have changed.

> I think it is always a bad idea to couple your source code to a SCM(even
> as good as SVN) via using such keywords. You will agree if you try to
> migrate your source from one SCM to another.

I do not quite follow. Parsing the output of "svn info" versus the
output of "svn export" seems to differ only in how I write the regex to
grab the revision. Regardless, I have some knowledge of SVN. Keep in
mind my suggestion does not require any special SVN properties or (SVN
specific) keywords in the source.

> Greetings,

Likewise!
Mark

-- 
----------------------
Mark S. Reibert, Ph.D.
svn_at_reibert.com
----------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-06-09 00:31:09 CEST

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.