From ggrothendieck at gmail.com  Sat Oct  8 13:09:46 2005
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Sat, 8 Oct 2005 07:09:46 -0400
Subject: [Rd] svn version number
In-Reply-To: <4346BA25.9030606@stats.uwo.ca>
References: <971536df0510070612m1e45d1e8ya4f51afdc1e698b7@mail.gmail.com>
	<43469C13.2020206@stats.uwo.ca>
	<971536df0510070923t45f310e1ic63fa4734ac954@mail.gmail.com>
	<4346BA25.9030606@stats.uwo.ca>
Message-ID: <971536df0510080409v184a5f0av5b128705dab495ed@mail.gmail.com>

On 10/7/05, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
> Gabor Grothendieck wrote:
> > On 10/7/05, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
> >
> >>Gabor Grothendieck wrote:
> >>
> >>>Is there some way of automatically including the svn version number
> >>>of a package in the DESCRIPTION file or otherwise so that one
> >>>can check from within R which svn version number one has?
> >>
> >>You could do this by writing it into your Makefile, but there's no other
> >>existing support for it.  I'd recommend combining the URL reported by
> >>"svn info" with the result of svnversion to get the most informative
> >>version.  Watch out for cases of people who are trying to make your
> >>package from a tarfile, rather than an svn checkout.  We have ended up
> >>with some fairly tricky Makefile programming to get what we want into
> >>the R banner.
> >
> >
> > There is no makefile at all currently as my package is all R.  Also, I
> > currently use TortoiseSVN.
>
> Probably the simplest option is to set an svn:keywords property on one
> of your source files, and get Subversion to put the revision number into
> the source when you check out.  This won't tell you if you've got a
> mixed or modified revision, but as long as you are careful not to do
> this, it might give you what you want.
>
> I've got no idea how to do this in TortoiseSVN (I use command line svn),
> but presumably the documentation will talk about it.
>
> Duncan Murdoch
>

Thanks.  That seems to work.  I created a file called VERSION
in the inst subdirectory with the single line:

$Id$

and added Id to that file's svn properties by right-clicking on
VERSION file in Windows Explorer, choosing Properties, click
on Subversion tab and enter the Id property. I then did a commit.

I was originally thinking of putting the version information in the
DESCRIPTION file since I think that that is where one would
normally look but am not too sure if there is a logical place for it
there so for the moment at least its in my VERSION file and one
can access it from R via:

    file.show(system.file("VERSION", package = "mypkg"))

Question: Any other ideas of a good place to put this information?
The key requirement I have is that it should be accessible from
within R so that one can check that one is using the svn version
that one thinks one is using.



[Rd] svn version number
Gabor Grothendieck