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

Re: Forcing update of the $keywords$

From: Ryan Schmidt <subversion-2006q2_at_ryandesign.com>
Date: 2006-06-21 20:18:46 CEST

On Jun 21, 2006, at 18:44, Luc Mercier wrote:

> Ryan Schmidt wrote:
>
>> On Jun 5, 2006, at 21:18, Luc Mercier wrote:
>>
>>> I'm using the keywords $Date$, $Rev$, etc. in some file. The
>>> problem I have is that these keywords are subsituted when on an
>>> update or a checkout, but not after a commit, resulting in the
>>> subsituted value to be not up to date. The problem is especially
>>> bothering if there's only one person working on a project,
>>> because in that case after the initial checkout the file will
>>> never be updated.
>>>
>>> So far, I have two workarounds :
>>> * After each commit, delete the file in the working copy and do
>>> an update... It works, but that's really annoying
>>> * Have two working copies, and each time you commit from one,
>>> you start working in the other one... That's not better.
>>
>>
>> I don't understand. You say the keywords are updated on update,
>> but not on commit? That's not what I see. With Subversion 1.3.2
>> on Mac OS X, the keywords update when I commit:

[snipped example]

> Oh, yeah, my message was really not that accurate. Sorry for that.
> Here is a new message:
>
> --
> Hi,
>
> The keywords $Date$, $Rev$, etc. are handful, but they refer only
> to the current file. I want to use this kind of feature, for
> example, in a Latex project, to have a footnote on the first page
> reading "this is revision XXX", like on the cover page of the
> Subversion book.
>
> In this case, the file revision is irrelevant. What you want is the
> revision number of the directory containing the document, ie the
> max of the revision number of files contained in this directory
> (recursively). The problem is that it is likely that the $Rev$ will
> be located in a file which will very rarely be modified. What I do
> so far is adding/deleting a blank line in the file containing the
> $Rev$ before each commit, to force the revision number of the file
> to match the one of the directory. Of course, that's a really bad -
> and annoying - solution.
>
> Another solution would to call svnversion before compiling the
> document, dump the output to a file, and have in the latex code an
> input to this file to retreive the information... What a pain.
>
> Is there any reason why there is no keyword called $DirRev$,
> $DirAuthor$...? How to work around that? Does anyone know how the
> authors of the Subversion book are producing this "compiled from
> revision XX" for their book?

The "svnversion" method is the one endorsed by the FAQ and it's the
one I'd recommend as well:

http://subversion.tigris.org/faq.html#version-value-in-source

That page also explains that a keyword like your proposed $DirRev$
would be woefully slow, which is why it doesn't exist.

I haven't used LaTeX myself, but in a programming language like C or
PHP it wouldn't really be too inconvenient to read in the contents of
a file to display it somewhere.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Jun 21 20:20:28 2006

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.