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

Version inclusion, how I do it .. (was Re: haskell and svn)

From: Atwood, Robert C <r.atwood_at_imperial.ac.uk>
Date: 2007-10-03 15:30:52 CEST

But ... that only tells you the latest changed revision of the file that
the tag is actually in. It will not necessarily help someone checkout
the same set of source files to create that executable.

The chapter mentioned refers further to this chapter:

http://svnbook.red-bean.com/en/1.4/svn.ref.svnversion.re.html

However this requires some scripting magic to get it into the source
code. While doing that it's also possibly useful to include the date and
time of compiling. It all depends upon why you want to have the
revision, I am assuming that it's for traceability and reproducability.
I also try to get the compiler version, the compilation flags, build
system name, and username into the executable code. However, a side
effect I have not yet fixed means that the file in which this code is
place is itself tagged as 'modified' ; I think I know the way around
that but have not yet fixed it. As I am using Cmake and C, I am not sure
if the exact same method is useful to Haskell which I am unfamiliar
with; FWIW , I use the Cmake commands at configuration time:

    250 exec_program("svnversion ${uMatIC_SOURCE_DIR}"
OUTPUT_VARIABLE CCOUT)
    251 file(APPEND ${INCFILE} "\n\\nSVN version:\\t${CCOUT}\\")

Which executes the svnversion utility for the path stored in the
*SOURCE_DIR variable, then writes the output inside a character string,
into a file that is later included from a C source file. Its' printed by
using the -f command to myProgram. This has the danger that a file
might get changed between configuration and make , I realize, that's
some Cmake thing I need to figure out, not a SVN thing though. Hope it
helps a bit!

./myProgram -f
Configured using /usr/local/bin/cmake and /usr/local/bin/gccv42
gccv42 (GCC) 4.2.0 20070130 (prerelease)
CFLAGS used:
-DBL_COMPRESS;-DIMAGEOUT;-DLIST_ALL_NUC;-DPRINT_AV_PROFILE;-DGLOBAL_UND_
GRO;-DAV_DIFF_COEFF;-DNOSOLID;-DCELL_DIFF_ARR;-DHISTO_NUC;-DALWAYS_NUC;-
DRANSLEY;-DTEST_LINE_INT;-DWRITE_BLOCK;-DINCONEL;-DNLM_FORMULA;-DCA_DOUB
LE;-DCLOCK;-DALLSLICE;-fPIC
Build Username: robert
Build Host: spiderling
SVN version: 1060M
Build date: Tue Oct 2 18:32:03 BST 2007

Yes I know I have too many -D thanks.

> -----Original Message-----
> From: Matthias Buecher / Germany [mailto:maddes.b@arcor.de]
> Sent: 03 October 2007 12:47
> To: Users List Subversion
> Subject: Re: haskell and svn
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Have you set the corresponding property as written in the manual at
> http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.
> keywords.html
> ?
> You also need to commit your change to get the keyword replacement.
>
> Maddes
>
> P.S.:
> Please always respond to the user list, use Reply all for this and
> remove all real persons. Yeah, sometimes I also forget.
>
> On 03.10.2007 13:45, Maddes wrote:
> > Have you set the corresponding property as written in the manual at
> >
> http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.
> keywords.html
> > ?
> > You also need to commit your change to get the keyword replacement.
> >
> > Maddes
> >
> > On 03.10.2007 11:45, Luca Torella wrote:
> >> actually if i put the $Rev$ keyword in my Haskell file, svn isn't
> >> replacing it with the version number.
> >>
> >>
> >> Il giorno 03/ott/07, alle ore 01:26, Maddes ha scritto:
> >>
> >>> Hello Luca,
> >>>
> >>> the fastest way is to search the user mailing list.
> >>> There you find lots of information regarding this topic,
> e.g this thread
> >>> at
> >>>
> http://subversion.tigris.org/servlets/ReadMsg?listName=users&m
> sgNo=70313
> >>>
> >>> Regards
> >>> Maddes
> >>>
> >>> On 03.10.2007 01:14, Ryan Schmidt wrote:
> >>>> On Oct 2, 2007, at 17:10, Luca Torella wrote:
> >>>>
> >>>>> i'm working on an haskell project and i'm using svn.
> >>>>> I'd like that, in the splash screen of the command line
> interface of
> >>>>> my program, will appear the version of the revision.
> Someone knows how
> >>>>> i can get this information fast?
> >>>> http://subversion.tigris.org/faq.html#version-value-in-source
> >>>>
> >>>>
> >>>>
> >>>>
> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> >>>> For additional commands, e-mail: users-help@subversion.tigris.org
> >>>>
> >>>>
> >>
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHA4EtUXXT+9wZdbURAk4YAKDaONPF0VMHX204mo5RyEtRjVQjsACdE6lw
> ibB4AWxbbMWtV/QYhaG5XD0=
> =UMsa
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Oct 3 15:33:04 2007

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.